move expanded_part_pts further up
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 20 Aug 2019 13:53:58 +0000 (14:53 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 20 Aug 2019 13:53:58 +0000 (14:53 +0100)
src/ieee754/part_mul_add/multiply.py

index a0c1599ed2aa73dc4cb1341a5807bd98288fbaf5..084f7dde62a7f1f98ac15b4a8c4b02a42de6fe3c 100644 (file)
@@ -984,6 +984,13 @@ class Mul8_16_32_64(Elaboratable):
             tl.append(pb)
         m.d.comb += pbs.eq(Cat(*tl))
 
+        # create (doubled) PartitionPoints (output is double input width)
+        expanded_part_pts = PartitionPoints()
+        for i, v in self.part_pts.items():
+            ep = Signal(name=f"expanded_part_pts_{i*2}", reset_less=True)
+            expanded_part_pts[i * 2] = ep
+            m.d.comb += ep.eq(v)
+
         # local variables
         signs = []
         for i in range(8):
@@ -1037,12 +1044,6 @@ class Mul8_16_32_64(Elaboratable):
                 m.d.comb += mod.orin[i].eq(l[i])
             terms.append(mod.orout)
 
-        expanded_part_pts = PartitionPoints()
-        for i, v in self.part_pts.items():
-            signal = Signal(name=f"expanded_part_pts_{i*2}", reset_less=True)
-            expanded_part_pts[i * 2] = signal
-            m.d.comb += signal.eq(v)
-
         add_reduce = AddReduce(terms,
                                128,
                                self.register_levels,