track down module in which vdd / vss error exists (shift)
[soclayout.git] / experiments2 / test_partsig.py
index 3c868a4d42e29ffac4aaaccc7db985e43ba4ff28..73a63339e23d16805287378608f3d678bc4aeabf 100644 (file)
@@ -10,12 +10,40 @@ from ieee754.part.partsig import PartitionedSignal
 from ieee754.part_mux.part_mux import PMux
 
 
+# XXX this is for coriolis2 experimentation
+class TestLS(Elaboratable):
+    def __init__(self, width, partpoints):
+        self.partpoints = partpoints
+        self.a = PartitionedSignal(partpoints, width, name="a")
+        self.b = PartitionedSignal(partpoints, width, name="b")
+        self.ls_output = Signal(width) # left shift
+        self.dummy_output = Signal(width) # left shift
+
+    def elaborate(self, platform):
+        m = Module()
+        comb = m.d.comb
+        sync = m.d.sync
+        self.a.set_module(m)
+        self.b.set_module(m)
+        # left shift
+        sync += self.dummy_output.eq(self.b.sig) # stops sigs being ignored
+        sync += self.ls_output.eq(self.a << self.b)
+        ppts = self.partpoints
+
+        return m
+
+    def ports(self):
+        return [self.a.sig, self.b.sig,
+                self.ls_output,
+                self.dummy_output]
+
+
 # XXX this is for coriolis2 experimentation
 class TestAddMod2(Elaboratable):
     def __init__(self, width, partpoints):
         self.partpoints = partpoints
-        self.a = PartitionedSignal(partpoints, width)
-        self.b = PartitionedSignal(partpoints, width)
+        self.a = PartitionedSignal(partpoints, width, name="a")
+        self.b = PartitionedSignal(partpoints, width, name="b")
         self.add_output = Signal(width)
         self.ls_output = Signal(width) # left shift
         self.sub_output = Signal(width)
@@ -48,4 +76,14 @@ class TestAddMod2(Elaboratable):
 
         return m
 
+    def ports(self):
+        return [self.a.sig, self.b.sig,
+                self.add_output,
+                self.ls_output,
+                self.sub_output,
+                self.carry_in,
+                self.add_carry_out,
+                self.sub_carry_out,
+                self.neg_output]
+