From: Luke Kenneth Casson Leighton Date: Wed, 27 Mar 2019 08:15:36 +0000 (+0000) Subject: 2-chain pipeline doesnt need pipe instances to be members X-Git-Tag: ls180-24jan2020~1482 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=26874ec5de16c93a258be690af3c2c511da0080b;p=ieee754fpu.git 2-chain pipeline doesnt need pipe instances to be members move to local variables --- diff --git a/src/add/test_buf_pipe.py b/src/add/test_buf_pipe.py index c92a96cc..92a14377 100644 --- a/src/add/test_buf_pipe.py +++ b/src/add/test_buf_pipe.py @@ -282,25 +282,19 @@ def testbench4(dut): ###################################################################### class ExampleBufPipe2(ControlBase): + """ Example of how to do chained pipeline stages. """ - connect these: ------|---------------| - v v - i_p_valid >>in pipe1 o_n_valid out>> i_p_valid >>in pipe2 - o_p_ready <>in pipe1 p_i_data out>> n_o_data >>in pipe2 - """ - def __init__(self): - ControlBase.__init__(self) - - self.pipe1 = ExampleBufPipe() - self.pipe2 = ExampleBufPipe() def elaborate(self, platform): m = Module() - m.submodules.pipe1 = self.pipe1 - m.submodules.pipe2 = self.pipe2 - self.connect(m, [self.pipe1, self.pipe2]) + pipe1 = ExampleBufPipe() + pipe2 = ExampleBufPipe() + + m.submodules.pipe1 = pipe1 + m.submodules.pipe2 = pipe2 + + self.connect(m, [pipe1, pipe2]) return m