truncate partial result intermediate to width of partition
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 15 Feb 2020 13:01:39 +0000 (13:01 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 15 Feb 2020 13:01:39 +0000 (13:01 +0000)
src/ieee754/part_shift/part_shift_dynamic.py

index fd2ecaf99368f2355e4b93943e346678e3abe076..75e3fe4951c7c21549f80fe94096e64f89dce954 100644 (file)
@@ -143,9 +143,9 @@ class PartitionedDynamicShift(Elaboratable):
         for i in range(1, len(keys)):
             start, end = (intervals[i][0], width)
             reswid = width - start
-            sel = Mux(gates[i-1], 0, result[intervals[0][1]:])[:end-start]
+            sel = Mux(gates[i-1], 0, result[intervals[0][1]:][:end-start])
             print("select: [%d:%d]" % (start, end))
-            res = Signal(reswid, name="res%d" % i, reset_less=True)
+            res = Signal(end-start+1, name="res%d" % i, reset_less=True)
             comb += res.eq(partial_results[i] | sel)
             result = res
             s,e = intervals[0]