reduce width of temporary intermediates
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 13 Feb 2020 15:42:51 +0000 (15:42 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 13 Feb 2020 15:42:51 +0000 (15:42 +0000)
src/ieee754/part_shift/part_shift_dynamic.py

index df268810d9a6580a5676db45f8a168bedfc540e8..a0dac157bbf31e8f68165ed08ce5dee8aabf8533 100644 (file)
@@ -100,7 +100,7 @@ class PartitionedDynamicShift(Elaboratable):
             s, e = intervals[i]
             index = gates[:i]  # selects the 'i' least significant bits
                                # of gates
-            element = Signal(width, name="element%d" % i)
+            element = Signal(matrix[0][i].width, name="element%d" % i)
             for index in range(1<<i):
                 print(index)
                 with m.Switch(gates[:i]):
@@ -108,7 +108,7 @@ class PartitionedDynamicShift(Elaboratable):
                         index = math.ceil(math.log2(index + 1))
                         comb += element.eq(matrix[index][i])
             print(keys[i-1])
-            temp = Signal(e-s+1, name="intermed%d" % i)
+            temp = Signal(element.width, name="intermed%d" % i)
             print(intermed[keys[0]:])
             # XXX bit of a mess here, but rather than select
             # element or (element | intermed), select between 0 or intermed