class ControlBase:
""" Common functions for Pipeline API
"""
- def __init__(self, in_multi=None, stage_ctl=False):
+ def __init__(self, stage=None, in_multi=None, stage_ctl=False):
""" Base class containing ready/valid/data to previous and next stages
* p: contains ready/valid to the previous stage
* add i_data member to PrevControl (p) and
* add o_data member to NextControl (n)
"""
+ self.stage = stage
+
# set up input and output IO ACK (prev/next ready/valid)
self.p = PrevControl(in_multi, stage_ctl)
self.n = NextControl(stage_ctl)
+ # set up the input and output data
+ if stage is not None:
+ self.p.i_data = stage.ispec() # input type
+ self.n.o_data = stage.ospec()
+
def connect_to_next(self, nxt):
""" helper function to connect to the next stage data/valid/ready.
"""
input may begin to be processed and transferred directly to output.
"""
- def __init__(self, stage, stage_ctl=False):
- ControlBase.__init__(self, stage_ctl=stage_ctl)
- self.stage = stage
-
- # set up the input and output data
- self.p.i_data = stage.ispec() # input type
- self.n.o_data = stage.ospec()
-
def elaborate(self, platform):
self.m = ControlBase._elaborate(self, platform)
| |
+--process->--^
"""
- def __init__(self, stage, stage_ctl=False):
- ControlBase.__init__(self, stage_ctl=stage_ctl)
- self.stage = stage
-
- # set up the input and output data
- self.p.i_data = stage.ispec() # input type
- self.n.o_data = stage.ospec()
def elaborate(self, platform):
COMBINATORIALLY (no clock dependence).
"""
- def __init__(self, stage, stage_ctl=False):
- ControlBase.__init__(self, stage_ctl=stage_ctl)
- self.stage = stage
-
- # set up the input and output data
- self.p.i_data = stage.ispec() # input type
- self.n.o_data = stage.ospec() # output type
-
def elaborate(self, platform):
self.m = ControlBase._elaborate(self, platform)
SYNCHRONOUSLY.
"""
- def __init__(self, stage, stage_ctl=False):
- ControlBase.__init__(self, stage_ctl=stage_ctl)
- self.stage = stage
-
- # set up the input and output data
- self.p.i_data = stage.ispec() # input type
- self.n.o_data = stage.ospec() # output type
-
def elaborate(self, platform):
self.m = ControlBase._elaborate(self, platform)
class PassThroughHandshake(ControlBase):
""" A control block that delays by one clock cycle.
"""
- def __init__(self, stage, stage_ctl=False):
- ControlBase.__init__(self, stage_ctl=stage_ctl)
- self.stage = stage
-
- # set up the input and output data
- self.p.i_data = stage.ispec() # input type
- self.n.o_data = stage.ospec() # output type
def elaborate(self, platform):
m = ControlBase._elaborate(self, platform)