From 0ebc09c0a7b74e4807ccdb60ca0a10cbb605666a Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 15 Mar 2019 08:29:56 +0000 Subject: [PATCH] rename stb to "valid" --- src/add/example_buf_pipe.py | 44 +++++++++++----------- src/add/test_buf_pipe.py | 74 ++++++++++++++++++------------------- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/add/example_buf_pipe.py b/src/add/example_buf_pipe.py index 37f866c3..aab10a91 100644 --- a/src/add/example_buf_pipe.py +++ b/src/add/example_buf_pipe.py @@ -12,11 +12,11 @@ where data will flow on *every* clock when the conditions are right. input acceptance conditions are when: - * incoming previous-stage strobe (i.p_stb) is HIGH + * incoming previous-stage strobe (i.p_valid) is HIGH * outgoing previous-stage busy (o.p_busy) is LOW output transmission conditions are when: - * outgoing next-stage strobe (o.n_stb) is HIGH + * outgoing next-stage strobe (o.n_valid) is HIGH * outgoing next-stage busy (i.n_busy) is LOW the tricky bit is when the input has valid data and the output is not @@ -103,21 +103,21 @@ class ExampleStage: class IOAckIn: def __init__(self): - self.p_stb = Signal() # >>in - comes in from PREVIOUS stage + self.p_valid = Signal() # >>in - comes in from PREVIOUS stage self.n_busy = Signal() # in<< - comes in from the NEXT stage class IOAckOut: def __init__(self): - self.n_stb = Signal() # out>> - goes out to the NEXT stage + self.n_valid = Signal() # out>> - goes out to the NEXT stage self.p_busy = Signal() # <>in stage o.n_stb out>> stage+1 + stage-1 i.p_valid >>in stage o.n_valid out>> stage+1 stage-1 o.p_busy <>in stage o_data out>> stage+1 | | @@ -128,12 +128,12 @@ class BufferedPipeline: def __init__(self): # input: strobe comes in from previous stage, busy comes in from next self.i = IOAckIn() - #self.i.p_stb = Signal() # >>in - comes in from PREVIOUS stage + #self.i.p_valid = Signal() # >>in - comes in from PREVIOUS stage #self.i.n_busy = Signal() # in<< - comes in from the NEXT stage # output: strobe goes out to next stage, busy comes in from previous self.o = IOAckOut() - #self.o.n_stb = Signal() # out>> - goes out to the NEXT stage + #self.o.n_valid = Signal() # out>> - goes out to the NEXT stage #self.o.p_busy = Signal() # <>in pipe1 o_n_stb out>> i_p_stb >>in pipe2 + i_p_valid >>in pipe1 o_n_valid out>> i_p_valid >>in pipe2 o_p_busy <>in pipe1 o_data out>> stage.i_data >>in pipe2 """ @@ -184,12 +184,12 @@ class BufPipe2: self.pipe2 = BufPipe() # input - self.i_p_stb = Signal() # >>in - comes in from PREVIOUS stage + self.i_p_valid = Signal() # >>in - comes in from PREVIOUS stage self.i_n_busy = Signal() # in<< - comes in from the NEXT stage self.i_data = Signal(32) # >>in - comes in from the PREVIOUS stage # output - self.o_n_stb = Signal() # out>> - goes out to the NEXT stage + self.o_n_valid = Signal() # out>> - goes out to the NEXT stage self.o_p_busy = Signal() # <> - goes out to the NEXT stage @@ -198,18 +198,18 @@ class BufPipe2: m.submodules.pipe1 = self.pipe1 m.submodules.pipe2 = self.pipe2 - # connect inter-pipe input/output stb/busy/data - m.d.comb += self.pipe2.i.p_stb.eq(self.pipe1.o.n_stb) + # connect inter-pipe input/output valid/busy/data + m.d.comb += self.pipe2.i.p_valid.eq(self.pipe1.o.n_valid) m.d.comb += self.pipe1.i.n_busy.eq(self.pipe2.o.p_busy) m.d.comb += self.pipe2.stage.i_data.eq(self.pipe1.stage.o_data) # inputs/outputs to the module: pipe1 connections here (LHS) - m.d.comb += self.pipe1.i.p_stb.eq(self.i_p_stb) + m.d.comb += self.pipe1.i.p_valid.eq(self.i_p_valid) m.d.comb += self.o_p_busy.eq(self.pipe1.o.p_busy) m.d.comb += self.pipe1.stage.i_data.eq(self.i_data) # now pipe2 connections (RHS) - m.d.comb += self.o_n_stb.eq(self.pipe2.o.n_stb) + m.d.comb += self.o_n_valid.eq(self.pipe2.o.n_valid) m.d.comb += self.pipe2.i.n_busy.eq(self.i_n_busy) m.d.comb += self.o_data.eq(self.pipe2.stage.o_data) -- 2.30.2