Correctly handle resets in AsyncFIFO.
This commit improves handling of resets in AsyncFIFO in two ways: * First, resets no longer violate Gray counter CDC invariants. * Second, write domain reset now empties the entire FIFO.
This commit is contained in:
parent
12c79025f3
commit
4601dd0a69
3 changed files with 41 additions and 5 deletions
|
|
@ -220,6 +220,9 @@ class FIFOContractSpec(Elaboratable):
|
|||
with m.If(Past(Initial(), self.bound - 1)):
|
||||
m.d.comb += Assert(read_fsm.ongoing("DONE"))
|
||||
|
||||
with m.If(ResetSignal(domain=self.w_domain)):
|
||||
m.d.comb += Assert(~fifo.r_rdy)
|
||||
|
||||
if self.w_domain != "sync" or self.r_domain != "sync":
|
||||
m.d.comb += Assume(Rose(ClockSignal(self.w_domain)) |
|
||||
Rose(ClockSignal(self.r_domain)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue