Go to the documentation of this file.
45 #include "debug/TageSCL.hh"
48 const 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;
152 DPRINTF(TageSCL,
"HistLength:%d, TTSize:%d, TTTWidth:%d\n",
167 int tag = (
threadHistory[tid].computeIndices[bank - 1].comp << 2) ^
pc ^
173 tag = (tag >> 1) ^ ((tag & 1) << 10) ^
192 int numAllocated = 0;
193 bool maxAllocReached =
false;
197 for (
int j = 0;
j < 2; ++
j) {
198 int i = ((
j == 0) ? I : (I ^ 1)) + 1;
212 maxAllocReached =
true;
219 (abs (2 * ctr + 1) == 1)) {
232 if (maxAllocReached) {
237 tCounter += (truePen + penalty - 5 * numAllocated);
255 if (
bi->hitBank > 0) {
256 if (abs (2 *
gtable[
bi->hitBank][
bi->hitBankIndex].
ctr + 1) == 1) {
257 if (
bi->longestMatchPred != taken) {
258 if (
bi->altBank > 0) {
260 if (abs (2 * ctr + 1) == 1) {
268 if (abs (2 * ctr + 1) == 1) {
272 if (
bi->altBank == 0) {
279 if (abs (2 *
gtable[
bi->hitBank][
bi->hitBankIndex].
ctr + 1) == 1) {
287 if (abs (2 *
gtable[
bi->hitBank][
bi->hitBankIndex].
ctr + 1) == 1) {
291 if (
bi->altTaken == taken) {
292 if (
bi->altBank > 0) {
294 if (abs (2*ctr + 1) == 7) {
295 if (
gtable[
bi->hitBank][
bi->hitBankIndex].
u == 1) {
296 if (
bi->longestMatchPred == taken) {
307 if ((
bi->longestMatchPred !=
bi->altTaken) &&
308 (
bi->longestMatchPred == taken) &&
std::vector< unsigned > tagTableTagWidths
bool isDirectCtrl() const
const unsigned nHistoryTables
int gindex_ext(int index, int bank) const override
int16_t ThreadID
Thread index/ID type.
TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams ¶ms)
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
TAGE_SC_L_8KB_StatisticalCorrector(const TAGE_SC_L_8KB_StatisticalCorrectorParams &p)
std::vector< bool > noSkip
const unsigned numEntriesFirstLocalHistories
std::vector< int8_t > * ggehl
virtual unsigned getIndUpd(Addr branch_pc) const
std::enable_if_t< std::is_integral< T >::value, T > random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
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.
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)
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 Tue Mar 23 2021 19:41:25 for gem5 by doxygen 1.8.17