trying to get recursive output working from partitioned eq
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 24 Jan 2020 16:51:51 +0000 (16:51 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 24 Jan 2020 16:51:51 +0000 (16:51 +0000)
src/ieee754/part_cmp/equal.py

index 7728d4c3c3a0177eaccc6ef04948f5d2c724bdcd..2eb4604362eaebfdad4672560e2696ae45138473 100644 (file)
@@ -44,14 +44,17 @@ class PartitionedEq(Elaboratable):
 
         # now, based on the partition points, create the (multi-)boolean result
         eqsigs = []
-        for i in range(self.mwidth):
+        idxs = list(range(self.mwidth))
+        #idxs.reverse()
+        for i in idxs:
             eqsig = Signal(name="eqsig%d"%i, reset_less=True)
+            eqsigs.append(eqsig)
+        for i in idxs:
             if i == 0:
-                comb += eqsig.eq(eqs[i])
+                comb += eqsigs[i].eq(eqs[i])
             else:
-                ppt = self.partition_points[keys[i-1]]
-                comb += eqsig.eq(eqs[i] & ppt & eqsigs[i-1])
-            eqsigs.append(eqsig)
+                ppt = ~self.partition_points[keys[i-1]]
+                comb += eqsigs[i].eq((eqsigs[i-1] & ppt) | ~eqs[i])
         print ("eqsigs", eqsigs, self.output.shape())
 
         # assign cascade-SIMD-compares to output