use explicit SimdShape for minitest example rather than
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 25 Oct 2021 13:35:57 +0000 (14:35 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 25 Oct 2021 13:35:57 +0000 (14:35 +0100)
fixed_width parameter

src/ieee754/part/test/test_partsig_scope.py

index ba72e28bf6adbfc4538ec03b3e2f3faebe92f898..d889a82cb7b75844323eb5e2c718cfc4593c5c7d 100644 (file)
@@ -6,7 +6,7 @@ from nmigen import Signal, Module, Elaboratable, Mux, Cat, Shape, Repl
 from nmigen.back.pysim import Simulator, Delay, Settle
 from nmigen.cli import rtlil
 
-from ieee754.part.partsig import SimdSignal
+from ieee754.part.partsig import SimdSignal, SimdShape
 from ieee754.part.simd_scope import SimdScope
 
 from random import randint
@@ -31,11 +31,12 @@ class TestCatMod(Elaboratable):
     def __init__(self, width, elwid, vec_el_counts):
         self.m = Module()
         with SimdScope(self.m, elwid, vec_el_counts) as s:
-            # BE CAREFUL with the fixed_width parameter.
-            # it is NOT available in SimdScope.scalar mode
-            self.a = s.Signal(fixed_width=width)
-            self.b = s.Signal(fixed_width=width*2)
-            self.o = s.Signal(fixed_width=width*3)
+            shape = SimdShape(s, fixed_width=width)
+            shape2 = SimdShape(s, fixed_width=width*2)
+            shape3 = SimdShape(s, fixed_width=width*3)
+            self.a = s.Signal(shape)
+            self.b = s.Signal(shape2) # TODO: shape*2
+            self.o = s.Signal(shape3) # TODO: shape*3
         self.cat_out = self.o.sig
 
     def elaborate(self, platform):