diff options
Diffstat (limited to 'src/cpu/pred/BranchPredictor.py')
-rw-r--r-- | src/cpu/pred/BranchPredictor.py | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index edcb58698..9c59574ff 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -31,19 +31,19 @@ from m5.SimObject import SimObject from m5.params import * from m5.proxy import * -class BranchPredictor(SimObject): - type = 'BranchPredictor' - cxx_class = 'BPredUnit' - cxx_header = "cpu/pred/bpred_unit.hh" +class IndirectPredictor(SimObject): + type = 'IndirectPredictor' + cxx_class = 'IndirectPredictor' + cxx_header = "cpu/pred/indirect.hh" abstract = True numThreads = Param.Unsigned(Parent.numThreads, "Number of threads") - BTBEntries = Param.Unsigned(4096, "Number of BTB entries") - BTBTagSize = Param.Unsigned(16, "Size of the BTB tags, in bits") - RASSize = Param.Unsigned(16, "RAS size") - instShiftAmt = Param.Unsigned(2, "Number of bits to shift instructions by") - useIndirect = Param.Bool(True, "Use indirect branch predictor") +class SimpleIndirectPredictor(IndirectPredictor): + type = 'SimpleIndirectPredictor' + cxx_class = 'SimpleIndirectPredictor' + cxx_header = "cpu/pred/simple_indirect.hh" + indirectHashGHR = Param.Bool(True, "Hash branch predictor GHR") indirectHashTargets = Param.Bool(True, "Hash path history targets") indirectSets = Param.Unsigned(256, "Cache sets for indirect predictor") @@ -52,8 +52,22 @@ class BranchPredictor(SimObject): indirectPathLength = Param.Unsigned(3, "Previous indirect targets to use for path history") indirectGHRBits = Param.Unsigned(13, "Indirect GHR number of bits") + instShiftAmt = Param.Unsigned(2, "Number of bits to shift instructions by") +class BranchPredictor(SimObject): + type = 'BranchPredictor' + cxx_class = 'BPredUnit' + cxx_header = "cpu/pred/bpred_unit.hh" + abstract = True + + numThreads = Param.Unsigned(Parent.numThreads, "Number of threads") + BTBEntries = Param.Unsigned(4096, "Number of BTB entries") + BTBTagSize = Param.Unsigned(16, "Size of the BTB tags, in bits") + RASSize = Param.Unsigned(16, "RAS size") + instShiftAmt = Param.Unsigned(2, "Number of bits to shift instructions by") + indirectBranchPred = Param.IndirectPredictor(SimpleIndirectPredictor(), + "Indirect branch predictor, set to NULL to disable indirect predictions") class LocalBP(BranchPredictor): type = 'LocalBP' |