Go to the documentation of this file.
42 #ifndef __CPU_PRED_STATISTICAL_CORRECTOR_HH
43 #define __CPU_PRED_STATISTICAL_CORRECTOR_HH
50 struct StatisticalCorrectorParams;
56 inline void ctrUpdate(T & ctr,
bool taken,
int nbits) {
57 assert(nbits <=
sizeof(T) << 3);
60 if (ctr < ((1 << (nbits - 1)) - 1))
63 if (ctr > -(1 << (nbits - 1)))
97 unsigned idx = ordinal - 1;
102 int ordinal,
Addr branch_pc,
bool taken,
Addr extraXor = 0)
105 unsigned idx = ordinal - 1;
107 unsigned entry =
getEntry(branch_pc, idx);
111 hist = hist ^ extraXor;
222 bool prev_pred_taken,
bool bias_bit,
bool use_conf_ctr,
223 int8_t conf_ctr,
unsigned conf_bits,
int hitBank,
int altBank,
224 int64_t phist,
int init_lsum = 0);
231 int hitBank,
int altBank)
const = 0;
237 int & lsum, int64_t phist) = 0;
239 int64_t
gIndex(
Addr branch_pc, int64_t bhist,
int logs,
int nbr,
int i);
265 void init()
override;
270 int hitBank,
int altBank, int64_t phist);
274 #endif//__CPU_PRED_STATISTICAL_CORRECTOR_HH
const unsigned updateThresholdWidth
virtual void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo *bi, int64_t phist)=0
void setNumOrdinalHistories(unsigned num)
const unsigned logSizeUps
virtual unsigned getIndBiasBank(Addr branch_pc, BranchInfo *bi, int hitBank, int altBank) const =0
int64_t gIndex(Addr branch_pc, int64_t bhist, int logs, int nbr, int i)
virtual size_t getSizeInBits() const
virtual SCThreadHistory * makeThreadHistory()
virtual int gPredictions(ThreadID tid, Addr branch_pc, BranchInfo *bi, int &lsum, int64_t phist)=0
unsigned getIndUpds(Addr branch_pc) const
int16_t ThreadID
Thread index/ID type.
const unsigned chooserConfWidth
std::vector< int8_t > bias
StatisticalCorrector(const StatisticalCorrectorParams *p)
std::vector< int8_t > * lgehl
std::vector< int64_t > * localHistories
const unsigned scCountersWidth
virtual unsigned getIndBias(Addr branch_pc, BranchInfo *bi, bool b) const
std::vector< int > pUpdateThreshold
void initLocalHistory(int ordinal, int numHistories, int shift)
const unsigned numEntriesFirstLocalHistories
unsigned numOrdinalHistories
virtual unsigned getIndUpd(Addr branch_pc) const
std::vector< int > shifts
unsigned getEntry(Addr pc, unsigned idx)
This is a simple scalar statistic, like a counter.
std::vector< int8_t > * bwgehl
virtual BranchInfo * makeBranchInfo()
void updateLocalHistory(int ordinal, Addr branch_pc, bool taken, Addr extraXor=0)
std::vector< int8_t > biasBank
StatisticalCorrectorStats(Stats::Group *parent)
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 updateStats(bool taken, BranchInfo *bi)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
StatisticalCorrector::StatisticalCorrectorStats stats
virtual int gIndexLogsSubstr(int nbr, int i)=0
SCThreadHistory * scHistory
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual bool scPredict(ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo *bi, bool prev_pred_taken, bool bias_bit, bool use_conf_ctr, int8_t conf_ctr, unsigned conf_bits, int hitBank, int altBank, int64_t phist, int init_lsum=0)
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)
std::vector< int8_t > biasSK
virtual unsigned getIndBiasSK(Addr branch_pc, BranchInfo *bi) const
void ctrUpdate(T &ctr, bool taken, int nbits)
std::vector< int8_t > * igehl
virtual void condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *bi, Addr corrTarget, bool bias_bit, int hitBank, int altBank, int64_t phist)
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)
int64_t getLocalHistory(int ordinal, Addr pc)
const unsigned pUpdateThresholdWidth
const unsigned extraWeightsWidth
bool isPowerOf2(const T &n)
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17