From bf8190aef5bacab2b19fd0e450b7d269354aca38 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 26 Mar 2019 12:47:35 +0000 Subject: [PATCH] derive ExampleBufPipe2 from PipelineBase --- src/add/test_buf_pipe.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/add/test_buf_pipe.py b/src/add/test_buf_pipe.py index 91359f65..a31fbf13 100644 --- a/src/add/test_buf_pipe.py +++ b/src/add/test_buf_pipe.py @@ -7,7 +7,7 @@ from example_buf_pipe import ExampleBufPipe, ExampleBufPipeAdd from example_buf_pipe import ExamplePipeline, UnbufferedPipeline from example_buf_pipe import ExampleStageCls from example_buf_pipe import PrevControl, NextControl, BufferedPipeline -from example_buf_pipe import StageChain +from example_buf_pipe import StageChain, PipelineBase from random import randint @@ -262,7 +262,7 @@ def testbench4(dut): break -class ExampleBufPipe2: +class ExampleBufPipe2(PipelineBase): """ connect these: ------|---------------| v v @@ -271,17 +271,15 @@ class ExampleBufPipe2: p_i_data >>in pipe1 p_i_data out>> n_o_data >>in pipe2 """ def __init__(self): - self.pipe1 = ExampleBufPipe() - self.pipe2 = ExampleBufPipe() + PipelineBase.__init__(self) - # input - self.p = PrevControl() + # input / output self.p.i_data = Signal(32) # >>in - comes in from the PREVIOUS stage - - # output - self.n = NextControl() self.n.o_data = Signal(32) # out>> - goes out to the NEXT stage + self.pipe1 = ExampleBufPipe() + self.pipe2 = ExampleBufPipe() + def elaborate(self, platform): m = Module() m.submodules.pipe1 = self.pipe1 -- 2.30.2