From ee7fe1c67ab96a2b1c0b11fb7064eeeef78265d9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 7 Nov 2021 13:45:41 +0000 Subject: [PATCH] switch over to single-entry (num_rows=1) ReservationStation2 based MultiCompUnit this is effectively identical to FunctionUnitBaseSingle behaviour except that now there is the possibility of increasing the number of rows (number of "fronts" to the ALU) to 2 or greater DIV FSM, Trap and SPR as well as LDST have been left alone --- src/soc/fu/compunits/compunits.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/soc/fu/compunits/compunits.py b/src/soc/fu/compunits/compunits.py index 87ec2a39..ea99c7b3 100644 --- a/src/soc/fu/compunits/compunits.py +++ b/src/soc/fu/compunits/compunits.py @@ -152,10 +152,11 @@ class FunctionUnitBaseMulti(ReservationStations2): regspec = pspec.regspec # get the regspec alu = pipekls(pspec) # create actual NNNBasePipe self.pspec = pspec - super().__init__(alu, num_rows) # initialise fan-in/fan-out + alu_name = self.fnunit.name.lower() + super().__init__(alu, num_rows, alu_name) # initialise fan-in/fan-out self.cu = [] for idx in range(num_rows): - alu_name = "alu_%s%d" % (self.fnunit.name.lower(), idx) + alu_name = "alu_%s%d" % (alu_name, idx) palu = self.pseudoalus[idx] cu = MultiCompUnit(regspec, palu, opsubset, name=alu_name) cu.fnunit = self.fnunit @@ -165,36 +166,40 @@ class FunctionUnitBaseMulti(ReservationStations2): ###################################################################### ###### actual Function Units: these are "single" stage pipelines ##### -#class ALUFunctionUnit(FunctionUnitBaseMulti): -class ALUFunctionUnit(FunctionUnitBaseSingle): +#class ALUFunctionUnit(FunctionUnitBaseSingle): +class ALUFunctionUnit(FunctionUnitBaseMulti): fnunit = Function.ALU def __init__(self, idx): super().__init__(ALUPipeSpec, ALUBasePipe, 1) -class LogicalFunctionUnit(FunctionUnitBaseSingle): +#class LogicalFunctionUnit(FunctionUnitBaseSingle): +class LogicalFunctionUnit(FunctionUnitBaseMulti): fnunit = Function.LOGICAL def __init__(self, idx): super().__init__(LogicalPipeSpec, LogicalBasePipe, idx) -class CRFunctionUnit(FunctionUnitBaseSingle): +#class CRFunctionUnit(FunctionUnitBaseSingle): +class CRFunctionUnit(FunctionUnitBaseMulti): fnunit = Function.CR def __init__(self, idx): super().__init__(CRPipeSpec, CRBasePipe, idx) -class BranchFunctionUnit(FunctionUnitBaseSingle): +#class BranchFunctionUnit(FunctionUnitBaseSingle): +class BranchFunctionUnit(FunctionUnitBaseMulti): fnunit = Function.BRANCH def __init__(self, idx): super().__init__(BranchPipeSpec, BranchBasePipe, idx) -class ShiftRotFunctionUnit(FunctionUnitBaseSingle): +#class ShiftRotFunctionUnit(FunctionUnitBaseSingle): +class ShiftRotFunctionUnit(FunctionUnitBaseMulti): fnunit = Function.SHIFT_ROT def __init__(self, idx): @@ -222,7 +227,8 @@ class DivPipeFunctionUnit(FunctionUnitBaseSingle): super().__init__(DivPipeSpecDivPipeCore, DivBasePipe, idx) -class MulFunctionUnit(FunctionUnitBaseSingle): +#class MulFunctionUnit(FunctionUnitBaseSingle): +class MulFunctionUnit(FunctionUnitBaseMulti): fnunit = Function.MUL def __init__(self, idx): -- 2.30.2