Go to the documentation of this file.
45 const TAGE_SC_L_64KB_StatisticalCorrectorParams &
p)
47 numEntriesSecondLocalHistories(
p.numEntriesSecondLocalHistories),
48 numEntriesThirdLocalHistories(
p.numEntriesThirdLocalHistories),
74 sh->setNumOrdinalHistories(3);
79 sh->imHist.resize(1 <<
im[0]);
87 return (
bi->predBeforeSC + (((hitBank+1)/4)<<4) + (
bi->highConf<<1) +
88 (
bi->lowConf <<2) + ((altBank!=0)<<3) +
89 ((branch_pc^(branch_pc>>2))<<7)) & ((1<<
logBias) -1);
100 (branch_pc << 1) +
bi->predBeforeSC,
sh->bwHist,
bwm,
107 branch_pc,
sh->getLocalHistory(1, branch_pc),
lm,
111 branch_pc,
sh->getLocalHistory(2, branch_pc),
sm,
115 branch_pc,
sh->getLocalHistory(3, branch_pc),
tm,
137 return (
i >= (nbr - 2)) ? 1 : 0;
153 int64_t imliCount =
sh->imliCount;
154 sh->imHist[imliCount] = (
sh->imHist[imliCount] << 1)
156 sh->updateLocalHistory(2, branch_pc, taken, branch_pc & 15);
157 sh->updateLocalHistory(3, branch_pc, taken);
218 int numAllocated = 0;
219 bool maxAllocReached =
false;
223 for (
int j = 0;
j < 2; ++
j) {
224 int i = ((
j == 0) ? I : (I ^ 1)) + 1;
228 if (abs (2 * ctr + 1) <= 3) {
247 if (maxAllocReached) {
252 tCounter += (penalty - 2 * numAllocated);
261 if (
bi->hitBank > 0) {
262 if (abs (2 *
gtable[
bi->hitBank][
bi->hitBankIndex].
ctr + 1) == 1) {
263 if (
bi->longestMatchPred != taken) {
265 if (
bi->altBank > 0) {
269 if (
bi->altBank == 0){
279 if (abs (2 *
gtable[
bi->hitBank][
bi->hitBankIndex].
ctr + 1) == 1) {
283 if (
bi->altTaken == taken) {
284 if (
bi->altBank > 0) {
286 if (abs (2 * ctr + 1) == 7) {
287 if (
gtable[
bi->hitBank][
bi->hitBankIndex].
u == 1) {
288 if (
bi->longestMatchPred == taken) {
299 if ((
bi->longestMatchPred !=
bi->altTaken) &&
300 (
bi->longestMatchPred == taken) &&
void handleTAGEUpdate(Addr branch_pc, bool taken, TAGEBase::BranchInfo *bi) override
Handles the update of the TAGE entries.
std::vector< unsigned > tagTableTagWidths
TAGE_SC_L_64KB_StatisticalCorrector(const TAGE_SC_L_64KB_StatisticalCorrectorParams &p)
bool isDirectCtrl() const
std::vector< int8_t > * pgehl
const unsigned nHistoryTables
unsigned getIndUpds(Addr branch_pc) const
std::vector< int8_t > * sgehl
int16_t ThreadID
Thread index/ID type.
SCThreadHistory * makeThreadHistory() override
int calcDep(TAGEBase::BranchInfo *bi)
int gPredictions(ThreadID tid, Addr branch_pc, BranchInfo *bi, int &lsum, int64_t phist) override
uint16_t gtag(ThreadID tid, Addr pc, int bank) const override
Computes the partial tag of a tagged table.
std::vector< int8_t > * lgehl
unsigned getIndBiasBank(Addr branch_pc, BranchInfo *bi, int hitBank, int altBank) const override
std::vector< int > pUpdateThreshold
std::vector< bool > noSkip
const unsigned numEntriesFirstLocalHistories
virtual unsigned getIndUpd(Addr branch_pc) const
int gIndexLogsSubstr(int nbr, int i) override
std::vector< int8_t > * bwgehl
std::vector< ThreadHistory > threadHistory
TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams ¶ms)
std::vector< int8_t > * tgehl
void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo *bi, int64_t phist) override
virtual void gUpdate(Addr branch_pc, bool taken, int64_t hist, std::vector< int > &length, std::vector< int8_t > *tab, int nbr, int logs, std::vector< int8_t > &w, BranchInfo *bi)
std::vector< int8_t > wbw
void handleUReset() override
Handles the U bits reset.
void baseUpdate(Addr pc, bool taken, BranchInfo *bi)
Updates the bimodal predictor.
const unsigned tagTableCounterBits
int gindex_ext(int index, int bank) const override
SCThreadHistory * scHistory
std::vector< int8_t > * imgehl
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const unsigned numEntriesSecondLocalHistories
virtual void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget)
void initGEHLTable(unsigned numLenghts, std::vector< int > lengths, std::vector< int8_t > *&table, unsigned logNumEntries, std::vector< int8_t > &w, int8_t wInitValue)
static void ctrUpdate(T &ctr, bool taken, int nbits)
Updates a direction counter based on the actual branch outcome.
const unsigned numEntriesThirdLocalHistories
std::vector< int8_t > wim
std::vector< int8_t > * igehl
void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget) override
void handleAllocAndUReset(bool alloc, bool taken, TAGEBase::BranchInfo *bi, int nrand) override
Handles Allocation and U bits reset on an update.
int gPredict(Addr branch_pc, int64_t hist, std::vector< int > &length, std::vector< int8_t > *tab, int nbr, int logs, std::vector< int8_t > &w)
const unsigned tagTableUBits
#define ULL(N)
uint64_t constant
bool isUncondCtrl() const
Generated on Tue Jun 22 2021 15:28:26 for gem5 by doxygen 1.8.17