pass i_ready in to d_valid dynamic stage function
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Apr 2019 12:15:58 +0000 (13:15 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Apr 2019 12:15:58 +0000 (13:15 +0100)
src/add/singlepipe.py
src/add/test_buf_pipe.py

index 248a5f6e62386c4a190ad116ac2650320bc77fd8..2f5454289ad40cfe2c5604137a9a1a526cec4980 100644 (file)
@@ -541,7 +541,8 @@ class ControlBase:
         m.d.comb += self.p.s_o_ready.eq(self.p._o_ready & self.stage.d_ready)
 
         # intercept the next (incoming) "ready" and combine it with data valid
-        m.d.comb += self.n.d_valid.eq(self.n.i_ready & self.stage.d_valid)
+        sdv = self.stage.d_valid(self.n.i_ready)
+        m.d.comb += self.n.d_valid.eq(self.n.i_ready & sdv)
 
         return m
 
index bfcd1a407b25bbb4e85b45097ce345032d00ada1..9fec02a71c3bb06f82373f7f5a0c31a32621de49 100644 (file)
@@ -607,8 +607,7 @@ class ExampleStageDelayCls(StageCls):
         return (self.count == 1)# | (self.count == 3)
         return Const(1)
 
-    @property
-    def d_valid(self):
+    def d_valid(self, i_ready):
         return self.count == self.valid_trigger
         return Const(1)