From ecc0461e2bbe497a282274d1fddd9304f389f5d6 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 3 Aug 2019 23:39:12 +0100 Subject: [PATCH] only pass on the uncancelled mask bits --- src/nmutil/singlepipe.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nmutil/singlepipe.py b/src/nmutil/singlepipe.py index 17df104c..7f146585 100644 --- a/src/nmutil/singlepipe.py +++ b/src/nmutil/singlepipe.py @@ -432,12 +432,15 @@ class MaskCancellable(ControlBase): # is NOT "normal" for the Stage API. p_valid_i = Signal(reset_less=True) #print ("self.p.data_i", self.p.data_i) - m.d.comb += p_valid_i.eq(((self.p.mask_i & ~self.p.stop_i).bool())) + maskedout = Signal(len(self.p.mask_i), reset_less=True) + m.d.comb += maskedout.eq(self.p.mask_i & ~self.p.stop_i) + m.d.comb += p_valid_i.eq(maskedout.bool()) # if idmask nonzero, mask gets passed on (and register set). # register is left as-is if idmask is zero, but out-mask is set to zero + # note however: only the *uncancelled* mask bits get passed on m.d.sync += self.n.valid_o.eq(p_valid_i) - m.d.sync += self.n.mask_o.eq(Mux(p_valid_i, self.p.mask_i, 0)) + m.d.sync += self.n.mask_o.eq(Mux(p_valid_i, maskedout, 0)) with m.If(p_valid_i): data_o = self._postprocess(result) # XXX TBD, does nothing right now m.d.sync += nmoperator.eq(self.n.data_o, data_o) # update output -- 2.30.2