Go to the documentation of this file.
45 #include "debug/TageSCL.hh"
50 namespace branch_prediction
54 const TAGE_SC_L_8KB_StatisticalCorrectorParams &
p)
67 sh->setNumOrdinalHistories(1);
76 return (
bi->predBeforeSC + (((hitBank+1)/4)<<4) + (
bi->highConf<<1) +
77 (
bi->lowConf <<2) +((altBank!=0)<<3)) & ((1<<
logBias) -1);
93 branch_pc,
sh->getLocalHistory(1, branch_pc),
lm,
122 sh->globalHist = (
sh->globalHist << 1) + taken;
158 DPRINTF(TageSCL,
"HistLength:%d, TTSize:%d, TTTWidth:%d\n",
173 int tag = (
threadHistory[tid].computeIndices[bank - 1].comp << 2) ^
pc ^
179 tag = (tag >> 1) ^ ((tag & 1) << 10) ^
198 int numAllocated = 0;
199 bool maxAllocReached =
false;
203 for (
int j = 0;
j < 2; ++
j) {
204 int i = ((
j == 0) ? I : (I ^ 1)) + 1;
218 maxAllocReached =
true;
225 (abs (2 * ctr + 1) == 1)) {
238 if (maxAllocReached) {
243 tCounter += (truePen + penalty - 5 * numAllocated);
261 if (
bi->hitBank > 0) {
262 if (abs (2 *
gtable[
bi->hitBank][
bi->hitBankIndex].
ctr + 1) == 1) {
263 if (
bi->longestMatchPred != taken) {
264 if (
bi->altBank > 0) {
266 if (abs (2 * ctr + 1) == 1) {
274 if (abs (2 * ctr + 1) == 1) {
278 if (
bi->altBank == 0) {
285 if (abs (2 *
gtable[
bi->hitBank][
bi->hitBankIndex].
ctr + 1) == 1) {
293 if (abs (2 *
gtable[
bi->hitBank][
bi->hitBankIndex].
ctr + 1) == 1) {
297 if (
bi->altTaken == taken) {
298 if (
bi->altBank > 0) {
300 if (abs (2*ctr + 1) == 7) {
301 if (
gtable[
bi->hitBank][
bi->hitBankIndex].
u == 1) {
302 if (
bi->longestMatchPred == taken) {
313 if ((
bi->longestMatchPred !=
bi->altTaken) &&
314 (
bi->longestMatchPred == taken) &&
SCThreadHistory * scHistory
int calcDep(TAGEBase::BranchInfo *bi)
virtual void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget)
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)
const unsigned tagTableUBits
std::vector< ThreadHistory > threadHistory
void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget) override
FoldedHistory * computeIndices
int gIndexLogsSubstr(int nbr, int i) override
void init(int original_length, int compressed_length)
unsigned getIndBiasBank(Addr branch_pc, BranchInfo *bi, int hitBank, int altBank) const override
std::vector< int8_t > * igehl
std::vector< int8_t > * bwgehl
void initFoldedHistories(ThreadHistory &history) override
Initialization of the folded histories.
static void ctrUpdate(T &ctr, bool taken, int nbits)
Updates a direction counter based on the actual branch outcome.
void initGEHLTable(unsigned numLenghts, std::vector< int > lengths, std::vector< int8_t > *&table, unsigned logNumEntries, std::vector< int8_t > &w, int8_t wInitValue)
std::vector< bool > noSkip
const unsigned tagTableCounterBits
std::enable_if_t< std::is_integral_v< T >, T > random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
void resetUctr(uint8_t &u) override
Algorithm for resetting a single U counter.
void baseUpdate(Addr pc, bool taken, BranchInfo *bi)
Updates the bimodal predictor.
std::vector< unsigned > tagTableTagWidths
TAGE_SC_L_8KB_StatisticalCorrector(const TAGE_SC_L_8KB_StatisticalCorrectorParams &p)
void handleAllocAndUReset(bool alloc, bool taken, TAGEBase::BranchInfo *bi, int nrand) override
Handles Allocation and U bits reset on an update.
std::vector< int8_t > * ggehl
const unsigned pathHistBits
std::vector< int > pUpdateThreshold
const unsigned nHistoryTables
const unsigned numEntriesFirstLocalHistories
TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams ¶ms)
FoldedHistory * computeTags[2]
bool isDirectCtrl() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::vector< int8_t > * lgehl
int gindex_ext(int index, int bank) const override
std::vector< int > logTagTableSizes
void handleUReset() override
Handles the U bits reset.
int gPredictions(ThreadID tid, Addr branch_pc, BranchInfo *bi, int &lsum, int64_t phist) override
std::vector< int8_t > wbw
int F(int phist, int size, int bank) const override
Utility function to shuffle the path history depending on which tagged table we are accessing.
const unsigned instShiftAmt
bool isUncondCtrl() const
void handleTAGEUpdate(Addr branch_pc, bool taken, TAGEBase::BranchInfo *bi) override
Handles the update of the TAGE entries.
virtual unsigned getIndUpd(Addr branch_pc) const
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo *bi, int64_t phist) override
uint16_t gtag(ThreadID tid, Addr pc, int bank) const override
Computes the partial tag of a tagged table.
SCThreadHistory * makeThreadHistory() override
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)
int16_t ThreadID
Thread index/ID type.
Generated on Sun Jul 30 2023 01:56:53 for gem5 by doxygen 1.8.17