mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
genlib/fifo: same 'level' semantics between SyncFIFOBuffered and FWFT SyncFIFO
This commit is contained in:
parent
09ebcc47aa
commit
4cacf97088
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue