Go to the documentation of this file.
45 #include "debug/TageSCL.hh"
48 TAGE_SC_L_8KB_StatisticalCorrectorParams *
p)
61 sh->setNumOrdinalHistories(1);
70 return (
bi->predBeforeSC + (((hitBank+1)/4)<<4) + (
bi->highConf<<1) +
71 (
bi->lowConf <<2) +((altBank!=0)<<3)) & ((1<<
logBias) -1);
87 branch_pc,
sh->getLocalHistory(1, branch_pc),
lm,
116 sh->globalHist = (
sh->globalHist << 1) + taken;
136 TAGE_SC_L_8KB_StatisticalCorrectorParams::create()
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) &&
321 TAGE_SC_L_TAGE_8KBParams::create()
327 TAGE_SC_L_8KBParams::create()
std::vector< unsigned > tagTableTagWidths
bool isDirectCtrl() const
const unsigned nHistoryTables
TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams *params)
int gindex_ext(int index, int bank) const override
int16_t ThreadID
Thread index/ID type.
int calcDep(TAGEBase::BranchInfo *bi)
FoldedHistory * computeTags[2]
void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget) override
std::vector< int8_t > * lgehl
std::vector< int > pUpdateThreshold
std::vector< bool > noSkip
const unsigned numEntriesFirstLocalHistories
std::vector< int8_t > * ggehl
virtual unsigned getIndUpd(Addr branch_pc) const
int gPredictions(ThreadID tid, Addr branch_pc, BranchInfo *bi, int &lsum, int64_t phist) override
std::vector< int8_t > * bwgehl
std::vector< ThreadHistory > threadHistory
void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo *bi, int64_t phist) override
void initFoldedHistories(ThreadHistory &history) override
Initialization of the folded histories.
const unsigned pathHistBits
uint16_t gtag(ThreadID tid, Addr pc, int bank) const override
Computes the partial tag of a tagged table.
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)
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 > 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.
void handleUReset() override
Handles the U bits reset.
TAGE_SC_L_8KB_StatisticalCorrector(TAGE_SC_L_8KB_StatisticalCorrectorParams *p)
void baseUpdate(Addr pc, bool taken, BranchInfo *bi)
Updates the bimodal predictor.
std::vector< int > logTagTableSizes
SCThreadHistory * makeThreadHistory() override
void handleTAGEUpdate(Addr branch_pc, bool taken, TAGEBase::BranchInfo *bi) override
Handles the update of the TAGE entries.
const unsigned tagTableCounterBits
SCThreadHistory * scHistory
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
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.
void init(int original_length, int compressed_length)
const unsigned instShiftAmt
std::vector< int8_t > * igehl
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)
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
int gIndexLogsSubstr(int nbr, int i) override
const unsigned tagTableUBits
FoldedHistory * computeIndices
void resetUctr(uint8_t &u) override
Algorithm for resetting a single U counter.
#define ULL(N)
uint64_t constant
unsigned getIndBiasBank(Addr branch_pc, BranchInfo *bi, int hitBank, int altBank) const override
bool isUncondCtrl() const
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17