from ieee754.fpcommon.getop import FPPipeContext
from soc.decoder.power_decoder2 import Data
from soc.fu.alu.pipe_data import IntegerData
-
+from nmutil.dynamicpipe import SimpleHandshakeRedir
+from soc.fu.alu.alu_input_record import CompALUOpSubset # TODO: replace
class BranchInputData(IntegerData):
regspec = [('SPR', 'spr1', '0:63'),
lst = super().eq(i)
return lst + [self.spr1.eq(i.spr1), self.spr2.eq(i.spr2),
self.nia.eq(i.nia)]
+
+
+# TODO: replace CompALUOpSubset with CompBranchOpSubset
+class BranchPipeSpec:
+ regspec = (BranchInputData.regspec, BranchOutputData.regspec)
+ def __init__(self, id_wid, op_wid):
+ self.id_wid = id_wid
+ self.op_wid = op_wid
+ self.opkls = lambda _: CompALUOpSubset(name="op")
+ self.stage = None
+ self.pipekls = SimpleHandshakeRedir
from soc.fu.branch.pipeline import BranchBasePipe
from soc.fu.branch.br_input_record import CompBROpSubset
-from soc.fu.alu.pipe_data import ALUPipeSpec
+from soc.fu.branch.pipe_data import BranchPipeSpec
import random
def test_ilang(self):
rec = CompBROpSubset()
- pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
+ pspec = BranchPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
alu = BranchBasePipe(pspec)
vl = rtlil.convert(alu, ports=alu.ports())
with open("branch_pipeline.il", "w") as f:
rec = CompBROpSubset()
- pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
+ pspec = BranchPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
m.submodules.branch = branch = BranchBasePipe(pspec)
comb += branch.p.data_i.ctx.op.eq_from_execute1(pdecode2.e)