From: Sebastien Bourdeauducq Date: Wed, 17 Sep 2014 11:58:43 +0000 (+0800) Subject: genlib/fifo: same 'level' semantics between SyncFIFOBuffered and FWFT SyncFIFO X-Git-Tag: 24jan2021_ls180~2099^2~293 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4cacf970880c5c5ba21b339bac28462b442ff8b1;p=litex.git genlib/fifo: same 'level' semantics between SyncFIFOBuffered and FWFT SyncFIFO --- 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)