From: Luke Kenneth Casson Leighton Date: Fri, 15 Mar 2019 08:28:18 +0000 (+0000) Subject: create classes for STB/BUSY, split in from out X-Git-Tag: ls180-24jan2020~1661 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0bfbc8ff919f0cd9c7f01b4c711b1b91a53ad480;p=ieee754fpu.git create classes for STB/BUSY, split in from out --- diff --git a/src/add/example_buf_pipe.py b/src/add/example_buf_pipe.py index 6678a671..37f866c3 100644 --- a/src/add/example_buf_pipe.py +++ b/src/add/example_buf_pipe.py @@ -12,12 +12,12 @@ 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 - * outgoing previous-stage busy (o_p_busy) is LOW + * incoming previous-stage strobe (i.p_stb) 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 busy (i_n_busy) is LOW + * outgoing next-stage strobe (o.n_stb) 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 ready to accept it. if it wasn't for the clock synchronisation, it @@ -100,12 +100,25 @@ class ExampleStage: def ports(self): return [self.i_data, self.o_data] +class IOAckIn: + + def __init__(self): + self.p_stb = 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.p_busy = Signal() # <>in stage o_n_stb out>> stage+1 - stage-1 o_p_busy <>in stage o.n_stb out>> stage+1 + stage-1 o.p_busy <>in stage o_data out>> stage+1 | | +-------> process @@ -114,13 +127,14 @@ class BufferedPipeline: """ def __init__(self): # input: strobe comes in from previous stage, busy comes in from next - #self.i_p_rst = Signal() # >>in - comes in from PREVIOUS stage - self.i_p_stb = Signal() # >>in - comes in from PREVIOUS stage - self.i_n_busy = Signal() # in<< - comes in from the NEXT stage + self.i = IOAckIn() + #self.i.p_stb = 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_n_stb = Signal() # out>> - goes out to the NEXT stage - self.o_p_busy = Signal() # <> - goes out to the NEXT stage + #self.o.p_busy = Signal() # <