We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d46fae commit 3b4d6c2Copy full SHA for 3b4d6c2
1 file changed
rtl/fifo.sv
@@ -46,8 +46,8 @@ always_ff @(posedge clk) begin
46
end
47
48
// 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]);
+assign full_o = (write_ptr[PTR_WIDTH] == read_ptr[PTR_WIDTH] - 1) ||
+ (read_ptr[PTR_WIDTH - 1'b1:0] == 0 && write_ptr[PTR_WIDTH - 1'b1:0] == DEPTH - 1'b1);
51
52
// FIFO vazia: ocorre quando os ponteiros são iguais
53
assign empty_o = (write_ptr == read_ptr);
0 commit comments