chisel2-deprecated icon indicating copy to clipboard operation
chisel2-deprecated copied to clipboard

Fixed AsyncFifo so reset not tied to 0

Open da-steve101 opened this issue 9 years ago • 4 comments

Previous logic was

if reset = 1
  s1_rst = 0
else
  s1_rst = reset // reset = 0

changed to

s1_rst = reset

da-steve101 avatar Apr 11 '16 22:04 da-steve101

Can one of the admins verify this patch?

ghost avatar Apr 11 '16 22:04 ghost

ok to test

ucbjrl avatar Apr 11 '16 23:04 ucbjrl

That looks correct to me. However, I'm also wondering about the other Regs that are reset with init=. They appear to be using the module's implicit reset, which is probably incorrect for either the read side or the write side... right?

aswaterman avatar Apr 13 '16 18:04 aswaterman

No, assuming things haven't changed too much since I last peered into the recesses of chisel MCD code: If a register defines an explicit clock, then the reset signal attached to that clock is used to reset that register. AFAIK, nothing in that module uses the implicit reset.

I think, on a more philosophical level, if this AsyncFIFO is going to get some more exposure, its 'contract' (particular, reset behavior across clock domains) should be more explicitly explained spelled out. If I recall, this AsyncFIFO relies on higher-level reset synchronization between the clock domains. For example, you will get incorrect behavior if one side goes in and out of reset and the other side does not reset. Also, the module assumes that it is OK to use only 2 registers to construct a synchronizer between the two clock domains.

sdtwigg avatar Apr 13 '16 18:04 sdtwigg