class ALUPipeSpec(CommonPipeSpec):
regspec = (ALUInputData.regspec, ALUOutputData.regspec)
opsubsetkls = CompALUOpSubset
- def rdflags(self, e): # in order of regspec
- reg1_ok = e.read_reg1.ok # RA
- reg2_ok = e.read_reg2.ok # RB
- return Cat(reg1_ok, reg2_ok, 1, 1) # RA RB CA SO
class BranchPipeSpec(CommonPipeSpec):
regspec = (BranchInputData.regspec, BranchOutputData.regspec)
opsubsetkls = CompBROpSubset
- def rdflags(self, e): # in order of regspec
- cr1_en = e.read_cr1.ok # CR A
- fast1_ok = e.read_fast1.ok # SPR1
- fast2_ok = e.read_fast2.ok # SPR2
- return Cat(fast1_ok, fast2_ok, cr1_en, 1) # SPR1 SPR2 CR CIA
"""
+# imports
+
from nmigen import Cat
from nmigen.cli import rtlil
from soc.experiment.compalu_multi import MultiCompUnit
alu = pipekls(pspec) # create actual NNNBasePipe
super().__init__(regspec, alu, opsubset) # pass to MultiCompUnit
- def rdflags(self, e):
- print (dir(self.alu))
- return self.alu.pspec.rdflags(e)
-
##############################################################
# TODO: ReservationStations-based (FunctionUnitBaseConcurrent)
class CRPipeSpec(CommonPipeSpec):
regspec = (CRInputData.regspec, CROutputData.regspec)
opsubsetkls = CompCROpSubset
- def rdflags(self, e): # in order of regspec
- reg1_ok = e.read_reg1.ok # RA/RC
- reg2_ok = e.read_reg2.ok # RB
- full_reg = e.read_cr_whole # full CR
- cr1_en = e.read_cr1.ok # CR A
- cr2_en = e.read_cr2.ok # CR B
- cr3_en = e.read_cr3.ok # CR C
- return Cat(reg1_ok, reg2_ok, full_reg, cr1_en, cr2_en, cr3_en)
class LogicalPipeSpec(CommonPipeSpec):
regspec = (LogicalInputData.regspec, LogicalOutputData.regspec)
opsubsetkls = CompLogicalOpSubset
- def rdflags(self, e): # in order of regspec
- reg1_ok = e.read_reg1.ok # RA
- reg2_ok = e.read_reg2.ok # RB
- return Cat(reg1_ok, reg2_ok) # RA RB
class ShiftRotPipeSpec(CommonPipeSpec):
regspec = (ShiftRotInputData.regspec, LogicalOutputData.regspec)
opsubsetkls = CompSROpSubset
- def rdflags(self, e): # in order of regspec input
- reg1_ok = e.read_reg1.ok # RA
- reg2_ok = e.read_reg2.ok # RB
- reg3_ok = e.read_reg3.ok # RS
- return Cat(reg1_ok, reg2_ok, reg3_ok, 1) # RA RB RC CA