from nmutil.dynamicpipe import SimpleHandshakeRedir
from soc.fu.alu.alu_input_record import CompALUOpSubset
from ieee754.fpcommon.getop import FPPipeContext
-from soc.fu.alu.pipe_data import IntegerData
+from soc.fu.alu.pipe_data import ALUOutputData, IntegerData
+from nmutil.dynamicpipe import SimpleHandshakeRedir
class ShiftRotInputData(IntegerData):
self.rb.eq(i.rb),
self.xer_ca.eq(i.xer_ca),
self.xer_so.eq(i.xer_so)]
+
+
+# TODO: replace CompALUOpSubset with CompShiftRotOpSubset
+class ShiftRotPipeSpec:
+ regspec = (ShiftRotInputData.regspec, ALUOutputData.regspec)
+ opsubsetkls = CompALUOpSubset
+ def __init__(self, id_wid, op_wid):
+ self.id_wid = id_wid
+ self.op_wid = op_wid
+ self.opkls = lambda _: self.opsubsetkls(name="op")
+ self.stage = None
+ self.pipekls = SimpleHandshakeRedir
from soc.fu.shift_rot.pipeline import ShiftRotBasePipe
from soc.fu.alu.alu_input_record import CompALUOpSubset
-from soc.fu.alu.pipe_data import ALUPipeSpec
+from soc.fu.shift_rot.pipe_data import ShiftRotPipeSpec
import random
class TestCase:
self.run_tst_program(Program(lst), initial_regs)
def test_ilang(self):
- rec = CompALUOpSubset()
+ rec = ShiftRotPipeSpec.opsubsetkls()
- pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
+ pspec = ShiftRotPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
alu = ShiftRotBasePipe(pspec)
vl = rtlil.convert(alu, ports=alu.ports())
with open("pipeline.il", "w") as f:
m.submodules.pdecode2 = pdecode2 = PowerDecode2(pdecode)
- rec = CompALUOpSubset()
+ rec = ShiftRotPipeSpec.opsubsetkls()
- pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
+ pspec = ShiftRotPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
m.submodules.alu = alu = ShiftRotBasePipe(pspec)
comb += alu.p.data_i.ctx.op.eq_from_execute1(pdecode2.e)