-class ExamplePipeline(CombMultiInPipeline):
+class PriorityCombMuxInPipe(CombMultiInPipeline):
""" an example of how to use the combinatorial pipeline.
"""
- def __init__(self, p_len=2):
+ def __init__(self, stage, p_len=2):
p_mux = InputPriorityArbiter(self, p_len)
- CombMultiInPipeline.__init__(self, ExampleStage, p_len, p_mux)
+ CombMultiInPipeline.__init__(self, stage, p_len, p_mux)
if __name__ == '__main__':
- dut = ExamplePipeline()
+ dut = PriorityCombMuxInPipe(ExampleStage)
vl = rtlil.convert(dut, ports=dut.ports())
with open("test_combpipe.il", "w") as f:
f.write(vl)
from fpbase import MultiShiftRMerge, Trigger
from singlepipe import (ControlBase, StageChain, UnbufferedPipeline)
from multipipe import CombMultiOutPipeline
-from multipipe import CombMultiInPipeline, InputPriorityArbiter
+from multipipe import PriorityCombMuxInPipe
#from fpbase import FPNumShiftMultiRight
return m
-class PriorityCombPipeline(CombMultiInPipeline):
- def __init__(self, stage, p_len):
- p_mux = InputPriorityArbiter(self, p_len)
- CombMultiInPipeline.__init__(self, stage, p_len=p_len, p_mux=p_mux)
-
- def ports(self):
- return self.p_mux.ports()
-
-
class FPAddInPassThruStage:
def __init__(self, width, id_wid):
self.width, self.id_wid = width, id_wid
def process(self, i): return i
-class FPADDInMuxPipe(PriorityCombPipeline):
+class FPADDInMuxPipe(PriorityCombMuxInPipe):
def __init__(self, width, id_width, num_rows):
self.num_rows = num_rows
stage = FPAddInPassThruStage(width, id_width)
- PriorityCombPipeline.__init__(self, stage, p_len=self.num_rows)
- #self.p.i_data = stage.ispec()
- #self.n.o_data = stage.ospec()
+ PriorityCombMuxInPipe.__init__(self, stage, p_len=self.num_rows)
def ports(self):
res = []
-""" key strategic example showing how to do multi-input fan-in into a
+""" key strategic example showing how to do multi-input fan-in into a
multi-stage pipeline, then multi-output fanout.
the multiplex ID from the fan-in is passed in to the pipeline, preserved,
from nmigen.cli import verilog, rtlil
from multipipe import CombMultiOutPipeline
-from multipipe import CombMultiInPipeline, InputPriorityArbiter
+from multipipe import PriorityCombMuxInPipe
from singlepipe import UnbufferedPipeline
-class PriorityCombPipeline(CombMultiInPipeline):
- def __init__(self, stage, p_len):
- p_mux = InputPriorityArbiter(self, p_len)
- CombMultiInPipeline.__init__(self, stage, p_len=p_len, p_mux=p_mux)
-
- def ports(self):
- return self.p_mux.ports()
- #return UnbufferedPipeline.ports(self) + self.p_mux.ports()
-
-
class MuxCombPipeline(CombMultiOutPipeline):
def __init__(self, stage, n_len):
# HACK: stage is also the n-way multiplexer
return PassData()
def ospec(self):
return self.ispec() # same as ospec
-
+
def process(self, i):
return i # pass-through
print ("recv ended", mid)
-class TestPriorityMuxPipe(PriorityCombPipeline):
+class TestPriorityMuxPipe(PriorityCombMuxInPipe):
def __init__(self, num_rows):
self.num_rows = num_rows
stage = PassThroughStage()
- PriorityCombPipeline.__init__(self, stage, p_len=self.num_rows)
+ PriorityCombMuxInPipe.__init__(self, stage, p_len=self.num_rows)
def ports(self):
res = []