From: Michael Nolan Date: Wed, 12 Feb 2020 16:22:18 +0000 (-0500) Subject: Somewhat working dynamic shifter X-Git-Tag: ls180-24jan2020~190 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7ca66316ee5a720159fd97d1594c97ee5d1c67b4;p=ieee754fpu.git Somewhat working dynamic shifter --- diff --git a/src/ieee754/part_shift_scalar/part_shift_dynamic.py b/src/ieee754/part_shift_scalar/part_shift_dynamic.py index d3bd0c08..a32e5bfd 100644 --- a/src/ieee754/part_shift_scalar/part_shift_dynamic.py +++ b/src/ieee754/part_shift_scalar/part_shift_dynamic.py @@ -31,7 +31,8 @@ class PartitionedDynamicShift(Elaboratable): m = Module() comb = m.d.comb width = self.width - gates = self.partition_points.as_sig() + gates = Signal(self.partition_points.get_max_partition_count(width)-1) + comb += gates.eq(self.partition_points.as_sig()) matrix = [] keys = list(self.partition_points.keys()) + [self.width] @@ -40,9 +41,10 @@ class PartitionedDynamicShift(Elaboratable): for i in range(len(keys)): row = [] start = 0 - for i in range(len(keys)): - end = keys[i] - row.append(Signal(width - start)) + for j in range(len(keys)): + end = keys[j] + row.append(Signal(width - start, + name="matrix[%d][%d]" % (i, j))) matrix.append(row) a_intervals = [] @@ -70,12 +72,18 @@ class PartitionedDynamicShift(Elaboratable): for i in range(1, len(out_intervals)): index = gates[:i] # selects the 'i' least significant bits # of gates - for index in range(1<<(i-1)): + element = Signal(width, name="element%d" % i) + for index in range(1<