From 01451af4916c053ae7b95d48761a1ee02d518e89 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 15 Feb 2020 15:12:41 +0000 Subject: [PATCH] truncate max_bits in shiftermask --- src/ieee754/part_shift/part_shift_dynamic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ieee754/part_shift/part_shift_dynamic.py b/src/ieee754/part_shift/part_shift_dynamic.py index 96334e7c..6cbf691a 100644 --- a/src/ieee754/part_shift/part_shift_dynamic.py +++ b/src/ieee754/part_shift/part_shift_dynamic.py @@ -54,13 +54,13 @@ class PartitionedDynamicShift(Elaboratable): start = end min_bits = math.ceil(math.log2(intervals[0][1] - intervals[0][0])) - max_bits = math.ceil(math.log2(width)) # shifts are normally done as (e.g. for 32 bit) result = a & (b&0b11111) # truncating the b input. however here of course the size of the # partition varies dynamically. shifter_masks = [] for i in range(len(b_intervals)): + max_bits = math.ceil(math.log2(width-intervals[i][0])) mask = Signal(b_intervals[i].shape(), name="shift_mask%d" % i, reset_less=True) bits = Signal(pwid-i, name="bits%d" % i, reset_less=True) -- 2.30.2