From c1d8bdf6f23b1070b8bd2dd277a4708863474148 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 28 Dec 2018 10:38:23 +0100 Subject: [PATCH] core: fix Trigger flush when disabled --- litescope/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litescope/core.py b/litescope/core.py index 803b860..08f6a28 100644 --- a/litescope/core.py +++ b/litescope/core.py @@ -65,12 +65,12 @@ class _Trigger(Module, AutoCSR): # hit and memory read/flush hit = Signal() - flush = WaitTimer(depth) + flush = WaitTimer(2*depth) self.submodules += flush self.comb += [ flush.wait.eq(~(~enable & enable_d)), # flush when disabling 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