From: Luke Kenneth Casson Leighton Date: Sun, 5 Jul 2020 11:18:10 +0000 (+0100) Subject: add SPR compunit X-Git-Tag: div_pipeline~162^2~69 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0e6b90d0eeb3988a4256e9959192710bb37a6937;p=soc.git add SPR compunit --- diff --git a/src/soc/fu/compunits/compunits.py b/src/soc/fu/compunits/compunits.py index 6de63d05..73cc249f 100644 --- a/src/soc/fu/compunits/compunits.py +++ b/src/soc/fu/compunits/compunits.py @@ -16,6 +16,7 @@ Two types exist: - CR: not so many needed (perhaps) - Branch: one or two of these (depending on speculation run-ahead) - Trap: yeah really only one of these + - SPR: again, only one. - ShiftRot (perhaps not too many of these) * Multi-cycle (and FSM) Function Units. these are FUs that can only @@ -64,6 +65,9 @@ from soc.fu.branch.pipe_data import BranchPipeSpec from soc.fu.shift_rot.pipeline import ShiftRotBasePipe from soc.fu.shift_rot.pipe_data import ShiftRotPipeSpec +from soc.fu.spr.pipeline import SPRBasePipe +from soc.fu.spr.pipe_data import SPRPipeSpec + from soc.fu.trap.pipeline import TrapBasePipe from soc.fu.trap.pipe_data import TrapPipeSpec @@ -150,6 +154,11 @@ class TrapFunctionUnit(FunctionUnitBaseSingle): def __init__(self, idx): super().__init__(TrapPipeSpec, TrapBasePipe, idx) +class SPRFunctionUnit(FunctionUnitBaseSingle): + fnunit = Function.SPR + def __init__(self, idx): + super().__init__(SPRPipeSpec, SPRBasePipe, idx) + # special-case class LDSTFunctionUnit(LDSTCompUnit): fnunit = Function.LDST @@ -182,12 +191,14 @@ class AllFunctionUnits(Elaboratable): addrwid = pspec.addr_wid units = pspec.units if not isinstance(units, dict): - units = {'alu': 1, 'cr': 1, 'branch': 1, 'trap': 1, 'logical': 1, + units = {'alu': 1, 'cr': 1, 'branch': 1, 'trap': 1, + 'spr': 1, 'logical': 1, 'div': 1, 'shiftrot': 1} alus = {'alu': ALUFunctionUnit, 'cr': CRFunctionUnit, 'branch': BranchFunctionUnit, 'trap': TrapFunctionUnit, + 'spr': SPRFunctionUnit, 'div': DIVFunctionUnit, 'logical': LogicalFunctionUnit, 'shiftrot': ShiftRotFunctionUnit, @@ -221,6 +232,7 @@ def tst_single_fus_il(): ('cr', CRFunctionUnit), ('branch', BranchFunctionUnit), ('trap', TrapFunctionUnit), + ('spr', SprFunctionUnit), ('logical', LogicalFunctionUnit), ('shiftrot', ShiftRotFunctionUnit)): fu = kls(0)