From: Luke Kenneth Casson Leighton Date: Wed, 3 Apr 2019 05:31:00 +0000 (+0100) Subject: use local variable in second stage pipeline test X-Git-Tag: ls180-24jan2020~1353 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9687005582c1a20093f35777cd8eb83e580fa7b4;p=ieee754fpu.git use local variable in second stage pipeline test --- diff --git a/src/add/pipeline.py b/src/add/pipeline.py index 1f3d0942..525d5f39 100644 --- a/src/add/pipeline.py +++ b/src/add/pipeline.py @@ -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 = [] diff --git a/src/add/pipeline_example.py b/src/add/pipeline_example.py index 922355d6..144ab589 100644 --- a/src/add/pipeline_example.py +++ b/src/add/pipeline_example.py @@ -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 diff --git a/src/add/singlepipe.py b/src/add/singlepipe.py index c49c3416..081a8a52 100644 --- a/src/add/singlepipe.py +++ b/src/add/singlepipe.py @@ -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):