From 4d31bab9e4e1bda62aa7965c4acb56aa0ebf39de Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 7 Feb 2020 14:07:45 +0000 Subject: [PATCH] ripple of LSB from compare-operations, successful --- src/ieee754/part/test/test_partsig.py | 2 +- src/ieee754/part_cmp/eq_gt_ge.py | 1 + src/ieee754/part_cmp/ripple.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ieee754/part/test/test_partsig.py b/src/ieee754/part/test/test_partsig.py index 2dd76bc8..0229794e 100644 --- a/src/ieee754/part/test/test_partsig.py +++ b/src/ieee754/part/test/test_partsig.py @@ -131,7 +131,7 @@ class TestPartitionPoints(unittest.TestCase): for i, mask in enumerate(mask_list): if test_fn(a, b, mask): # OR y with the lowest set bit in the mask - y |= (maskbit_list[i] & ~(maskbit_list[i]-1)) + y |= maskbit_list[i] # check the result outval = (yield getattr(module, "%s_output" % mod_attr)) msg = f"{msg_prefix}: {mod_attr} 0x{a:X} == 0x{b:X}" + \ diff --git a/src/ieee754/part_cmp/eq_gt_ge.py b/src/ieee754/part_cmp/eq_gt_ge.py index 077f3aef..c6f15b36 100644 --- a/src/ieee754/part_cmp/eq_gt_ge.py +++ b/src/ieee754/part_cmp/eq_gt_ge.py @@ -20,6 +20,7 @@ from nmigen.cli import main, rtlil from ieee754.part_mul_add.partpoints import PartitionPoints from ieee754.part_cmp.gt_combiner import GTCombiner from ieee754.part_cmp.reorder_results import ReorderResults +from ieee754.part_cmp.ripple import RippleLSB class PartitionedEqGtGe(Elaboratable): diff --git a/src/ieee754/part_cmp/ripple.py b/src/ieee754/part_cmp/ripple.py index b758c284..a300fb03 100644 --- a/src/ieee754/part_cmp/ripple.py +++ b/src/ieee754/part_cmp/ripple.py @@ -26,7 +26,7 @@ class RippleLSB(Elaboratable): comb += self.output[0].eq(current_result) for i in range(width-1): - cur = Signal("cur%d" % i) + cur = Signal(name="cur%d" % i) comb += cur.eq(current_result) current_result = Mux(self.gates[i], self.results_in[i+1], cur) comb += self.output[i+1].eq(current_result) -- 2.30.2