Go to the documentation of this file.
48 #ifndef __CPU_PRED_TAGE_BASE
49 #define __CPU_PRED_TAGE_BASE
55 #include "params/TAGEBase.hh"
92 void init(
int original_length,
int compressed_length)
96 outpoint = original_length % compressed_length;
204 virtual int F(
int phist,
int size,
int bank)
const;
223 static void ctrUpdate(T & ctr,
bool taken,
int nbits);
260 void updateGHist(uint8_t * &h,
bool dir, uint8_t * tab,
int &PT);
322 int nrand,
Addr corrTarget,
bool pred,
bool preAdjustAlloc =
false);
372 virtual void adjustAlloc(
bool & alloc,
bool taken,
bool pred_taken);
378 bool alloc,
bool taken, BranchInfo*
bi,
int nrand);
389 Addr branch_pc,
bool taken, BranchInfo*
bi);
409 int8_t
getCtr(
int hitBank,
int hitBankIndex)
const;
504 #endif // __CPU_PRED_TAGE_BASE
std::vector< unsigned > tagTableTagWidths
unsigned getGHR(ThreadID tid, BranchInfo *bi) const
Stats::Vector longestMatchProvider
virtual BranchInfo * makeBranchInfo()
virtual void initFoldedHistories(ThreadHistory &history)
Initialization of the folded histories.
Stats::Scalar bimodalProviderCorrect
const unsigned nHistoryTables
unsigned getTageCtrBits() const
int16_t ThreadID
Thread index/ID type.
FoldedHistory * computeTags[2]
@ LAST_TAGE_PROVIDER_TYPE
virtual void handleTAGEUpdate(Addr branch_pc, bool taken, BranchInfo *bi)
Handles the update of the TAGE entries.
A vector of scalar stats.
std::vector< bool > noSkip
virtual bool getBimodePred(Addr pc, BranchInfo *bi) const
Get a branch prediction from the bimodal predictor.
int8_t getCtr(int hitBank, int hitBankIndex) const
virtual int gindex(ThreadID tid, Addr pc, int bank) const
Computes the index used to access a partially tagged table.
This is a simple scalar statistic, like a counter.
std::vector< ThreadHistory > threadHistory
std::vector< bool > btableHysteresis
virtual void condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *bi, int nrand, Addr corrTarget, bool pred, bool preAdjustAlloc=false)
Update TAGE for conditional branches.
static void unsignedCtrUpdate(uint8_t &ctr, bool up, unsigned nbits)
Updates an unsigned counter based on up/down parameter.
virtual uint16_t gtag(ThreadID tid, Addr pc, int bank) const
Computes the partial tag of a tagged table.
std::vector< bool > btablePrediction
virtual void handleAllocAndUReset(bool alloc, bool taken, BranchInfo *bi, int nrand)
Handles Allocation and U bits reset on an update.
const unsigned pathHistBits
virtual void calculateIndicesAndTags(ThreadID tid, Addr branch_pc, BranchInfo *bi)
On a prediction, calculates the TAGE indices and tags for all the different history lengths.
Stats::Scalar bimodalAltMatchProviderWrong
virtual int F(int phist, int size, int bank) const
Utility function to shuffle the path history depending on which tagged table we are accessing.
virtual void extraAltCalc(BranchInfo *bi)
Extra steps for calculating altTaken For this base TAGE class it does nothing.
BranchInfo(const TAGEBase &tage)
void baseUpdate(Addr pc, bool taken, BranchInfo *bi)
Updates the bimodal predictor.
virtual bool isHighConfidence(BranchInfo *bi) const
virtual void resetUctr(uint8_t &u)
Algorithm for resetting a single U counter.
virtual void updateHistories(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *b, bool speculative, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr, Addr target=MaxAddr)
(Speculatively) updates global histories (path and direction).
Stats::Scalar bimodalAltMatchProviderCorrect
TAGEBase(const TAGEBaseParams *p)
virtual void handleUReset()
Handles the U bits reset.
std::vector< int > logTagTableSizes
const unsigned tagTableCounterBits
std::vector< int8_t > useAltPredForNewlyAllocated
virtual void updateStats(bool taken, BranchInfo *bi)
Update the stats.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual void squash(ThreadID tid, bool taken, BranchInfo *bi, Addr target)
Restores speculatively updated path and direction histories.
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
size_t getSizeInBits() const
const unsigned logRatioBiModalHystEntries
static void ctrUpdate(T &ctr, bool taken, int nbits)
Updates a direction counter based on the actual branch outcome.
void update(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *bi)
Update TAGE.
Stats::Scalar longestMatchProviderWrong
const int64_t initialTCounterValue
bool isSpeculativeUpdateEnabled() const
const unsigned histBufferSize
TAGEBaseStats(Stats::Group *parent, unsigned nHistoryTables)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Stats::Scalar longestMatchProviderCorrect
Stats::Scalar longestMatchProviderWouldHaveHit
void init(int original_length, int compressed_length)
const unsigned instShiftAmt
void btbUpdate(ThreadID tid, Addr branch_addr, BranchInfo *&bi)
virtual unsigned getUseAltIdx(BranchInfo *bi, Addr branch_pc)
Calculation of the index for useAltPredForNewlyAllocated On this base TAGE implementation it is alway...
Stats::Scalar bimodalProviderWrong
TAGEBase::TAGEBaseStats stats
bool tagePredict(ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo *bi)
TAGE prediction called from TAGE::predict.
Stats::Scalar altMatchProviderWrong
const unsigned tagTableUBits
virtual void adjustAlloc(bool &alloc, bool taken, bool pred_taken)
Extra calculation to tell whether TAGE allocaitons may happen or not on an update For this base TAGE ...
virtual void calculateParameters()
Calculates the history lengths and some other paramters in derived classes.
Stats::Vector altMatchProvider
Stats::Scalar altMatchProviderCorrect
FoldedHistory * computeIndices
#define ULL(N)
uint64_t constant
Stats::Scalar altMatchProviderWouldHaveHit
virtual void buildTageTables()
Instantiates the TAGE table entries.
void updateGHist(uint8_t *&h, bool dir, uint8_t *tab, int &PT)
(Speculatively) updates the global branch history.
int getPathHist(ThreadID tid) const
const bool speculativeHistUpdate
Abstract superclass for simulation objects.
virtual int bindex(Addr pc_in) const
Computes the index used to access the bimodal table.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17