make things a little clearer, do the select and the OR separately
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 15 Feb 2020 12:56:32 +0000 (12:56 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 15 Feb 2020 12:56:32 +0000 (12:56 +0000)
src/ieee754/part_shift/part_shift_dynamic.py

index cf83f1acb43b03f864f96283fbaa25717136f09c..fd2ecaf99368f2355e4b93943e346678e3abe076 100644 (file)
@@ -143,11 +143,10 @@ class PartitionedDynamicShift(Elaboratable):
         for i in range(1, len(keys)):
             start, end = (intervals[i][0], width)
             reswid = width - start
-            result = partial_results[i] | \
-                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)
-            comb += res.eq(result)
+            comb += res.eq(partial_results[i] | sel)
             result = res
             s,e = intervals[0]
             out.append(res[s:e])