Commit e63093ba authored by N. Engelhardt's avatar N. Engelhardt Committed by Sébastien Bourdeauducq
Browse files

genlib/fifo: fix data output changing while not reading when fifo is full in non-fwft mode

parent 13ee25bc
from migen.fhdl.structure import * from migen.fhdl.structure import *
from migen.fhdl.module import Module from migen.fhdl.module import Module
from migen.fhdl.specials import Memory from migen.fhdl.specials import Memory, READ_FIRST
from migen.fhdl.bitcontainer import log2_int from migen.fhdl.bitcontainer import log2_int
from migen.fhdl.decorators import ClockDomainsRenamer from migen.fhdl.decorators import ClockDomainsRenamer
from migen.genlib.cdc import MultiReg, GrayCounter from migen.genlib.cdc import MultiReg, GrayCounter
...@@ -89,7 +89,7 @@ class SyncFIFO(Module, _FIFOInterface): ...@@ -89,7 +89,7 @@ class SyncFIFO(Module, _FIFOInterface):
storage = Memory(self.width, depth) storage = Memory(self.width, depth)
self.specials += storage self.specials += storage
wrport = storage.get_port(write_capable=True) wrport = storage.get_port(write_capable=True, mode=READ_FIRST)
self.specials += wrport self.specials += wrport
self.comb += [ self.comb += [
If(self.replace, If(self.replace,
...@@ -106,7 +106,7 @@ class SyncFIFO(Module, _FIFOInterface): ...@@ -106,7 +106,7 @@ class SyncFIFO(Module, _FIFOInterface):
do_read = Signal() do_read = Signal()
self.comb += do_read.eq(self.readable & self.re) self.comb += do_read.eq(self.readable & self.re)
rdport = storage.get_port(async_read=fwft, has_re=not fwft) rdport = storage.get_port(async_read=fwft, has_re=not fwft, mode=READ_FIRST)
self.specials += rdport self.specials += rdport
self.comb += [ self.comb += [
rdport.adr.eq(consume), rdport.adr.eq(consume),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment