self.xer_ov.eq(i.xer_ov), self.xer_so.eq(i.xer_so)]
-class IntPipeSpec:
- def __init__(self, id_wid=2, op_wid=1):
- self.id_wid = id_wid
- self.op_wid = op_wid
- self.opkls = lambda _: CompALUOpSubset(name="op")
- self.stage = None
-
-
-class ALUPipeSpec(IntPipeSpec):
+class ALUPipeSpec:
regspec = (ALUInputData.regspec, ALUOutputData.regspec)
+ opsubsetkls = CompALUOpSubset
def __init__(self, id_wid, op_wid):
- super().__init__(id_wid, op_wid)
self.pipekls = SimpleHandshakeRedir
+ self.id_wid = id_wid
+ self.op_wid = op_wid
+ self.opkls = lambda _: self.opsubsetkls(name="op")
+ self.stage = None
self.run_tst_program(Program(lst), initial_regs, {})
def test_ilang(self):
- rec = CompALUOpSubset()
+ rec = ALUPipeSpec.opsubsetkls()
pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
alu = ALUBasePipe(pspec)
m.submodules.pdecode2 = pdecode2 = PowerDecode2(pdecode)
- rec = CompALUOpSubset()
+ rec = ALUPipeSpec.opsubsetkls()
pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
m.submodules.alu = alu = ALUBasePipe(pspec)
from nmutil.dynamicpipe import SimpleHandshakeRedir
from soc.fu.alu.alu_input_record import CompALUOpSubset # TODO: replace
+
class BranchInputData(IntegerData):
regspec = [('SPR', 'spr1', '0:63'),
('SPR', 'spr2', '0:63'),
# TODO: replace CompALUOpSubset with CompBranchOpSubset
class BranchPipeSpec:
regspec = (BranchInputData.regspec, BranchOutputData.regspec)
+ opsubsetkls = CompALUOpSubset
def __init__(self, id_wid, op_wid):
self.id_wid = id_wid
self.op_wid = op_wid
- self.opkls = lambda _: CompALUOpSubset(name="op")
+ self.opkls = lambda _: self.opsubsetkls(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.branch.pipe_data import BranchPipeSpec
import random
initial_cr=cr)
def test_ilang(self):
- rec = CompBROpSubset()
+ rec = BranchPipeSpec.opsubsetkls()
pspec = BranchPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
alu = BranchBasePipe(pspec)
m.submodules.pdecode2 = pdecode2 = PowerDecode2(pdecode)
- rec = CompBROpSubset()
+ rec = BranchPipeSpec.opsubsetkls()
pspec = BranchPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
m.submodules.branch = branch = BranchBasePipe(pspec)
from nmigen import Signal, Const
from ieee754.fpcommon.getop import FPPipeContext
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 CRInputData(IntegerData):
lst = super().eq(i)
return lst + [self.o.eq(i.o),
self.cr.eq(i.cr)]
+
+# TODO: replace CompALUOpSubset with CompCROpSubset
+class CRPipeSpec:
+ regspec = (CRInputData.regspec, CROutputData.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.cr.pipeline import CRBasePipe
from soc.fu.alu.alu_input_record import CompALUOpSubset
-from soc.fu.alu.pipe_data import ALUPipeSpec
+from soc.fu.cr.pipe_data import CRPipeSpec
import random
def test_ilang(self):
- rec = CompALUOpSubset()
+ rec = CRPipeSpec.opsubsetkls()
- pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
+ pspec = CRPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
alu = CRBasePipe(pspec)
vl = rtlil.convert(alu, ports=alu.ports())
with open("cr_pipeline.il", "w") as f:
m.submodules.pdecode2 = pdecode2 = PowerDecode2(pdecode)
- rec = CompALUOpSubset()
+ rec = CRPipeSpec.opsubsetkls()
- pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
+ pspec = CRPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
m.submodules.alu = alu = CRBasePipe(pspec)
comb += alu.p.data_i.ctx.op.eq_from_execute1(pdecode2.e)
from nmigen import Signal, Const
from ieee754.fpcommon.getop import FPPipeContext
-from soc.fu.alu.pipe_data import IntegerData
+from soc.fu.alu.pipe_data import IntegerData, ALUOutputData
+from nmutil.dynamicpipe import SimpleHandshakeRedir
+from soc.fu.alu.alu_input_record import CompALUOpSubset # TODO: replace
class LogicalInputData(IntegerData):
return lst + [self.a.eq(i.a), self.b.eq(i.b),
self.xer_ca.eq(i.xer_ca),
self.xer_so.eq(i.xer_so)]
+
+
+# TODO: replace CompALUOpSubset with CompLogicalOpSubset
+class LogicalPipeSpec:
+ regspec = (LogicalInputData.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.logical.pipeline import LogicalBasePipe
-from soc.fu.alu.alu_input_record import CompALUOpSubset
-from soc.fu.alu.pipe_data import ALUPipeSpec
+from soc.fu.alu.pipe_data import LogicalPipeSpec
import random
self.run_tst_program(Program(lst), initial_regs)
def test_ilang(self):
- rec = CompALUOpSubset()
+ rec = LogicalPipeSpec.opsubsetkls()
- pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
+ pspec = LogicalPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
alu = LogicalBasePipe(pspec)
vl = rtlil.convert(alu, ports=alu.ports())
with open("logical_pipeline.il", "w") as f:
m.submodules.pdecode2 = pdecode2 = PowerDecode2(pdecode)
- rec = CompALUOpSubset()
+ rec = LogicalPipeSpec.opsubsetkls()
- pspec = ALUPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
+ pspec = LogicalPipeSpec(id_wid=2, op_wid=get_rec_width(rec))
m.submodules.alu = alu = LogicalBasePipe(pspec)
comb += alu.p.data_i.ctx.op.eq_from_execute1(pdecode2.e)