From: Luke Kenneth Casson Leighton Date: Sat, 6 Jun 2020 12:40:28 +0000 (+0100) Subject: add special-case LDSTFunctionUnit X-Git-Tag: div_pipeline~538 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a973af9b439a1daa5034eae2129601b627c97af3;p=soc.git add special-case LDSTFunctionUnit --- diff --git a/src/soc/fu/compunits/compunits.py b/src/soc/fu/compunits/compunits.py index c8bf762e..a3e95038 100644 --- a/src/soc/fu/compunits/compunits.py +++ b/src/soc/fu/compunits/compunits.py @@ -125,6 +125,15 @@ class ShiftRotFunctionUnit(FunctionUnitBaseSingle): fnunit = Function.SHIFT_ROT def __init__(self): super().__init__(ShiftRotPipeSpec, ShiftRotBasePipe) +# special-case +class LDSTFunctionUnit(LDSTCompUnit): + fnunit = Function.ALU + def __init__(self, pi, awid): + pspec = LDSTPipeSpec(id_wid=2) # spec (NNNPipeSpec instance) + opsubset = pspec.opsubsetkls # get the operand subset class + regspec = pspec.regspec # get the regspec + super().__init__(pi, regspec, awid, opsubset) + ##################################################################### ###### actual Function Units: these are "multi" stage pipelines ##### diff --git a/src/soc/fu/compunits/test/test_ldst_compunit.py b/src/soc/fu/compunits/test/test_ldst_compunit.py index a223554d..525f88a1 100644 --- a/src/soc/fu/compunits/test/test_ldst_compunit.py +++ b/src/soc/fu/compunits/test/test_ldst_compunit.py @@ -10,7 +10,7 @@ from soc.fu.compunits.test.test_compunit import TestRunner class LDSTTestRunner(TestRunner): def __init__(self, test_data): super().__init__(test_data, LDSTFunctionUnit, self, - Function.LOGICAL) + Function.LDST) def get_cu_inputs(self, dec2, sim): """naming (res) must conform to LDSTFunctionUnit input regspec