From: Luke Kenneth Casson Leighton Date: Tue, 20 Aug 2019 13:51:23 +0000 (+0100) Subject: move part_byte to PartitionPoints X-Git-Tag: ls180-24jan2020~457 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bed99477b8caa0689e1f1bbe7759f885f046fccd;p=ieee754fpu.git move part_byte to PartitionPoints --- diff --git a/src/ieee754/part_mul_add/multiply.py b/src/ieee754/part_mul_add/multiply.py index e8aedb2d..a0c1599e 100644 --- a/src/ieee754/part_mul_add/multiply.py +++ b/src/ieee754/part_mul_add/multiply.py @@ -103,6 +103,12 @@ class PartitionPoints(dict): return False return True + def part_byte(self, index, mfactor=1): # mfactor used for "expanding" + if index == -1 or index == 7: + return C(True, 1) + assert index >= 0 and index < 8 + return self[(index * 8 + 8)*mfactor] + class FullAdder(Elaboratable): """Full Adder. @@ -966,12 +972,6 @@ class Mul8_16_32_64(Elaboratable): # output self.output = Signal(64) - def _part_byte(self, index): - if index == -1 or index == 7: - return C(True, 1) - assert index >= 0 and index < 8 - return self.part_pts[index * 8 + 8] - def elaborate(self, platform): m = Module() @@ -980,7 +980,7 @@ class Mul8_16_32_64(Elaboratable): tl = [] for i in range(8): pb = Signal(name="pb%d" % i, reset_less=True) - m.d.comb += pb.eq(self._part_byte(i)) + m.d.comb += pb.eq(self.part_pts.part_byte(i)) tl.append(pb) m.d.comb += pbs.eq(Cat(*tl))