res += self.n.o_data
return res
- def elaborate(self, platform):
+ def _elaborate(self, platform):
""" handles case where stage has dynamic ready/valid functions
"""
m = Module()
# when the pipeline (buffered or otherwise) says "ready",
# test the *stage* "ready".
+ m.d.comb += self.p.s_o_ready.eq(self.p._o_ready)
+ m.d.comb += self.n.s_o_valid.eq(self.n._o_valid)
+ return m
+
with m.If(self.p._o_ready):
m.d.comb += self.p.s_o_ready.eq(self.stage.p_o_ready)
with m.Else():
def elaborate(self, platform):
- self.m = ControlBase.elaborate(self, platform)
+ self.m = ControlBase._elaborate(self, platform)
result = self.stage.ospec()
r_data = self.stage.ospec()
self.n.o_data = stage.ospec() # output type
def elaborate(self, platform):
- self.m = ControlBase.elaborate(self, platform)
+ self.m = ControlBase._elaborate(self, platform)
data_valid = Signal() # is data valid or not
r_data = self.stage.ispec() # input type
return i + 1
-class ExampleBufDelayedPipe(BufferedPipeline):
+class ExampleBufDelayedPipe(UnbufferedPipeline):
""" an example of how to use the buffered pipeline.
"""
def __init__(self):
stage = ExampleStageDelayCls()
- BufferedPipeline.__init__(self, stage, stage_ctl=True)
+ UnbufferedPipeline.__init__(self, stage, stage_ctl=False)
class ExampleBufPipe3(ControlBase):
"""
def elaborate(self, platform):
- m = Module()
+ m = ControlBase._elaborate(self, platform)
pipe1 = ExampleBufPipe()
pipe2 = ExampleBufDelayedPipe()