45 #include "debug/TageSCL.hh" 48 TAGE_SC_L_8KB_StatisticalCorrectorParams *
p)
61 sh->setNumOrdinalHistories(1);
87 branch_pc, sh->getLocalHistory(1, branch_pc),
lm,
136 TAGE_SC_L_8KB_StatisticalCorrectorParams::create()
151 for (
int i = 1;
i <= nHistoryTables;
i++) {
153 histLengths[
i], 17 + (2 * ((i - 1) / 2) % 4));
158 DPRINTF(TageSCL,
"HistLength:%d, TTSize:%d, TTTWidth:%d\n",
159 histLengths[i], logTagTableSizes[i], tagTableTagWidths[i]);
166 return (index ^ (index >> logTagTableSizes[bank])
167 ^ (index >> 2 * logTagTableSizes[bank]));
173 int tag = (threadHistory[tid].computeIndices[bank - 1].comp << 2) ^ pc ^
175 threadHistory[tid].computeIndices[bank].comp;
176 int hlen = (histLengths[bank] > pathHistBits) ? pathHistBits :
179 tag = (tag >> 1) ^ ((tag & 1) << 10) ^
180 F(threadHistory[tid].pathHist, hlen, bank);
181 tag ^= threadHistory[tid].computeTags[0][bank].comp ^
182 (threadHistory[tid].computeTags[1][bank].comp << 1);
184 return ((tag ^ (tag >> tagTableTagWidths[bank]))
185 & ((
ULL(1) << tagTableTagWidths[bank]) - 1));
198 int numAllocated = 0;
199 bool maxAllocReached =
false;
201 for (
int I = calcDep(bi); I < nHistoryTables; I += 2) {
203 for (
int j = 0;
j < 2; ++
j) {
204 int i = ((
j == 0) ? I : (I ^ 1)) + 1;
205 if (i > nHistoryTables) {
217 if (numAllocated == maxNumAlloc) {
218 maxAllocReached =
true;
225 (abs (2 * ctr + 1) == 1)) {
238 if (maxAllocReached) {
243 tCounter += (truePen + penalty - 5 * numAllocated);
266 if (abs (2 * ctr + 1) == 1) {
272 tagTableCounterBits);
274 if (abs (2 * ctr + 1) == 1) {
279 baseUpdate(branch_pc, taken, bi);
290 tagTableCounterBits);
300 if (abs (2*ctr + 1) == 7) {
310 baseUpdate(branch_pc, taken, bi);
321 TAGE_SC_L_TAGE_8KBParams::create()
327 TAGE_SC_L_8KBParams::create()
void handleTAGEUpdate(Addr branch_pc, bool taken, TAGEBase::BranchInfo *bi) override
Handles the update of the TAGE entries.
uint16_t gtag(ThreadID tid, Addr pc, int bank) const override
Computes the partial tag of a tagged table.
void handleAllocAndUReset(bool alloc, bool taken, TAGEBase::BranchInfo *bi, int nrand) override
Handles Allocation and U bits reset on an update.
int gPredictions(ThreadID tid, Addr branch_pc, BranchInfo *bi, int &lsum, 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)
void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget) override
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< 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)
FoldedHistory * computeTags[2]
bool isDirectCtrl() const
bool isUncondCtrl() const
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...
TAGE_SC_L_8KB_StatisticalCorrector(TAGE_SC_L_8KB_StatisticalCorrectorParams *p)
virtual unsigned getIndUpd(Addr branch_pc) const
std::vector< int8_t > * ggehl
std::vector< int > pUpdateThreshold
SCThreadHistory * scHistory
int gIndexLogsSubstr(int nbr, int i) override
SCThreadHistory * makeThreadHistory() override
void resetUctr(uint8_t &u) override
Algorithm for resetting a single U counter.
const unsigned numEntriesFirstLocalHistories
unsigned getIndBiasBank(Addr branch_pc, BranchInfo *bi, int hitBank, int altBank) const override
std::vector< int8_t > * bwgehl
int gindex_ext(int index, int bank) const override
const Params * params() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo *bi, int64_t phist) override
#define ULL(N)
uint64_t constant
void init(int original_length, int compressed_length)
virtual void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget)
TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams *params)
int16_t ThreadID
Thread index/ID type.
const unsigned instShiftAmt
Number of bits to shift instructions by for predictor addresses.
void initFoldedHistories(ThreadHistory &history) override
Initialization of the folded histories.
std::vector< int8_t > * lgehl
FoldedHistory * computeIndices
std::vector< int8_t > wbw