core: fix Trigger flush when disabled

This commit is contained in:
Florent Kermarrec 2018-12-28 10:38:23 +01:00
parent 1634fa35bb
commit c1d8bdf6f2
1 changed files with 2 additions and 2 deletions

View File

@ -65,12 +65,12 @@ class _Trigger(Module, AutoCSR):
# hit and memory read/flush # hit and memory read/flush
hit = Signal() hit = Signal()
flush = WaitTimer(depth) flush = WaitTimer(2*depth)
self.submodules += flush self.submodules += flush
self.comb += [ self.comb += [
flush.wait.eq(~(~enable & enable_d)), # flush when disabling flush.wait.eq(~(~enable & enable_d)), # flush when disabling
hit.eq((sink.data & mem.source.mask) == mem.source.value), hit.eq((sink.data & mem.source.mask) == mem.source.value),
mem.source.ready.eq(enable & (hit | ~flush.done)), mem.source.ready.eq((enable & hit) | ~flush.done),
] ]
# output # output