From f91d882893e74b0c26c06ad92221d69d768911d6 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 24 Feb 2020 14:35:11 +0000 Subject: [PATCH] zero bitmask in Shifter --- src/ieee754/part_shift/part_shift_dynamic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ieee754/part_shift/part_shift_dynamic.py b/src/ieee754/part_shift/part_shift_dynamic.py index 93188618..7e5134fd 100644 --- a/src/ieee754/part_shift/part_shift_dynamic.py +++ b/src/ieee754/part_shift/part_shift_dynamic.py @@ -42,6 +42,7 @@ class ShifterMask(Elaboratable): bl = [] for j in range(self.pwid): bit = Signal(self.pwid, name="bit%d" % j, reset_less=True) + comb += bit.eq(C(0, self.pwid)) if j != 0: comb += bit.eq((~self.gates[j]) & bl[j-1]) else: @@ -50,7 +51,7 @@ class ShifterMask(Elaboratable): # XXX ARGH, really annoying: simulation bug, can't use Cat(*bl). for j in range(bits.shape()[0]): comb += bits[j].eq(bl[j]) - comb += self.mask.eq(Cat(minm, bits) & maxm) + comb += self.mask.eq(Cat(minm, bits) & C(maxm, self.mask.shape())) return m -- 2.30.2