from nmigen import Elaboratable, Module
from nmigen.cli import rtlil
from soc.experiment.compalu_multi import MultiCompUnit
+from soc.decoder.power_enums import Function
# pipeline / spec imports
###### actual Function Units: these are "single" stage pipelines #####
class ALUFunctionUnit(FunctionUnitBaseSingle):
+ fnunit = Function.ALU
def __init__(self): super().__init__(ALUPipeSpec, ALUBasePipe)
class LogicalFunctionUnit(FunctionUnitBaseSingle):
+ fnunit = Function.LOGICAL
def __init__(self): super().__init__(LogicalPipeSpec, LogicalBasePipe)
class CRFunctionUnit(FunctionUnitBaseSingle):
+ fnunit = Function.CR
def __init__(self): super().__init__(CRPipeSpec, CRBasePipe)
class BranchFunctionUnit(FunctionUnitBaseSingle):
+ fnunit = Function.BRANCH
def __init__(self): super().__init__(BranchPipeSpec, BranchBasePipe)
class ShiftRotFunctionUnit(FunctionUnitBaseSingle):
+ fnunit = Function.SHIFT_ROT
def __init__(self): super().__init__(ShiftRotPipeSpec, ShiftRotBasePipe)
regs = self.regs
fus = self.fus.fus
+ # connect up instructions
+ for funame, fu in fus.items():
+ fnunit = fu.fnunit.value
+ enable = Signal(name="en_%s" % funame, reset_less=True)
+ comb += enable.eq(self.ivalid_i & (dec2.e.fn_unit & fnunit != 0))
+ with m.If(enable):
+ comb += fu.oper_i.eq_from_execute1(dec2.e)
+
# enable-signals for each FU, get one bit for each FU (by name)
fu_enable = Signal(len(fus), reset_less=True)
fu_bitdict = {}