From 219a90122fc43a1d3c7f18b541f8c0e87aab9c1d Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 2 Sep 2020 17:09:25 +0200 Subject: [PATCH] core/Trigger: also apply mask to trigger value (avoid having doing it in software). --- litescope/core.py | 3 +-- litescope/software/driver/analyzer.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/litescope/core.py b/litescope/core.py index 8cfc8cd..fa3c698 100644 --- a/litescope/core.py +++ b/litescope/core.py @@ -80,7 +80,7 @@ class _Trigger(Module, AutoCSR): self.submodules += flush self.comb += [ 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.mask)), mem.source.ready.eq((enable & hit) | ~flush.done), ] @@ -92,7 +92,6 @@ class _Trigger(Module, AutoCSR): source.hit.eq(done) ] - class _SubSampler(Module, AutoCSR): def __init__(self, data_width): self.sink = sink = stream.Endpoint(core_layout(data_width)) diff --git a/litescope/software/driver/analyzer.py b/litescope/software/driver/analyzer.py index 95ab7de..37979b4 100644 --- a/litescope/software/driver/analyzer.py +++ b/litescope/software/driver/analyzer.py @@ -80,7 +80,7 @@ class LiteScopeAnalyzerDriver: if cond is not None: for k, v in cond.items(): value |= getattr(self, k + "_o")*v - mask |= getattr(self, k + "_m") + mask |= getattr(self, k + "_m") self.trigger_mem_mask.write(mask) self.trigger_mem_value.write(value) self.trigger_mem_write.write(1)