From: Luke Kenneth Casson Leighton Date: Sat, 15 Feb 2020 15:12:41 +0000 (+0000) Subject: truncate max_bits in shiftermask X-Git-Tag: ls180-24jan2020~154 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01451af4916c053ae7b95d48761a1ee02d518e89;p=ieee754fpu.git truncate max_bits in shiftermask --- 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)