reduce part_mask in partsig tests to 3 (actual number of break points
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 29 Sep 2021 16:13:45 +0000 (17:13 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 29 Sep 2021 16:13:45 +0000 (17:13 +0100)
not actual number of partitions), fix PartitionedSignal.like(),
needed to pass in PartitionPoints(other.partpoints)

src/ieee754/part/partsig.py
src/ieee754/part/test/test_partsig.py

index b5faf35ad16b04269cee93499b684699109e80aa..6baca3adc1c487e9aa74198cb9bd07eb82c9e1ad 100644 (file)
@@ -80,7 +80,7 @@ class PartitionedSignal(UserValue):
     def like(other, *args, **kwargs):
         """Builds a new PartitionedSignal with the same PartitionPoints and
         Signal properties as the other"""
-        result = PartitionedSignal(other.partpoints)
+        result = PartitionedSignal(PartitionPoints(other.partpoints))
         result.sig = Signal.like(other.sig, *args, **kwargs)
         result.m = other.m
         return result
index 387a2e9c3912e47533c8b84454135a6106fd97ad..39bd5f5f5a5e5e532d48c8aaa426a0888bc009be 100644 (file)
@@ -222,7 +222,7 @@ class TestAddMod(Elaboratable):
 class TestMux(unittest.TestCase):
     def test(self):
         width = 16
-        part_mask = Signal(4)  # divide into 4-bits
+        part_mask = Signal(3)  # divide into 4-bits
         module = TestMuxMod(width, part_mask)
 
         test_name = "part_sig_mux"
@@ -407,7 +407,7 @@ class TestCat(unittest.TestCase):
 class TestPartitionedSignal(unittest.TestCase):
     def test(self):
         width = 16
-        part_mask = Signal(4)  # divide into 4-bits
+        part_mask = Signal(3)  # divide into 4-bits
         module = TestAddMod(width, part_mask)
 
         test_name = "part_sig_add"