From 444cbe625006a2a47f54621b28a16d5bcd66a3e9 Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Sun, 6 Jun 2021 11:34:46 -0300 Subject: [PATCH] cpu: Add a branch_prediction namespace Encapsulate all branch-prediction-related files in a branch_prediction namespace. This will allow these files to be renamed to drop the BP suffix. Issued-on: https://gem5.atlassian.net/browse/GEM5-982 Change-Id: I640c0caa846a3aade6fae95e9a93e4318ae9fca0 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47303 Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/cpu/minor/fetch2.hh | 2 +- src/cpu/o3/fetch.hh | 2 +- src/cpu/pred/2bit_local.cc | 4 ++ src/cpu/pred/2bit_local.hh | 4 ++ src/cpu/pred/BranchPredictor.py | 70 ++++++++++--------- src/cpu/pred/bi_mode.cc | 4 ++ src/cpu/pred/bi_mode.hh | 4 ++ src/cpu/pred/bpred_unit.cc | 4 ++ src/cpu/pred/bpred_unit.hh | 4 ++ src/cpu/pred/btb.cc | 4 ++ src/cpu/pred/btb.hh | 4 ++ src/cpu/pred/indirect.hh | 4 ++ src/cpu/pred/loop_predictor.cc | 4 ++ src/cpu/pred/loop_predictor.hh | 4 ++ src/cpu/pred/ltage.cc | 4 ++ src/cpu/pred/ltage.hh | 4 ++ src/cpu/pred/multiperspective_perceptron.cc | 4 ++ src/cpu/pred/multiperspective_perceptron.hh | 4 ++ .../pred/multiperspective_perceptron_64KB.cc | 4 ++ .../pred/multiperspective_perceptron_64KB.hh | 4 ++ .../pred/multiperspective_perceptron_8KB.cc | 4 ++ .../pred/multiperspective_perceptron_8KB.hh | 4 ++ .../pred/multiperspective_perceptron_tage.cc | 4 ++ .../pred/multiperspective_perceptron_tage.hh | 4 ++ .../multiperspective_perceptron_tage_64KB.cc | 4 ++ .../multiperspective_perceptron_tage_64KB.hh | 4 ++ .../multiperspective_perceptron_tage_8KB.cc | 4 ++ .../multiperspective_perceptron_tage_8KB.hh | 4 ++ src/cpu/pred/ras.cc | 4 ++ src/cpu/pred/ras.hh | 4 ++ src/cpu/pred/simple_indirect.cc | 4 ++ src/cpu/pred/simple_indirect.hh | 4 ++ src/cpu/pred/statistical_corrector.cc | 4 ++ src/cpu/pred/statistical_corrector.hh | 4 ++ src/cpu/pred/tage.cc | 4 ++ src/cpu/pred/tage.hh | 4 ++ src/cpu/pred/tage_base.cc | 4 ++ src/cpu/pred/tage_base.hh | 4 ++ src/cpu/pred/tage_sc_l.cc | 4 ++ src/cpu/pred/tage_sc_l.hh | 4 ++ src/cpu/pred/tage_sc_l_64KB.cc | 4 ++ src/cpu/pred/tage_sc_l_64KB.hh | 4 ++ src/cpu/pred/tage_sc_l_8KB.cc | 4 ++ src/cpu/pred/tage_sc_l_8KB.hh | 4 ++ src/cpu/pred/tournament.cc | 4 ++ src/cpu/pred/tournament.hh | 4 ++ src/cpu/simple/base.hh | 7 +- 47 files changed, 216 insertions(+), 37 deletions(-) diff --git a/src/cpu/minor/fetch2.hh b/src/cpu/minor/fetch2.hh index 09b7867f1b..41a7a7fde4 100644 --- a/src/cpu/minor/fetch2.hh +++ b/src/cpu/minor/fetch2.hh @@ -93,7 +93,7 @@ class Fetch2 : public Named bool processMoreThanOneInput; /** Branch predictor passed from Python configuration */ - BPredUnit &branchPredictor; + branch_prediction::BPredUnit &branchPredictor; public: /* Public so that Pipeline can pass it to Fetch1 */ diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh index f138718a0a..5bfb01a277 100644 --- a/src/cpu/o3/fetch.hh +++ b/src/cpu/o3/fetch.hh @@ -411,7 +411,7 @@ class Fetch TimeBuffer::wire toDecode; /** BPredUnit. */ - BPredUnit *branchPred; + branch_prediction::BPredUnit *branchPred; TheISA::PCState pc[MaxThreads]; diff --git a/src/cpu/pred/2bit_local.cc b/src/cpu/pred/2bit_local.cc index 61ce7763fb..c9aa714ed1 100644 --- a/src/cpu/pred/2bit_local.cc +++ b/src/cpu/pred/2bit_local.cc @@ -36,6 +36,9 @@ namespace gem5 { +namespace branch_prediction +{ + LocalBP::LocalBP(const LocalBPParams ¶ms) : BPredUnit(params), localPredictorSize(params.localPredictorSize), @@ -137,4 +140,5 @@ LocalBP::uncondBranch(ThreadID tid, Addr pc, void *&bp_history) { } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/2bit_local.hh b/src/cpu/pred/2bit_local.hh index 8d2a09b65a..55f45ca55c 100644 --- a/src/cpu/pred/2bit_local.hh +++ b/src/cpu/pred/2bit_local.hh @@ -51,6 +51,9 @@ namespace gem5 { +namespace branch_prediction +{ + /** * Implements a local predictor that uses the PC to index into a table of * counters. Note that any time a pointer to the bp_history is given, it @@ -125,6 +128,7 @@ class LocalBP : public BPredUnit const unsigned indexMask; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_2BIT_LOCAL_PRED_HH__ diff --git a/src/cpu/pred/BranchPredictor.py b/src/cpu/pred/BranchPredictor.py index aa8e5cf2e2..c6abebb6ab 100644 --- a/src/cpu/pred/BranchPredictor.py +++ b/src/cpu/pred/BranchPredictor.py @@ -31,7 +31,7 @@ from m5.proxy import * class IndirectPredictor(SimObject): type = 'IndirectPredictor' - cxx_class = 'gem5::IndirectPredictor' + cxx_class = 'gem5::branch_prediction::IndirectPredictor' cxx_header = "cpu/pred/indirect.hh" abstract = True @@ -39,7 +39,7 @@ class IndirectPredictor(SimObject): class SimpleIndirectPredictor(IndirectPredictor): type = 'SimpleIndirectPredictor' - cxx_class = 'gem5::SimpleIndirectPredictor' + cxx_class = 'gem5::branch_prediction::SimpleIndirectPredictor' cxx_header = "cpu/pred/simple_indirect.hh" indirectHashGHR = Param.Bool(True, "Hash branch predictor GHR") @@ -54,7 +54,7 @@ class SimpleIndirectPredictor(IndirectPredictor): class BranchPredictor(SimObject): type = 'BranchPredictor' - cxx_class = 'gem5::BPredUnit' + cxx_class = 'gem5::branch_prediction::BPredUnit' cxx_header = "cpu/pred/bpred_unit.hh" abstract = True @@ -69,7 +69,7 @@ class BranchPredictor(SimObject): class LocalBP(BranchPredictor): type = 'LocalBP' - cxx_class = 'gem5::LocalBP' + cxx_class = 'gem5::branch_prediction::LocalBP' cxx_header = "cpu/pred/2bit_local.hh" localPredictorSize = Param.Unsigned(2048, "Size of local predictor") @@ -78,7 +78,7 @@ class LocalBP(BranchPredictor): class TournamentBP(BranchPredictor): type = 'TournamentBP' - cxx_class = 'gem5::TournamentBP' + cxx_class = 'gem5::branch_prediction::TournamentBP' cxx_header = "cpu/pred/tournament.hh" localPredictorSize = Param.Unsigned(2048, "Size of local predictor") @@ -92,7 +92,7 @@ class TournamentBP(BranchPredictor): class BiModeBP(BranchPredictor): type = 'BiModeBP' - cxx_class = 'gem5::BiModeBP' + cxx_class = 'gem5::branch_prediction::BiModeBP' cxx_header = "cpu/pred/bi_mode.hh" globalPredictorSize = Param.Unsigned(8192, "Size of global predictor") @@ -102,7 +102,7 @@ class BiModeBP(BranchPredictor): class TAGEBase(SimObject): type = 'TAGEBase' - cxx_class = 'gem5::TAGEBase' + cxx_class = 'gem5::branch_prediction::TAGEBase' cxx_header = "cpu/pred/tage_base.hh" numThreads = Param.Unsigned(Parent.numThreads, "Number of threads") @@ -147,8 +147,9 @@ class TAGEBase(SimObject): # The default sizes below are for the 8C-TAGE configuration (63.5 Kbits) class TAGE(BranchPredictor): type = 'TAGE' - cxx_class = 'gem5::TAGE' + cxx_class = 'gem5::branch_prediction::TAGE' cxx_header = "cpu/pred/tage.hh" + tage = Param.TAGEBase(TAGEBase(), "Tage object") class LTAGE_TAGE(TAGEBase): @@ -161,7 +162,7 @@ class LTAGE_TAGE(TAGEBase): class LoopPredictor(SimObject): type = 'LoopPredictor' - cxx_class = 'gem5::LoopPredictor' + cxx_class = 'gem5::branch_prediction::LoopPredictor' cxx_header = 'cpu/pred/loop_predictor.hh' logSizeLoopPred = Param.Unsigned(8, "Log size of the loop predictor") @@ -201,9 +202,10 @@ class LoopPredictor(SimObject): class TAGE_SC_L_TAGE(TAGEBase): type = 'TAGE_SC_L_TAGE' - cxx_class = 'gem5::TAGE_SC_L_TAGE' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L_TAGE' cxx_header = "cpu/pred/tage_sc_l.hh" abstract = True + tagTableTagWidths = [0] numUseAltOnNa = 16 pathHistBits = 27 @@ -238,8 +240,9 @@ class TAGE_SC_L_TAGE(TAGEBase): class TAGE_SC_L_TAGE_64KB(TAGE_SC_L_TAGE): type = 'TAGE_SC_L_TAGE_64KB' - cxx_class = 'gem5::TAGE_SC_L_TAGE_64KB' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L_TAGE_64KB' cxx_header = "cpu/pred/tage_sc_l_64KB.hh" + nHistoryTables = 36 minHist = 6 @@ -268,7 +271,7 @@ class TAGE_SC_L_TAGE_64KB(TAGE_SC_L_TAGE): class TAGE_SC_L_TAGE_8KB(TAGE_SC_L_TAGE): type = 'TAGE_SC_L_TAGE_8KB' - cxx_class = 'gem5::TAGE_SC_L_TAGE_8KB' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L_TAGE_8KB' cxx_header = "cpu/pred/tage_sc_l_8KB.hh" nHistoryTables = 30 @@ -297,7 +300,7 @@ class TAGE_SC_L_TAGE_8KB(TAGE_SC_L_TAGE): # The differnt TAGE sizes are updated according to the paper values (256 Kbits) class LTAGE(TAGE): type = 'LTAGE' - cxx_class = 'gem5::LTAGE' + cxx_class = 'gem5::branch_prediction::LTAGE' cxx_header = "cpu/pred/ltage.hh" tage = LTAGE_TAGE() @@ -306,8 +309,9 @@ class LTAGE(TAGE): class TAGE_SC_L_LoopPredictor(LoopPredictor): type = 'TAGE_SC_L_LoopPredictor' - cxx_class = 'gem5::TAGE_SC_L_LoopPredictor' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L_LoopPredictor' cxx_header = "cpu/pred/tage_sc_l.hh" + loopTableAgeBits = 4 loopTableConfidenceBits = 4 loopTableTagBits = 10 @@ -322,7 +326,7 @@ class TAGE_SC_L_LoopPredictor(LoopPredictor): class StatisticalCorrector(SimObject): type = 'StatisticalCorrector' - cxx_class = 'gem5::StatisticalCorrector' + cxx_class = 'gem5::branch_prediction::StatisticalCorrector' cxx_header = "cpu/pred/statistical_corrector.hh" abstract = True @@ -385,7 +389,7 @@ class StatisticalCorrector(SimObject): # of speculation: All the structures/histories are updated at commit time class TAGE_SC_L(LTAGE): type = 'TAGE_SC_L' - cxx_class = 'gem5::TAGE_SC_L' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L' cxx_header = "cpu/pred/tage_sc_l.hh" abstract = True @@ -400,7 +404,7 @@ class TAGE_SC_L_8KB_LoopPredictor(TAGE_SC_L_LoopPredictor): class TAGE_SC_L_64KB_StatisticalCorrector(StatisticalCorrector): type = 'TAGE_SC_L_64KB_StatisticalCorrector' - cxx_class = 'gem5::TAGE_SC_L_64KB_StatisticalCorrector' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector' cxx_header = "cpu/pred/tage_sc_l_64KB.hh" pnb = Param.Unsigned(3, "Num variation global branch GEHL lengths") @@ -446,7 +450,7 @@ class TAGE_SC_L_64KB_StatisticalCorrector(StatisticalCorrector): class TAGE_SC_L_8KB_StatisticalCorrector(StatisticalCorrector): type = 'TAGE_SC_L_8KB_StatisticalCorrector' - cxx_class = 'gem5::TAGE_SC_L_8KB_StatisticalCorrector' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector' cxx_header = "cpu/pred/tage_sc_l_8KB.hh" gnb = Param.Unsigned(2, "Num global branch GEHL lengths") @@ -474,7 +478,7 @@ class TAGE_SC_L_8KB_StatisticalCorrector(StatisticalCorrector): # http://www.jilp.org/cbp2016/paper/AndreSeznecLimited.pdf class TAGE_SC_L_64KB(TAGE_SC_L): type = 'TAGE_SC_L_64KB' - cxx_class = 'gem5::TAGE_SC_L_64KB' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L_64KB' cxx_header = "cpu/pred/tage_sc_l_64KB.hh" tage = TAGE_SC_L_TAGE_64KB() @@ -485,7 +489,7 @@ class TAGE_SC_L_64KB(TAGE_SC_L): # http://www.jilp.org/cbp2016/paper/AndreSeznecLimited.pdf class TAGE_SC_L_8KB(TAGE_SC_L): type = 'TAGE_SC_L_8KB' - cxx_class = 'gem5::TAGE_SC_L_8KB' + cxx_class = 'gem5::branch_prediction::TAGE_SC_L_8KB' cxx_header = "cpu/pred/tage_sc_l_8KB.hh" tage = TAGE_SC_L_TAGE_8KB() @@ -494,7 +498,7 @@ class TAGE_SC_L_8KB(TAGE_SC_L): class MultiperspectivePerceptron(BranchPredictor): type = 'MultiperspectivePerceptron' - cxx_class = 'gem5::MultiperspectivePerceptron' + cxx_class = 'gem5::branch_prediction::MultiperspectivePerceptron' cxx_header = 'cpu/pred/multiperspective_perceptron.hh' abstract = True @@ -557,7 +561,7 @@ class MultiperspectivePerceptron(BranchPredictor): class MultiperspectivePerceptron8KB(MultiperspectivePerceptron): type = 'MultiperspectivePerceptron8KB' - cxx_class = 'gem5::MultiperspectivePerceptron8KB' + cxx_class = 'gem5::branch_prediction::MultiperspectivePerceptron8KB' cxx_header = 'cpu/pred/multiperspective_perceptron_8KB.hh' budgetbits = 8192 * 8 + 2048 @@ -569,7 +573,7 @@ class MultiperspectivePerceptron8KB(MultiperspectivePerceptron): class MultiperspectivePerceptron64KB(MultiperspectivePerceptron): type = 'MultiperspectivePerceptron64KB' - cxx_class = 'gem5::MultiperspectivePerceptron64KB' + cxx_class = 'gem5::branch_prediction::MultiperspectivePerceptron64KB' cxx_header = 'cpu/pred/multiperspective_perceptron_64KB.hh' budgetbits = 65536 * 8 + 2048 @@ -581,7 +585,7 @@ class MultiperspectivePerceptron64KB(MultiperspectivePerceptron): class MPP_TAGE(TAGEBase): type = 'MPP_TAGE' - cxx_class = 'gem5::MPP_TAGE' + cxx_class = 'gem5::branch_prediction::MPP_TAGE' cxx_header = 'cpu/pred/multiperspective_perceptron_tage.hh' nHistoryTables = 15 @@ -603,7 +607,7 @@ class MPP_TAGE(TAGEBase): class MPP_LoopPredictor(LoopPredictor): type = 'MPP_LoopPredictor' - cxx_class = 'gem5::MPP_LoopPredictor' + cxx_class = 'gem5::branch_prediction::MPP_LoopPredictor' cxx_header = 'cpu/pred/multiperspective_perceptron_tage.hh' useDirectionBit = True @@ -621,7 +625,7 @@ class MPP_LoopPredictor(LoopPredictor): class MPP_StatisticalCorrector(StatisticalCorrector): type = 'MPP_StatisticalCorrector' - cxx_class = 'gem5::MPP_StatisticalCorrector' + cxx_class = 'gem5::branch_prediction::MPP_StatisticalCorrector' cxx_header = 'cpu/pred/multiperspective_perceptron_tage.hh' abstract = True @@ -657,7 +661,7 @@ class MPP_StatisticalCorrector(StatisticalCorrector): class MultiperspectivePerceptronTAGE(MultiperspectivePerceptron): type = 'MultiperspectivePerceptronTAGE' - cxx_class = 'gem5::MultiperspectivePerceptronTAGE' + cxx_class = 'gem5::branch_prediction::MultiperspectivePerceptronTAGE' cxx_header = 'cpu/pred/multiperspective_perceptron_tage.hh' abstract = True @@ -679,7 +683,7 @@ class MultiperspectivePerceptronTAGE(MultiperspectivePerceptron): class MPP_StatisticalCorrector_64KB(MPP_StatisticalCorrector): type = 'MPP_StatisticalCorrector_64KB' - cxx_class = 'gem5::MPP_StatisticalCorrector_64KB' + cxx_class = 'gem5::branch_prediction::MPP_StatisticalCorrector_64KB' cxx_header = 'cpu/pred/multiperspective_perceptron_tage_64KB.hh' logBias = 8 @@ -703,7 +707,7 @@ class MPP_StatisticalCorrector_64KB(MPP_StatisticalCorrector): class MultiperspectivePerceptronTAGE64KB(MultiperspectivePerceptronTAGE): type = 'MultiperspectivePerceptronTAGE64KB' - cxx_class = 'gem5::MultiperspectivePerceptronTAGE64KB' + cxx_class = 'gem5::branch_prediction::MultiperspectivePerceptronTAGE64KB' cxx_header = 'cpu/pred/multiperspective_perceptron_tage_64KB.hh' budgetbits = 65536 * 8 + 2048 @@ -714,7 +718,7 @@ class MultiperspectivePerceptronTAGE64KB(MultiperspectivePerceptronTAGE): class MPP_TAGE_8KB(MPP_TAGE): type = 'MPP_TAGE_8KB' - cxx_class = 'gem5::MPP_TAGE_8KB' + cxx_class = 'gem5::branch_prediction::MPP_TAGE_8KB' cxx_header = 'cpu/pred/multiperspective_perceptron_tage_8KB.hh' nHistoryTables = 10 @@ -724,7 +728,7 @@ class MPP_TAGE_8KB(MPP_TAGE): class MPP_LoopPredictor_8KB(MPP_LoopPredictor): type = 'MPP_LoopPredictor_8KB' - cxx_class = 'gem5::MPP_LoopPredictor_8KB' + cxx_class = 'gem5::branch_prediction::MPP_LoopPredictor_8KB' cxx_header = 'cpu/pred/multiperspective_perceptron_tage_8KB.hh' loopTableIterBits = 10 @@ -732,7 +736,7 @@ class MPP_LoopPredictor_8KB(MPP_LoopPredictor): class MPP_StatisticalCorrector_8KB(MPP_StatisticalCorrector): type = 'MPP_StatisticalCorrector_8KB' - cxx_class = 'gem5::MPP_StatisticalCorrector_8KB' + cxx_class = 'gem5::branch_prediction::MPP_StatisticalCorrector_8KB' cxx_header = 'cpu/pred/multiperspective_perceptron_tage_8KB.hh' logBias = 7 @@ -749,7 +753,7 @@ class MPP_StatisticalCorrector_8KB(MPP_StatisticalCorrector): class MultiperspectivePerceptronTAGE8KB(MultiperspectivePerceptronTAGE): type = 'MultiperspectivePerceptronTAGE8KB' - cxx_class = 'gem5::MultiperspectivePerceptronTAGE8KB' + cxx_class = 'gem5::branch_prediction::MultiperspectivePerceptronTAGE8KB' cxx_header = 'cpu/pred/multiperspective_perceptron_tage_8KB.hh' budgetbits = 8192 * 8 + 2048 diff --git a/src/cpu/pred/bi_mode.cc b/src/cpu/pred/bi_mode.cc index 230d3a3505..40dcbad7db 100644 --- a/src/cpu/pred/bi_mode.cc +++ b/src/cpu/pred/bi_mode.cc @@ -38,6 +38,9 @@ namespace gem5 { +namespace branch_prediction +{ + BiModeBP::BiModeBP(const BiModeBPParams ¶ms) : BPredUnit(params), globalHistoryReg(params.numThreads, 0), @@ -229,4 +232,5 @@ BiModeBP::updateGlobalHistReg(ThreadID tid, bool taken) globalHistoryReg[tid] &= historyRegisterMask; } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/bi_mode.hh b/src/cpu/pred/bi_mode.hh index 1135770bb8..721d21b79a 100644 --- a/src/cpu/pred/bi_mode.hh +++ b/src/cpu/pred/bi_mode.hh @@ -40,6 +40,9 @@ namespace gem5 { +namespace branch_prediction +{ + /** * Implements a bi-mode branch predictor. The bi-mode predictor is a two-level * branch predictor that has three seprate history arrays: a taken array, a @@ -112,6 +115,7 @@ class BiModeBP : public BPredUnit unsigned notTakenThreshold; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_BI_MODE_PRED_HH__ diff --git a/src/cpu/pred/bpred_unit.cc b/src/cpu/pred/bpred_unit.cc index a1ffeed71e..c80fd40ede 100644 --- a/src/cpu/pred/bpred_unit.cc +++ b/src/cpu/pred/bpred_unit.cc @@ -53,6 +53,9 @@ namespace gem5 { +namespace branch_prediction +{ + BPredUnit::BPredUnit(const Params ¶ms) : SimObject(params), numThreads(params.numThreads), @@ -521,4 +524,5 @@ BPredUnit::dump() } } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/bpred_unit.hh b/src/cpu/pred/bpred_unit.hh index 11f9452853..d6b40e13b0 100644 --- a/src/cpu/pred/bpred_unit.hh +++ b/src/cpu/pred/bpred_unit.hh @@ -58,6 +58,9 @@ namespace gem5 { +namespace branch_prediction +{ + /** * Basically a wrapper class to hold both the branch predictor * and the BTB. @@ -344,6 +347,7 @@ class BPredUnit : public SimObject /** @} */ }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_BPRED_UNIT_HH__ diff --git a/src/cpu/pred/btb.cc b/src/cpu/pred/btb.cc index 755c69fe2a..a88ce67f80 100644 --- a/src/cpu/pred/btb.cc +++ b/src/cpu/pred/btb.cc @@ -35,6 +35,9 @@ namespace gem5 { +namespace branch_prediction +{ + DefaultBTB::DefaultBTB(unsigned _numEntries, unsigned _tagBits, unsigned _instShiftAmt, @@ -140,4 +143,5 @@ DefaultBTB::update(Addr instPC, const TheISA::PCState &target, ThreadID tid) btb[btb_idx].tag = getTag(instPC); } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/btb.hh b/src/cpu/pred/btb.hh index 8b99b6e0a4..e3c2f5fa4b 100644 --- a/src/cpu/pred/btb.hh +++ b/src/cpu/pred/btb.hh @@ -37,6 +37,9 @@ namespace gem5 { +namespace branch_prediction +{ + class DefaultBTB { private: @@ -131,6 +134,7 @@ class DefaultBTB unsigned log2NumThreads; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_BTB_HH__ diff --git a/src/cpu/pred/indirect.hh b/src/cpu/pred/indirect.hh index 365d0e07c0..e744a1b6de 100644 --- a/src/cpu/pred/indirect.hh +++ b/src/cpu/pred/indirect.hh @@ -38,6 +38,9 @@ namespace gem5 { +namespace branch_prediction +{ + class IndirectPredictor : public SimObject { public: @@ -66,6 +69,7 @@ class IndirectPredictor : public SimObject bool actually_taken) = 0; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_INDIRECT_BASE_HH__ diff --git a/src/cpu/pred/loop_predictor.cc b/src/cpu/pred/loop_predictor.cc index 4333d9d8b8..6574d61bb1 100644 --- a/src/cpu/pred/loop_predictor.cc +++ b/src/cpu/pred/loop_predictor.cc @@ -41,6 +41,9 @@ namespace gem5 { +namespace branch_prediction +{ + LoopPredictor::LoopPredictor(const LoopPredictorParams &p) : SimObject(p), logSizeLoopPred(p.logSizeLoopPred), loopTableAgeBits(p.loopTableAgeBits), @@ -369,4 +372,5 @@ LoopPredictor::getSizeInBits() const loopTableAgeBits + useDirectionBit); } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/loop_predictor.hh b/src/cpu/pred/loop_predictor.hh index e8967f98c3..44d75aba35 100644 --- a/src/cpu/pred/loop_predictor.hh +++ b/src/cpu/pred/loop_predictor.hh @@ -43,6 +43,9 @@ namespace gem5 struct LoopPredictorParams; +namespace branch_prediction +{ + class LoopPredictor : public SimObject { protected: @@ -261,6 +264,7 @@ class LoopPredictor : public SimObject size_t getSizeInBits() const; }; +} // namespace branch_prediction } // namespace gem5 #endif//__CPU_PRED_LOOP_PREDICTOR_HH__ diff --git a/src/cpu/pred/ltage.cc b/src/cpu/pred/ltage.cc index 56375cf73b..930d6bf44a 100644 --- a/src/cpu/pred/ltage.cc +++ b/src/cpu/pred/ltage.cc @@ -47,6 +47,9 @@ namespace gem5 { +namespace branch_prediction +{ + LTAGE::LTAGE(const LTAGEParams ¶ms) : TAGE(params), loopPredictor(params.loop_predictor) { @@ -144,4 +147,5 @@ LTAGE::squash(ThreadID tid, void *bp_history) TAGE::squash(tid, bp_history); } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/ltage.hh b/src/cpu/pred/ltage.hh index fbd6671e02..7deaa2bc04 100644 --- a/src/cpu/pred/ltage.hh +++ b/src/cpu/pred/ltage.hh @@ -60,6 +60,9 @@ namespace gem5 { +namespace branch_prediction +{ + class LTAGE : public TAGE { public: @@ -112,6 +115,7 @@ class LTAGE : public TAGE ThreadID tid, Addr branch_pc, bool cond_branch, void* &b) override; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_LTAGE_HH__ diff --git a/src/cpu/pred/multiperspective_perceptron.cc b/src/cpu/pred/multiperspective_perceptron.cc index fdb807756f..25b4d7d39a 100644 --- a/src/cpu/pred/multiperspective_perceptron.cc +++ b/src/cpu/pred/multiperspective_perceptron.cc @@ -44,6 +44,9 @@ namespace gem5 { +namespace branch_prediction +{ + int MultiperspectivePerceptron::xlat[] = {1,3,4,5,7,8,9,11,12,14,15,17,19,21,23,25,27,29,32,34,37,41,45,49,53,58,63, @@ -826,4 +829,5 @@ MultiperspectivePerceptron::squash(ThreadID tid, void *bp_history) delete bi; } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/multiperspective_perceptron.hh b/src/cpu/pred/multiperspective_perceptron.hh index 6a67a7c90d..68ab5f1a23 100644 --- a/src/cpu/pred/multiperspective_perceptron.hh +++ b/src/cpu/pred/multiperspective_perceptron.hh @@ -48,6 +48,9 @@ namespace gem5 { +namespace branch_prediction +{ + class MultiperspectivePerceptron : public BPredUnit { protected: @@ -1055,6 +1058,7 @@ class MultiperspectivePerceptron : public BPredUnit void btbUpdate(ThreadID tid, Addr branch_addr, void* &bp_history) override; }; +} // namespace branch_prediction } // namespace gem5 #endif//__CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_HH__ diff --git a/src/cpu/pred/multiperspective_perceptron_64KB.cc b/src/cpu/pred/multiperspective_perceptron_64KB.cc index e853c0e720..39c51c53d9 100644 --- a/src/cpu/pred/multiperspective_perceptron_64KB.cc +++ b/src/cpu/pred/multiperspective_perceptron_64KB.cc @@ -42,6 +42,9 @@ namespace gem5 { +namespace branch_prediction +{ + MultiperspectivePerceptron64KB::MultiperspectivePerceptron64KB( const MultiperspectivePerceptron64KBParams &p) : MultiperspectivePerceptron(p) @@ -89,4 +92,5 @@ MultiperspectivePerceptron64KB::createSpecs() { addSpec(new SGHISTPATH(1, 5, 2, 1.3125, 972, 6, *this)); } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/multiperspective_perceptron_64KB.hh b/src/cpu/pred/multiperspective_perceptron_64KB.hh index 10851fa98b..5e893c2837 100644 --- a/src/cpu/pred/multiperspective_perceptron_64KB.hh +++ b/src/cpu/pred/multiperspective_perceptron_64KB.hh @@ -46,6 +46,9 @@ namespace gem5 { +namespace branch_prediction +{ + class MultiperspectivePerceptron64KB : public MultiperspectivePerceptron { void createSpecs() override; @@ -54,6 +57,7 @@ class MultiperspectivePerceptron64KB : public MultiperspectivePerceptron const MultiperspectivePerceptron64KBParams &p); }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_64KB_HH__ diff --git a/src/cpu/pred/multiperspective_perceptron_8KB.cc b/src/cpu/pred/multiperspective_perceptron_8KB.cc index b341adae47..3a3dbd8986 100644 --- a/src/cpu/pred/multiperspective_perceptron_8KB.cc +++ b/src/cpu/pred/multiperspective_perceptron_8KB.cc @@ -42,6 +42,9 @@ namespace gem5 { +namespace branch_prediction +{ + MultiperspectivePerceptron8KB::MultiperspectivePerceptron8KB( const MultiperspectivePerceptron8KBParams &p) : MultiperspectivePerceptron(p) @@ -68,4 +71,5 @@ MultiperspectivePerceptron8KB::createSpecs() { addSpec(new SGHISTPATH(1, 2, 5, 2.53125, 0, 5, *this)); } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/multiperspective_perceptron_8KB.hh b/src/cpu/pred/multiperspective_perceptron_8KB.hh index 58d1d02aa1..085b6742ad 100644 --- a/src/cpu/pred/multiperspective_perceptron_8KB.hh +++ b/src/cpu/pred/multiperspective_perceptron_8KB.hh @@ -46,6 +46,9 @@ namespace gem5 { +namespace branch_prediction +{ + class MultiperspectivePerceptron8KB : public MultiperspectivePerceptron { void createSpecs() override; @@ -54,6 +57,7 @@ class MultiperspectivePerceptron8KB : public MultiperspectivePerceptron const MultiperspectivePerceptron8KBParams &p); }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_8KB_HH__ diff --git a/src/cpu/pred/multiperspective_perceptron_tage.cc b/src/cpu/pred/multiperspective_perceptron_tage.cc index f0da0068f9..67c470fbdf 100644 --- a/src/cpu/pred/multiperspective_perceptron_tage.cc +++ b/src/cpu/pred/multiperspective_perceptron_tage.cc @@ -43,6 +43,9 @@ namespace gem5 { +namespace branch_prediction +{ + void MPP_TAGE::calculateParameters() { @@ -684,4 +687,5 @@ MultiperspectivePerceptronTAGE::squash(ThreadID tid, void *bp_history) delete bi; } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/multiperspective_perceptron_tage.hh b/src/cpu/pred/multiperspective_perceptron_tage.hh index b79c06b444..3a92e3cf07 100644 --- a/src/cpu/pred/multiperspective_perceptron_tage.hh +++ b/src/cpu/pred/multiperspective_perceptron_tage.hh @@ -51,6 +51,9 @@ namespace gem5 { +namespace branch_prediction +{ + class MPP_TAGE : public TAGEBase { std::vector tunedHistoryLengths; @@ -242,6 +245,7 @@ class MultiperspectivePerceptronTAGE : public MultiperspectivePerceptron }; +} // namespace branch_prediction } // namespace gem5 #endif//__CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_HH__ diff --git a/src/cpu/pred/multiperspective_perceptron_tage_64KB.cc b/src/cpu/pred/multiperspective_perceptron_tage_64KB.cc index af1d5c513d..2d7b991460 100644 --- a/src/cpu/pred/multiperspective_perceptron_tage_64KB.cc +++ b/src/cpu/pred/multiperspective_perceptron_tage_64KB.cc @@ -42,6 +42,9 @@ namespace gem5 { +namespace branch_prediction +{ + MPP_StatisticalCorrector_64KB::MPP_StatisticalCorrector_64KB( const MPP_StatisticalCorrector_64KBParams &p) : MPP_StatisticalCorrector(p), @@ -219,4 +222,5 @@ MultiperspectivePerceptronTAGE64KB::createSpecs() addSpec(new ACYCLIC(12, -1, -1, 2.0, 0, 6, *this)); } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/multiperspective_perceptron_tage_64KB.hh b/src/cpu/pred/multiperspective_perceptron_tage_64KB.hh index 41b7ae7869..88d041f400 100644 --- a/src/cpu/pred/multiperspective_perceptron_tage_64KB.hh +++ b/src/cpu/pred/multiperspective_perceptron_tage_64KB.hh @@ -46,6 +46,9 @@ namespace gem5 { +namespace branch_prediction +{ + class MPP_StatisticalCorrector_64KB : public MPP_StatisticalCorrector { const unsigned numEntriesSecondLocalHistories; @@ -89,6 +92,7 @@ class MultiperspectivePerceptronTAGE64KB : const MultiperspectivePerceptronTAGE64KBParams &p); }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_64KB_HH__ diff --git a/src/cpu/pred/multiperspective_perceptron_tage_8KB.cc b/src/cpu/pred/multiperspective_perceptron_tage_8KB.cc index 8d8ce3b49f..72d311434a 100644 --- a/src/cpu/pred/multiperspective_perceptron_tage_8KB.cc +++ b/src/cpu/pred/multiperspective_perceptron_tage_8KB.cc @@ -42,6 +42,9 @@ namespace gem5 { +namespace branch_prediction +{ + MPP_StatisticalCorrector_8KB::MPP_StatisticalCorrector_8KB( const MPP_StatisticalCorrector_8KBParams &p) : MPP_StatisticalCorrector(p) @@ -174,4 +177,5 @@ MultiperspectivePerceptronTAGE8KB::createSpecs() addSpec(new IMLI(4, 1.98, 0, 6, *this)); } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/multiperspective_perceptron_tage_8KB.hh b/src/cpu/pred/multiperspective_perceptron_tage_8KB.hh index 3adbcd47f3..62d72b6844 100644 --- a/src/cpu/pred/multiperspective_perceptron_tage_8KB.hh +++ b/src/cpu/pred/multiperspective_perceptron_tage_8KB.hh @@ -49,6 +49,9 @@ namespace gem5 { +namespace branch_prediction +{ + class MPP_TAGE_8KB : public MPP_TAGE { public: @@ -88,6 +91,7 @@ class MultiperspectivePerceptronTAGE8KB : const MultiperspectivePerceptronTAGE8KBParams &p); }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_8KB_HH__ diff --git a/src/cpu/pred/ras.cc b/src/cpu/pred/ras.cc index 49969b7930..6a81446022 100644 --- a/src/cpu/pred/ras.cc +++ b/src/cpu/pred/ras.cc @@ -31,6 +31,9 @@ namespace gem5 { +namespace branch_prediction +{ + void ReturnAddrStack::init(unsigned _numEntries) { @@ -83,4 +86,5 @@ ReturnAddrStack::restore(unsigned top_entry_idx, } } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/ras.hh b/src/cpu/pred/ras.hh index a41ab8893e..6edcc0e24c 100644 --- a/src/cpu/pred/ras.hh +++ b/src/cpu/pred/ras.hh @@ -38,6 +38,9 @@ namespace gem5 { +namespace branch_prediction +{ + /** Return address stack class, implements a simple RAS. */ class ReturnAddrStack { @@ -100,6 +103,7 @@ class ReturnAddrStack unsigned tos; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_RAS_HH__ diff --git a/src/cpu/pred/simple_indirect.cc b/src/cpu/pred/simple_indirect.cc index 7e9998fe60..7fd75f4b36 100644 --- a/src/cpu/pred/simple_indirect.cc +++ b/src/cpu/pred/simple_indirect.cc @@ -34,6 +34,9 @@ namespace gem5 { +namespace branch_prediction +{ + SimpleIndirectPredictor::SimpleIndirectPredictor( const SimpleIndirectPredictorParams ¶ms) : IndirectPredictor(params), @@ -237,4 +240,5 @@ SimpleIndirectPredictor::getTag(Addr br_addr) return (br_addr >> instShift) & ((0x1< threadInfo; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_INDIRECT_HH__ diff --git a/src/cpu/pred/statistical_corrector.cc b/src/cpu/pred/statistical_corrector.cc index c50686d076..d5b32cc506 100644 --- a/src/cpu/pred/statistical_corrector.cc +++ b/src/cpu/pred/statistical_corrector.cc @@ -46,6 +46,9 @@ namespace gem5 { +namespace branch_prediction +{ + StatisticalCorrector::StatisticalCorrector( const StatisticalCorrectorParams &p) : SimObject(p), @@ -412,4 +415,5 @@ StatisticalCorrector::StatisticalCorrectorStats::StatisticalCorrectorStats( { } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/statistical_corrector.hh b/src/cpu/pred/statistical_corrector.hh index 508fa67327..b1c48c2406 100644 --- a/src/cpu/pred/statistical_corrector.hh +++ b/src/cpu/pred/statistical_corrector.hh @@ -52,6 +52,9 @@ namespace gem5 struct StatisticalCorrectorParams; +namespace branch_prediction +{ + class StatisticalCorrector : public SimObject { protected: @@ -277,6 +280,7 @@ class StatisticalCorrector : public SimObject virtual size_t getSizeInBits() const; }; +} // namespace branch_prediction } // namespace gem5 #endif//__CPU_PRED_STATISTICAL_CORRECTOR_HH__ diff --git a/src/cpu/pred/tage.cc b/src/cpu/pred/tage.cc index 0569050bb0..1ba52e27c7 100644 --- a/src/cpu/pred/tage.cc +++ b/src/cpu/pred/tage.cc @@ -47,6 +47,9 @@ namespace gem5 { +namespace branch_prediction +{ + TAGE::TAGE(const TAGEParams ¶ms) : BPredUnit(params), tage(params.tage) { } @@ -129,4 +132,5 @@ TAGE::uncondBranch(ThreadID tid, Addr br_pc, void* &bp_history) tage->updateHistories(tid, br_pc, true, bi->tageBranchInfo, true); } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/tage.hh b/src/cpu/pred/tage.hh index 301c585e19..568f07bf9e 100644 --- a/src/cpu/pred/tage.hh +++ b/src/cpu/pred/tage.hh @@ -58,6 +58,9 @@ namespace gem5 { +namespace branch_prediction +{ + class TAGE: public BPredUnit { protected: @@ -93,6 +96,7 @@ class TAGE: public BPredUnit virtual void squash(ThreadID tid, void *bp_history) override; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_TAGE_HH__ diff --git a/src/cpu/pred/tage_base.cc b/src/cpu/pred/tage_base.cc index 72e454ca64..1ff8eba9f4 100644 --- a/src/cpu/pred/tage_base.cc +++ b/src/cpu/pred/tage_base.cc @@ -45,6 +45,9 @@ namespace gem5 { +namespace branch_prediction +{ + TAGEBase::TAGEBase(const TAGEBaseParams &p) : SimObject(p), logRatioBiModalHystEntries(p.logRatioBiModalHystEntries), @@ -802,4 +805,5 @@ TAGEBase::getSizeInBits() const { return bits; } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/tage_base.hh b/src/cpu/pred/tage_base.hh index 7063e6b2cb..4cc83eff00 100644 --- a/src/cpu/pred/tage_base.hh +++ b/src/cpu/pred/tage_base.hh @@ -59,6 +59,9 @@ namespace gem5 { +namespace branch_prediction +{ + class TAGEBase : public SimObject { public: @@ -508,6 +511,7 @@ class TAGEBase : public SimObject } stats; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_TAGE_BASE_HH__ diff --git a/src/cpu/pred/tage_sc_l.cc b/src/cpu/pred/tage_sc_l.cc index c1d05fc795..615c6230c8 100644 --- a/src/cpu/pred/tage_sc_l.cc +++ b/src/cpu/pred/tage_sc_l.cc @@ -48,6 +48,9 @@ namespace gem5 { +namespace branch_prediction +{ + bool TAGE_SC_L_LoopPredictor::calcConf(int index) const { @@ -462,4 +465,5 @@ TAGE_SC_L::update(ThreadID tid, Addr branch_pc, bool taken, void *bp_history, delete bi; } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/tage_sc_l.hh b/src/cpu/pred/tage_sc_l.hh index c9fe0e9a04..7dead58363 100644 --- a/src/cpu/pred/tage_sc_l.hh +++ b/src/cpu/pred/tage_sc_l.hh @@ -52,6 +52,9 @@ namespace gem5 { +namespace branch_prediction +{ + class TAGE_SC_L_TAGE : public TAGEBase { const unsigned firstLongTagTable; @@ -188,6 +191,7 @@ class TAGE_SC_L: public LTAGE }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_TAGE_SC_L_HH__ diff --git a/src/cpu/pred/tage_sc_l_64KB.cc b/src/cpu/pred/tage_sc_l_64KB.cc index aecc935ad6..b42590efe7 100644 --- a/src/cpu/pred/tage_sc_l_64KB.cc +++ b/src/cpu/pred/tage_sc_l_64KB.cc @@ -44,6 +44,9 @@ namespace gem5 { +namespace branch_prediction +{ + TAGE_SC_L_64KB_StatisticalCorrector::TAGE_SC_L_64KB_StatisticalCorrector( const TAGE_SC_L_64KB_StatisticalCorrectorParams &p) : StatisticalCorrector(p), @@ -311,4 +314,5 @@ TAGE_SC_L_64KB::TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams ¶ms) { } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/tage_sc_l_64KB.hh b/src/cpu/pred/tage_sc_l_64KB.hh index 7dff99878d..ff3fbacc52 100644 --- a/src/cpu/pred/tage_sc_l_64KB.hh +++ b/src/cpu/pred/tage_sc_l_64KB.hh @@ -53,6 +53,9 @@ namespace gem5 { +namespace branch_prediction +{ + class TAGE_SC_L_TAGE_64KB : public TAGE_SC_L_TAGE { public: @@ -135,6 +138,7 @@ class TAGE_SC_L_64KB : public TAGE_SC_L TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams ¶ms); }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_TAGE_SC_L_64KB_HH__ diff --git a/src/cpu/pred/tage_sc_l_8KB.cc b/src/cpu/pred/tage_sc_l_8KB.cc index 9218820c2b..04b9588289 100644 --- a/src/cpu/pred/tage_sc_l_8KB.cc +++ b/src/cpu/pred/tage_sc_l_8KB.cc @@ -47,6 +47,9 @@ namespace gem5 { +namespace branch_prediction +{ + TAGE_SC_L_8KB_StatisticalCorrector::TAGE_SC_L_8KB_StatisticalCorrector( const TAGE_SC_L_8KB_StatisticalCorrectorParams &p) : StatisticalCorrector(p), @@ -314,4 +317,5 @@ TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(Addr branch_pc, bool taken, } } +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/tage_sc_l_8KB.hh b/src/cpu/pred/tage_sc_l_8KB.hh index 54157e05c9..f93c56a24b 100644 --- a/src/cpu/pred/tage_sc_l_8KB.hh +++ b/src/cpu/pred/tage_sc_l_8KB.hh @@ -50,6 +50,9 @@ namespace gem5 { +namespace branch_prediction +{ + class TAGE_SC_L_TAGE_8KB : public TAGE_SC_L_TAGE { public: @@ -115,6 +118,7 @@ class TAGE_SC_L_8KB : public TAGE_SC_L TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams ¶ms); }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_TAGE_SC_L_8KB_HH__ diff --git a/src/cpu/pred/tournament.cc b/src/cpu/pred/tournament.cc index 53d8172117..c059b5df49 100644 --- a/src/cpu/pred/tournament.cc +++ b/src/cpu/pred/tournament.cc @@ -46,6 +46,9 @@ namespace gem5 { +namespace branch_prediction +{ + TournamentBP::TournamentBP(const TournamentBPParams ¶ms) : BPredUnit(params), localPredictorSize(params.localPredictorSize), @@ -351,4 +354,5 @@ int TournamentBP::BPHistory::newCount = 0; #endif +} // namespace branch_prediction } // namespace gem5 diff --git a/src/cpu/pred/tournament.hh b/src/cpu/pred/tournament.hh index 2adeba3281..3f2eb2517a 100644 --- a/src/cpu/pred/tournament.hh +++ b/src/cpu/pred/tournament.hh @@ -51,6 +51,9 @@ namespace gem5 { +namespace branch_prediction +{ + /** * Implements a tournament branch predictor, hopefully identical to the one * used in the 21264. It has a local predictor, which uses a local history @@ -242,6 +245,7 @@ class TournamentBP : public BPredUnit unsigned choiceThreshold; }; +} // namespace branch_prediction } // namespace gem5 #endif // __CPU_PRED_TOURNAMENT_PRED_HH__ diff --git a/src/cpu/simple/base.hh b/src/cpu/simple/base.hh index cee786d005..ee75d78f5b 100644 --- a/src/cpu/simple/base.hh +++ b/src/cpu/simple/base.hh @@ -71,14 +71,17 @@ namespace Trace } struct BaseSimpleCPUParams; -class BPredUnit; +namespace branch_prediction +{ + class BPredUnit; +} // namespace branch_prediction class SimpleExecContext; class BaseSimpleCPU : public BaseCPU { protected: ThreadID curThread; - BPredUnit *branchPred; + branch_prediction::BPredUnit *branchPred; const RegIndex zeroReg;