use local variable in second stage pipeline test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 3 Apr 2019 05:31:00 +0000 (06:31 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 3 Apr 2019 05:31:00 +0000 (06:31 +0100)
src/add/pipeline.py
src/add/pipeline_example.py
src/add/singlepipe.py

index 1f3d0942bc0a107b7453d025112b707669e44386..525d5f39b9895b5043cef2b212c9f16dfbd0f6c0 100644 (file)
@@ -138,7 +138,6 @@ class ObjectProxy:
         else:
             print ("OP !pipemode !m", new_pipereg, value, type(value))
             self._assigns += eq(new_pipereg, value)
-            #self._eqs.append(new_pipereg)
             if isinstance(value, ObjectProxy):
                 print ("OP, defer assigns:", value._assigns)
                 self._assigns += value._assigns
@@ -215,6 +214,7 @@ class PipelineStage:
             if isinstance(value, ObjectProxy):
                 print ("OP, defer assigns:", value._assigns)
                 self._assigns += value._assigns
+                self._eqs += value._eqs
 
 def likelist(specs):
     res = []
index 922355d64522344322f77158ca4dadebd87ac75a..144ab5895fe0edd7ac9b31e1ce7a52a37788c904 100644 (file)
@@ -138,11 +138,13 @@ class PipelineStageObjectExample:
                 p.n = ~self._loopback
                 p.o = self._obj
             with pipe.Stage("second", p) as (p, m):
-                #p.n = ~self._loopback + 2
-                p.n = p.n + Const(2)
+                localv = Signal(4)
+                m.d.comb += localv.eq(p.n + Const(2))
+                p.n = localv
                 o = ObjectProxy(None, pipemode=False)
-                o.c = p.n
-                o.d = p.o.b + p.n + Const(5)
+                o.c = localv
+                o.d = p.o.b + localv + Const(5)
+                o.e = p.o.b + localv
                 p.o = o
             with pipe.Stage("third", p) as (p, m):
                 #p.n = ~self._loopback + 5
index c49c34167c3710c8f16a5fc8220fb1c5ff6f41db..081a8a52f040226f55bca6cda44efa8118b40654 100644 (file)
@@ -251,7 +251,7 @@ def eq(o, i):
         o, i = [o], [i]
     res = []
     for (ao, ai) in zip(o, i):
-        #print ("eq", ao, ai)
+        print ("eq", ao, ai)
         if isinstance(ao, Record):
             for idx, (field_name, field_shape, _) in enumerate(ao.layout):
                 if isinstance(field_shape, Layout):