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 <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47303
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2021-06-06 11:34:46 -03:00
committed by Daniel Carvalho
parent 60e4ad955d
commit 444cbe6250
47 changed files with 216 additions and 37 deletions

View File

@@ -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 */

View File

@@ -411,7 +411,7 @@ class Fetch
TimeBuffer<FetchStruct>::wire toDecode;
/** BPredUnit. */
BPredUnit *branchPred;
branch_prediction::BPredUnit *branchPred;
TheISA::PCState pc[MaxThreads];

View File

@@ -36,6 +36,9 @@
namespace gem5
{
namespace branch_prediction
{
LocalBP::LocalBP(const LocalBPParams &params)
: BPredUnit(params),
localPredictorSize(params.localPredictorSize),
@@ -137,4 +140,5 @@ LocalBP::uncondBranch(ThreadID tid, Addr pc, void *&bp_history)
{
}
} // namespace branch_prediction
} // namespace gem5

View File

@@ -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__

View File

@@ -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

View File

@@ -38,6 +38,9 @@
namespace gem5
{
namespace branch_prediction
{
BiModeBP::BiModeBP(const BiModeBPParams &params)
: BPredUnit(params),
globalHistoryReg(params.numThreads, 0),
@@ -229,4 +232,5 @@ BiModeBP::updateGlobalHistReg(ThreadID tid, bool taken)
globalHistoryReg[tid] &= historyRegisterMask;
}
} // namespace branch_prediction
} // namespace gem5

View File

@@ -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__

View File

@@ -53,6 +53,9 @@
namespace gem5
{
namespace branch_prediction
{
BPredUnit::BPredUnit(const Params &params)
: SimObject(params),
numThreads(params.numThreads),
@@ -521,4 +524,5 @@ BPredUnit::dump()
}
}
} // namespace branch_prediction
} // namespace gem5

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -47,6 +47,9 @@
namespace gem5
{
namespace branch_prediction
{
LTAGE::LTAGE(const LTAGEParams &params)
: 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

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -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

View File

@@ -51,6 +51,9 @@
namespace gem5
{
namespace branch_prediction
{
class MPP_TAGE : public TAGEBase
{
std::vector<unsigned int> tunedHistoryLengths;
@@ -242,6 +245,7 @@ class MultiperspectivePerceptronTAGE : public MultiperspectivePerceptron
};
} // namespace branch_prediction
} // namespace gem5
#endif//__CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_HH__

View File

@@ -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

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -34,6 +34,9 @@
namespace gem5
{
namespace branch_prediction
{
SimpleIndirectPredictor::SimpleIndirectPredictor(
const SimpleIndirectPredictorParams &params)
: IndirectPredictor(params),
@@ -237,4 +240,5 @@ SimpleIndirectPredictor::getTag(Addr br_addr)
return (br_addr >> instShift) & ((0x1<<tagBits)-1);
}
} // namespace branch_prediction
} // namespace gem5

View File

@@ -39,6 +39,9 @@
namespace gem5
{
namespace branch_prediction
{
class SimpleIndirectPredictor : public IndirectPredictor
{
public:
@@ -102,6 +105,7 @@ class SimpleIndirectPredictor : public IndirectPredictor
std::vector<ThreadInfo> threadInfo;
};
} // namespace branch_prediction
} // namespace gem5
#endif // __CPU_PRED_INDIRECT_HH__

View File

@@ -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

View File

@@ -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__

View File

@@ -47,6 +47,9 @@
namespace gem5
{
namespace branch_prediction
{
TAGE::TAGE(const TAGEParams &params) : 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

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -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

View File

@@ -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__

View File

@@ -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 &params)
{
}
} // namespace branch_prediction
} // namespace gem5

View File

@@ -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 &params);
};
} // namespace branch_prediction
} // namespace gem5
#endif // __CPU_PRED_TAGE_SC_L_64KB_HH__

View File

@@ -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

View File

@@ -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 &params);
};
} // namespace branch_prediction
} // namespace gem5
#endif // __CPU_PRED_TAGE_SC_L_8KB_HH__

View File

@@ -46,6 +46,9 @@
namespace gem5
{
namespace branch_prediction
{
TournamentBP::TournamentBP(const TournamentBPParams &params)
: BPredUnit(params),
localPredictorSize(params.localPredictorSize),
@@ -351,4 +354,5 @@ int
TournamentBP::BPHistory::newCount = 0;
#endif
} // namespace branch_prediction
} // namespace gem5

View File

@@ -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__

View File

@@ -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;