From: Luke Kenneth Casson Leighton Date: Sat, 17 Aug 2019 08:00:18 +0000 (+0100) Subject: boolean logic inversion, x = ~a & ~b & ~c ==> ~(a | b | c) then use list X-Git-Tag: ls180-24jan2020~516 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=007351a8b5c54e1eb02e840f9ce84d6f4ee65ba3;p=ieee754fpu.git boolean logic inversion, x = ~a & ~b & ~c ==> ~(a | b | c) then use list of terms, use bool(), and graph size is reduced --- diff --git a/src/ieee754/part_mul_add/multiply.py b/src/ieee754/part_mul_add/multiply.py index 5be8768c..6e2596be 100644 --- a/src/ieee754/part_mul_add/multiply.py +++ b/src/ieee754/part_mul_add/multiply.py @@ -514,11 +514,16 @@ class Mul8_16_32_64(Elaboratable): for a_index in range(8): for b_index in range(8): - term_enabled: Value = C(True, 1) + terms = [] min_index = min(a_index, b_index) max_index = max(a_index, b_index) for i in range(min_index, max_index): - term_enabled &= ~self._part_byte(i) + pbs = Signal(reset_less=True) + m.d.comb += pbs.eq(self._part_byte(i)) + terms.append(pbs) + name = "te_%d_%d" % (a_index, b_index) + term_enabled = Signal(name=name, reset_less=True) + m.d.comb += term_enabled.eq(~(Cat(*terms).bool())) add_term(products[a_index][b_index], 8 * (a_index + b_index), term_enabled)