Skip to content

Commit 3b4d6c2

Browse files
committed
Corrigindo implementação da fifo
1 parent 2d46fae commit 3b4d6c2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rtl/fifo.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ always_ff @(posedge clk) begin
4646
end
4747

4848
// FIFO cheia: ocorre quando o próximo `write_ptr` encontra `read_ptr`
49-
assign full_o = (write_ptr[PTR_WIDTH] != read_ptr[PTR_WIDTH]) &&
50-
(write_ptr[PTR_WIDTH - 1'b1:0] == read_ptr[PTR_WIDTH - 1'b1:0]);
49+
assign full_o = (write_ptr[PTR_WIDTH] == read_ptr[PTR_WIDTH] - 1) ||
50+
(read_ptr[PTR_WIDTH - 1'b1:0] == 0 && write_ptr[PTR_WIDTH - 1'b1:0] == DEPTH - 1'b1);
5151

5252
// FIFO vazia: ocorre quando os ponteiros são iguais
5353
assign empty_o = (write_ptr == read_ptr);

0 commit comments

Comments
 (0)