Go to the documentation of this file.
34 #ifndef __CPU_PRED_LOOP_PREDICTOR_HH__
35 #define __CPU_PRED_LOOP_PREDICTOR_HH__
41 struct LoopPredictorParams;
101 assert(nbits <=
sizeof(uint8_t) << 3);
103 if (ctr < ((1 << nbits) - 1))
113 if (ctr < ((1 << (nbits - 1)) - 1))
116 if (ctr > -(1 << (nbits - 1)))
149 int lindex(
Addr pc_in,
unsigned instShiftAmt)
const;
173 unsigned instShiftAmt)
const;
204 bool tage_pred, BranchInfo*
bi,
unsigned instShiftAmt);
221 BranchInfo*
bi,
bool prev_pred_taken,
unsigned instShiftAmt);
253 void init()
override;
259 #endif//__CPU_PRED_LOOP_PREDICTOR_HH__
const unsigned loopTableConfidenceBits
static void unsignedCtrUpdate(uint8_t &ctr, bool up, unsigned nbits)
Updates an unsigned counter based on up/down parameter.
void updateStats(bool taken, BranchInfo *bi)
Update the stats.
int16_t ThreadID
Thread index/ID type.
LoopPredictor::LoopPredictorStats stats
void squash(ThreadID tid, BranchInfo *bi)
int finallindex(int lindex, int lowPcBits, int way) const
Computes the index used to access the ltable structures.
const uint8_t confidenceThreshold
void specLoopUpdate(bool taken, BranchInfo *bi)
Speculatively updates the loop predictor iteration count (only for useSpeculation).
void loopUpdate(Addr pc, bool Taken, BranchInfo *bi, bool tage_pred)
Updates the loop predictor.
const unsigned initialLoopAge
virtual bool optionalAgeInc() const
const bool optionalAgeReset
virtual bool calcConf(int index) const
This is a simple scalar statistic, like a counter.
virtual BranchInfo * makeBranchInfo()
const bool useSpeculation
LoopPredictor(LoopPredictorParams *p)
void init() override
Initialize the loop predictor.
const uint16_t loopTagMask
LoopPredictorStats(Stats::Group *parent)
const unsigned logSizeLoopPred
void squashLoop(BranchInfo *bi)
const unsigned initialLoopIter
const unsigned loopTableIterBits
bool getLoop(Addr pc, BranchInfo *bi, bool speculative, unsigned instShiftAmt) const
Get a branch prediction from the loop predictor.
static void signedCtrUpdate(int8_t &ctr, bool up, unsigned nbits)
bool loopPredict(ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo *bi, bool prev_pred_taken, unsigned instShiftAmt)
Get the loop prediction.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const unsigned loopTableTagBits
const bool restrictAllocation
const unsigned loopTableAgeBits
size_t getSizeInBits() const
void condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken, bool tage_pred, BranchInfo *bi, unsigned instShiftAmt)
Update LTAGE for conditional branches.
int8_t getLoopUseCounter() const
Gets the value of the loop use counter.
int lindex(Addr pc_in, unsigned instShiftAmt) const
Computes the index used to access the loop predictor.
const unsigned logLoopTableAssoc
const uint16_t loopNumIterMask
const bool useDirectionBit
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17