From: Luke Kenneth Casson Leighton Date: Sat, 3 Aug 2019 22:39:12 +0000 (+0100) Subject: only pass on the uncancelled mask bits X-Git-Tag: ls180-24jan2020~551 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ecc0461e2bbe497a282274d1fddd9304f389f5d6;p=ieee754fpu.git only pass on the uncancelled mask bits --- 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