Go to the documentation of this file.
34 #ifndef __CPU_PRED_LOOP_PREDICTOR_HH__
35 #define __CPU_PRED_LOOP_PREDICTOR_HH__
44 struct LoopPredictorParams;
46 namespace branch_prediction
108 assert(nbits <=
sizeof(uint8_t) << 3);
110 if (ctr < ((1 << nbits) - 1))
120 if (ctr < ((1 << (nbits - 1)) - 1))
123 if (ctr > -(1 << (nbits - 1)))
156 int lindex(
Addr pc_in,
unsigned instShiftAmt)
const;
180 unsigned instShiftAmt)
const;
211 bool tage_pred, BranchInfo*
bi,
unsigned instShiftAmt);
228 BranchInfo*
bi,
bool prev_pred_taken,
unsigned instShiftAmt);
260 void init()
override;
270 #endif//__CPU_PRED_LOOP_PREDICTOR_HH__
This is a simple scalar statistic, like a counter.
int lindex(Addr pc_in, unsigned instShiftAmt) const
Computes the index used to access the loop predictor.
void squashLoop(BranchInfo *bi)
const unsigned logLoopTableAssoc
void init() override
Initialize the loop predictor.
const unsigned initialLoopIter
void squash(ThreadID tid, BranchInfo *bi)
bool loopPredict(ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo *bi, bool prev_pred_taken, unsigned instShiftAmt)
Get the loop prediction.
size_t getSizeInBits() const
void specLoopUpdate(bool taken, BranchInfo *bi)
Speculatively updates the loop predictor iteration count (only for useSpeculation).
const unsigned logSizeLoopPred
const bool optionalAgeReset
const uint16_t loopNumIterMask
static void signedCtrUpdate(int8_t &ctr, bool up, unsigned nbits)
const bool useDirectionBit
virtual bool optionalAgeInc() const
const unsigned loopTableTagBits
static void unsignedCtrUpdate(uint8_t &ctr, bool up, unsigned nbits)
Updates an unsigned counter based on up/down parameter.
const unsigned loopTableConfidenceBits
const uint16_t loopTagMask
void condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken, bool tage_pred, BranchInfo *bi, unsigned instShiftAmt)
Update LTAGE for conditional branches.
Abstract superclass for simulation objects.
LoopPredictorStats(statistics::Group *parent)
void loopUpdate(Addr pc, bool Taken, BranchInfo *bi, bool tage_pred)
Updates the loop predictor.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const unsigned initialLoopAge
int finallindex(int lindex, int lowPcBits, int way) const
Computes the index used to access the ltable structures.
int8_t getLoopUseCounter() const
Gets the value of the loop use counter.
void updateStats(bool taken, BranchInfo *bi)
Update the stats.
bool getLoop(Addr pc, BranchInfo *bi, bool speculative, unsigned instShiftAmt) const
Get a branch prediction from the loop predictor.
const bool useSpeculation
const uint8_t confidenceThreshold
virtual bool calcConf(int index) const
const unsigned loopTableAgeBits
const unsigned loopTableIterBits
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
statistics::Scalar correct
LoopPredictor(const LoopPredictorParams &p)
const bool restrictAllocation
virtual BranchInfo * makeBranchInfo()
int16_t ThreadID
Thread index/ID type.
gem5::branch_prediction::LoopPredictor::LoopPredictorStats stats
Generated on Sun Jul 30 2023 01:56:53 for gem5 by doxygen 1.8.17