From 28a8ede4a797a76e83410fb42a9aaa02b44fb2ef Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 15 Mar 2019 08:37:18 +0000 Subject: [PATCH] inverted busy signal and named it "ready" --- src/add/example_buf_pipe.py | 64 ++++++++++++++++++------------------- src/add/test_buf_pipe.py | 58 ++++++++++++++++----------------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/add/example_buf_pipe.py b/src/add/example_buf_pipe.py index aab10a91..0f2c9746 100644 --- a/src/add/example_buf_pipe.py +++ b/src/add/example_buf_pipe.py @@ -13,11 +13,11 @@ input acceptance conditions are when: * incoming previous-stage strobe (i.p_valid) is HIGH - * outgoing previous-stage busy (o.p_busy) is LOW + * outgoing previous-stage ready (o.p_ready) is LOW output transmission conditions are when: * outgoing next-stage strobe (o.n_valid) is HIGH - * outgoing next-stage busy (i.n_busy) is LOW + * outgoing next-stage ready (i.n_ready) is LOW the tricky bit is when the input has valid data and the output is not ready to accept it. if it wasn't for the clock synchronisation, it @@ -33,7 +33,7 @@ we now effectively have *two* possible pieces of data to "choose" from: the buffered data, and the incoming data. the decision as to which to process and output is based on whether we are in "stall" or not. - i.e. when the next stage is no longer busy, the output comes from + i.e. when the next stage is no longer ready, the output comes from the buffer if a stall had previously occurred, otherwise it comes direct from processing the input. @@ -104,21 +104,21 @@ class IOAckIn: def __init__(self): self.p_valid = Signal() # >>in - comes in from PREVIOUS stage - self.n_busy = Signal() # in<< - comes in from the NEXT stage + self.n_ready = Signal() # in<< - comes in from the NEXT stage class IOAckOut: def __init__(self): self.n_valid = Signal() # out>> - goes out to the NEXT stage - self.p_busy = Signal() # <>in stage o.n_valid out>> stage+1 - stage-1 o.p_busy <>in stage o_data out>> stage+1 | | +-------> process @@ -126,72 +126,72 @@ class BufferedPipeline: +-- r_data ---+ """ def __init__(self): - # input: strobe comes in from previous stage, busy comes in from next + # input: strobe comes in from previous stage, ready comes in from next self.i = IOAckIn() #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.n_ready = Signal() # in<< - comes in from the NEXT stage - # output: strobe goes out to next stage, busy comes in from previous + # output: strobe goes out to next stage, ready comes in from previous self.o = IOAckOut() #self.o.n_valid = Signal() # out>> - goes out to the NEXT stage - #self.o.p_busy = Signal() # <>in pipe1 o_n_valid out>> i_p_valid >>in pipe2 - o_p_busy <>in pipe1 o_data out>> stage.i_data >>in pipe2 """ def __init__(self): @@ -185,12 +185,12 @@ class BufPipe2: # input 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_n_ready = Signal() # in<< - comes in from the NEXT stage self.i_data = Signal(32) # >>in - comes in from the PREVIOUS stage # output self.o_n_valid = Signal() # out>> - goes out to the NEXT stage - self.o_p_busy = Signal() # <> - goes out to the NEXT stage def elaborate(self, platform): @@ -198,19 +198,19 @@ class BufPipe2: m.submodules.pipe1 = self.pipe1 m.submodules.pipe2 = self.pipe2 - # connect inter-pipe input/output valid/busy/data + # connect inter-pipe input/output valid/ready/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.pipe1.i.n_ready.eq(self.pipe2.o.p_ready) 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_valid.eq(self.i_p_valid) - m.d.comb += self.o_p_busy.eq(self.pipe1.o.p_busy) + m.d.comb += self.o_p_ready.eq(self.pipe1.o.p_ready) m.d.comb += self.pipe1.stage.i_data.eq(self.i_data) # now pipe2 connections (RHS) 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.pipe2.i.n_ready.eq(self.i_n_ready) m.d.comb += self.o_data.eq(self.pipe2.stage.o_data) return m -- 2.30.2