From a70d0926aef757ee5e2ac7375c9661ca5aa9ec6a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 17 Aug 2019 11:48:58 +0100 Subject: [PATCH] use Cat (again) on intermediate values --- src/ieee754/part_mul_add/multiply.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/ieee754/part_mul_add/multiply.py b/src/ieee754/part_mul_add/multiply.py index aef8b918..b22a69c1 100644 --- a/src/ieee754/part_mul_add/multiply.py +++ b/src/ieee754/part_mul_add/multiply.py @@ -523,25 +523,20 @@ class Mul8_16_32_64(Elaboratable): .eq(self._delayed_part_ops[j][i]) for j in range(len(self.register_levels))] - def add_intermediate_value(value): - intermediate_value = Signal(len(value), reset_less=True) - m.d.comb += intermediate_value.eq(value) - return intermediate_value - for parts, delayed_parts in [(self._part_64, self._delayed_part_64), (self._part_32, self._delayed_part_32), (self._part_16, self._delayed_part_16), (self._part_8, self._delayed_part_8)]: byte_count = 8 // len(parts) for i in range(len(parts)): - pb = pbs[i * byte_count - 1] - value = add_intermediate_value(pb) + pbl = [] + pbl.append(~pbs[i * byte_count - 1]) for j in range(i * byte_count, (i + 1) * byte_count - 1): - pb = add_intermediate_value(~pbs[j]) - value = add_intermediate_value(value & pb) - pb = pbs[(i + 1) * byte_count - 1] - value = add_intermediate_value(value & pb) - m.d.comb += parts[i].eq(value) + pbl.append(pbs[j]) + pbl.append(~pbs[(i + 1) * byte_count - 1]) + value = Signal(len(pbl), reset_less=True) + m.d.comb += value.eq(Cat(*pbl)) + m.d.comb += parts[i].eq(~(value).bool()) m.d.comb += delayed_parts[0][i].eq(parts[i]) m.d.sync += [delayed_parts[j + 1][i].eq(delayed_parts[j][i]) for j in range(len(self.register_levels))] -- 2.30.2