self.m.d.sync += eq(r_data, result) # update buffer
with self.m.If(self.n.i_ready): # next stage is ready
- with self.m.If(self.p.o_ready): # not stalled
+ with self.m.If(self.p._o_ready): # not stalled
# nothing in buffer: send (processed) input direct to output
self.m.d.sync += [self.n._o_valid.eq(p_i_valid),
eq(self.n.o_data, result), # update output
send = True
else:
send = randint(0, send_range) != 0
+ send = True
o_p_ready = yield self.dut.p.o_ready
if not o_p_ready:
yield
@property
def p_o_ready(self):
return Const(1)
+ return self.count == 0
@property
def n_o_valid(self):
"""
return i + 1
+ def elaborate(self, platform):
+ m = Module()
+ m.d.sync += self.count.eq(~self.count)
+ return m
+
class ExampleBufDelayedPipe(BufferedPipeline):
""" an example of how to use the buffered pipeline.
stage = ExampleStageDelayCls()
BufferedPipeline.__init__(self, stage, stage_ctl=True)
+ def elaborate(self, platform):
+ m = BufferedPipeline.elaborate(self, platform)
+ m.submodules.stage = self.stage
+ return m
+
class ExampleBufPipe3(ControlBase):
""" Example of how to do delayed pipeline, where the stage signals