From 7ecdd0f649958eea4d31a8135d58e99d18ccacc4 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 13 Feb 2020 15:27:17 +0000 Subject: [PATCH] OR element in after the MUX because its an invariant --- src/ieee754/part_shift/part_shift_dynamic.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ieee754/part_shift/part_shift_dynamic.py b/src/ieee754/part_shift/part_shift_dynamic.py index 1e76a188..b82fc467 100644 --- a/src/ieee754/part_shift/part_shift_dynamic.py +++ b/src/ieee754/part_shift/part_shift_dynamic.py @@ -110,7 +110,14 @@ class PartitionedDynamicShift(Elaboratable): print(keys[i-1]) temp = Signal(e-s+1, name="intermed%d" % i) print(intermed[keys[0]:]) - intermed = Mux(gates[i-1], element, element | intermed[keys[0]:]) + # XXX bit of a mess here, but rather than select + # element or (element | intermed), select between 0 or intermed + # then unconditionally "|" element on top (once copied into + # a named Signal) + intermed = Mux(gates[i-1], 0, intermed[keys[0]:]) + intermed2 = Signal(intermed.shape()) + comb += intermed2.eq(intermed | element) + intermed = intermed2 comb += temp.eq(intermed) out.append(temp[:e-s]) -- 2.30.2