[libre-riscv-dev] [Bug 173] dynamic partitioned "shift"

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Sat Feb 15 12:43:10 GMT 2020


http://bugs.libre-riscv.org/show_bug.cgi?id=173

--- Comment #33 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
another one.  again, the Mux-chain result = Mux(gates, partial, result)
was creating a massive chain that was being duplicated:

output[0] = result
output[1] = Mux(gates, partial, result)
output[2] = Mux(gates, partial, Mux(gates, partial, result))
...
output[N] = Mux(Mux(Mux(Mux(Mux(Mux(......))))))))))

this does *NOT* get "optimised out" so you have to be extremely careful
to make absolutely sure that the input on these kinds of chains is
*not* an "expression", but *only* a signal to which the expression has
been *assigned*.


index 9e214d0..aebcef5 100644
--- a/src/ieee754/part_shift/part_shift_dynamic.py
+++ b/src/ieee754/part_shift/part_shift_dynamic.py
@@ -145,6 +145,7 @@ class PartitionedDynamicShift(Elaboratable):
             print("select: [%d:%d]" % (start, end))
             res = Signal(width, name="res%d" % i, reset_less=True)
             comb += res.eq(result)
+            result = res
             s,e = intervals[0]
             out.append(res[s:e])

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list