From 4cacf970880c5c5ba21b339bac28462b442ff8b1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 17 Sep 2014 19:58:43 +0800 Subject: [PATCH] genlib/fifo: same 'level' semantics between SyncFIFOBuffered and FWFT SyncFIFO --- migen/genlib/fifo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/migen/genlib/fifo.py b/migen/genlib/fifo.py index f29309b5..2f3b8033 100644 --- a/migen/genlib/fifo.py +++ b/migen/genlib/fifo.py @@ -141,18 +141,19 @@ class SyncFIFOBuffered(Module, _FIFOInterface): self.we = fifo.we self.dout_bits = fifo.dout_bits self.dout = fifo.dout - self.level = fifo.level + self.level = Signal(max=depth+2) self.replace = fifo.replace ### - self.comb += fifo.re.eq(fifo.readable & (~self.readable | self.re)), + self.comb += fifo.re.eq(fifo.readable & (~self.readable | self.re)) self.sync += \ If(fifo.re, self.readable.eq(1), ).Elif(self.re, self.readable.eq(0), ) + self.comb += self.level.eq(fifo.level + self.readable) class AsyncFIFO(Module, _FIFOInterface): """Asynchronous FIFO (first in, first out) -- 2.30.2