gem5 v24.0.0.0
|
#include <tage_base.hh>
Classes | |
struct | BranchInfo |
struct | FoldedHistory |
struct | TAGEBaseStats |
struct | TageEntry |
struct | ThreadHistory |
Public Types | |
enum | { BIMODAL_ONLY = 0 , TAGE_LONGEST_MATCH , BIMODAL_ALT_MATCH , TAGE_ALT_MATCH , LAST_TAGE_PROVIDER_TYPE = TAGE_ALT_MATCH } |
Public Types inherited from gem5::SimObject | |
typedef SimObjectParams | Params |
Public Member Functions | |
TAGEBase (const TAGEBaseParams &p) | |
void | init () override |
init() is called after all C++ SimObjects have been created and all ports are connected. | |
virtual BranchInfo * | makeBranchInfo () |
virtual int | bindex (Addr pc_in) const |
Computes the index used to access the bimodal table. | |
virtual int | gindex (ThreadID tid, Addr pc, int bank) const |
Computes the index used to access a partially tagged table. | |
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 uint16_t | gtag (ThreadID tid, Addr pc, int bank) const |
Computes the partial tag of a tagged table. | |
virtual bool | getBimodePred (Addr pc, BranchInfo *bi) const |
Get a branch prediction from the bimodal predictor. | |
void | baseUpdate (Addr pc, bool taken, BranchInfo *bi) |
Updates the bimodal predictor. | |
void | updateGHist (uint8_t *&h, bool dir, uint8_t *tab, int &PT) |
(Speculatively) updates the global branch history. | |
void | update (ThreadID tid, Addr branch_pc, bool taken, BranchInfo *bi) |
Update TAGE. | |
virtual void | updateHistories (ThreadID tid, Addr branch_pc, bool taken, BranchInfo *b, bool speculative, const StaticInstPtr &inst=nullStaticInstPtr, Addr target=MaxAddr) |
(Speculatively) updates global histories (path and direction). | |
virtual void | squash (ThreadID tid, bool taken, BranchInfo *bi, Addr target) |
Restores speculatively updated path and direction histories. | |
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. | |
bool | tagePredict (ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo *bi) |
TAGE prediction called from TAGE::predict. | |
virtual void | updateStats (bool taken, BranchInfo *bi) |
Update the stats. | |
virtual void | buildTageTables () |
Instantiates the TAGE table entries. | |
virtual void | calculateParameters () |
Calculates the history lengths and some other paramters in derived classes. | |
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. | |
virtual unsigned | getUseAltIdx (BranchInfo *bi, Addr branch_pc) |
Calculation of the index for useAltPredForNewlyAllocated On this base TAGE implementation it is always 0. | |
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 implementation it does nothing. | |
virtual void | handleAllocAndUReset (bool alloc, bool taken, BranchInfo *bi, int nrand) |
Handles Allocation and U bits reset on an update. | |
virtual void | handleUReset () |
Handles the U bits reset. | |
virtual void | handleTAGEUpdate (Addr branch_pc, bool taken, BranchInfo *bi) |
Handles the update of the TAGE entries. | |
virtual void | resetUctr (uint8_t &u) |
Algorithm for resetting a single U counter. | |
virtual void | extraAltCalc (BranchInfo *bi) |
Extra steps for calculating altTaken For this base TAGE class it does nothing. | |
virtual bool | isHighConfidence (BranchInfo *bi) const |
void | btbUpdate (ThreadID tid, Addr branch_addr, BranchInfo *&bi) |
unsigned | getGHR (ThreadID tid, BranchInfo *bi) const |
int8_t | getCtr (int hitBank, int hitBankIndex) const |
unsigned | getTageCtrBits () const |
int | getPathHist (ThreadID tid) const |
bool | isSpeculativeUpdateEnabled () const |
size_t | getSizeInBits () const |
Public Member Functions inherited from gem5::SimObject | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. | |
virtual void | regProbePoints () |
Register probe points for this object. | |
virtual void | regProbeListeners () |
Register probe listeners for this object. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
virtual Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) |
Get a port with a given name and index. | |
virtual void | startup () |
startup() is the final initialization call before simulation. | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from gem5::Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
Public Member Functions inherited from gem5::statistics::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Static Public Member Functions | |
template<typename T > | |
static void | ctrUpdate (T &ctr, bool taken, int nbits) |
Updates a direction counter based on the actual branch outcome. | |
static void | unsignedCtrUpdate (uint8_t &ctr, bool up, unsigned nbits) |
Updates an unsigned counter based on up/down parameter. | |
Static Public Member Functions inherited from gem5::SimObject | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Protected Member Functions | |
virtual void | initFoldedHistories (ThreadHistory &history) |
Initialization of the folded histories. | |
Protected Member Functions inherited from gem5::Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. | |
void | signalDrainDone () const |
Signal that an object is drained. | |
Definition at line 65 of file tage_base.hh.
anonymous enum |
Enumerator | |
---|---|
BIMODAL_ONLY | |
TAGE_LONGEST_MATCH | |
BIMODAL_ALT_MATCH | |
TAGE_ALT_MATCH | |
LAST_TAGE_PROVIDER_TYPE |
Definition at line 118 of file tage_base.hh.
gem5::branch_prediction::TAGEBase::TAGEBase | ( | const TAGEBaseParams & | p | ) |
Definition at line 51 of file tage_base.cc.
References nHistoryTables, and noSkip.
|
virtual |
Extra calculation to tell whether TAGE allocaitons may happen or not on an update For this base TAGE implementation it does nothing.
Reimplemented in gem5::branch_prediction::MPP_TAGE, and gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 438 of file tage_base.cc.
Referenced by condBranchUpdate().
void gem5::branch_prediction::TAGEBase::baseUpdate | ( | Addr | pc, |
bool | taken, | ||
BranchInfo * | bi ) |
Updates the bimodal predictor.
pc | The unshifted branch PC. |
taken | The actual branch outcome. |
bi | Pointer to information on the prediction recorded at prediction time. |
Definition at line 302 of file tage_base.cc.
References gem5::PowerISA::bi, btableHysteresis, btablePrediction, DPRINTF, logRatioBiModalHystEntries, gem5::MipsISA::pc, and gem5::RiscvISA::pred.
Referenced by gem5::branch_prediction::MPP_TAGE::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(), and handleTAGEUpdate().
|
virtual |
Computes the index used to access the bimodal table.
pc_in | The unshifted branch PC. |
Reimplemented in gem5::branch_prediction::MPP_TAGE, and gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 207 of file tage_base.cc.
References instShiftAmt, and logTagTableSizes.
Referenced by tagePredict().
void gem5::branch_prediction::TAGEBase::btbUpdate | ( | ThreadID | tid, |
Addr | branch_addr, | ||
BranchInfo *& | bi ) |
Definition at line 188 of file tage_base.cc.
References gem5::PowerISA::bi, gem5::branch_prediction::TAGEBase::FoldedHistory::comp, gem5::branch_prediction::TAGEBase::ThreadHistory::computeIndices, gem5::branch_prediction::TAGEBase::ThreadHistory::computeTags, DPRINTF, gem5::branch_prediction::TAGEBase::ThreadHistory::gHist, gem5::branch_prediction::TAGEBase::ThreadHistory::globalHistory, gem5::ArmISA::i, nHistoryTables, gem5::branch_prediction::TAGEBase::ThreadHistory::ptGhist, speculativeHistUpdate, threadHistory, and gem5::branch_prediction::TAGEBase::FoldedHistory::update().
|
virtual |
Instantiates the TAGE table entries.
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 166 of file tage_base.cc.
References gtable, gem5::ArmISA::i, logTagTableSizes, and nHistoryTables.
Referenced by init().
|
virtual |
On a prediction, calculates the TAGE indices and tags for all the different history lengths.
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 340 of file tage_base.cc.
References gem5::PowerISA::bi, gindex(), gtag(), gem5::ArmISA::i, nHistoryTables, tableIndices, and tableTags.
Referenced by tagePredict().
|
virtual |
Calculates the history lengths and some other paramters in derived classes.
Reimplemented in gem5::branch_prediction::MPP_TAGE, and gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 174 of file tage_base.cc.
References histLengths, gem5::ArmISA::i, maxHist, minHist, and nHistoryTables.
Referenced by init().
|
virtual |
Update TAGE for conditional branches.
branch_pc | The unshifted branch PC. |
taken | Actual branch outcome. |
bi | Pointer to information on the prediction recorded at prediction time. @nrand Random int number from 0 to 3 |
corrTarget | The correct branch target |
pred | Final prediction for this branch |
preAdjustAlloc | call adjustAlloc before checking pseudo newly allocated entries |
Definition at line 514 of file tage_base.cc.
References adjustAlloc(), gem5::PowerISA::bi, ctrUpdate(), getUseAltIdx(), handleAllocAndUReset(), handleTAGEUpdate(), nHistoryTables, gem5::RiscvISA::pred, useAltOnNaBits, and useAltPredForNewlyAllocated.
Referenced by gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), gem5::branch_prediction::TAGE::update(), and gem5::branch_prediction::TAGE_SC_L::update().
|
static |
Updates a direction counter based on the actual branch outcome.
ctr | Reference to counter to update. |
taken | Actual branch outcome. |
nbits | Counter width. |
Definition at line 261 of file tage_base.cc.
Referenced by condBranchUpdate(), gem5::branch_prediction::MPP_TAGE::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(), and handleTAGEUpdate().
|
virtual |
Extra steps for calculating altTaken For this base TAGE class it does nothing.
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 655 of file tage_base.cc.
Referenced by tagePredict().
|
virtual |
Utility function to shuffle the path history depending on which tagged table we are accessing.
phist | The path history. |
size | Number of path history bits to use. |
bank | The partially tagged table to access. |
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 213 of file tage_base.cc.
References logTagTableSizes.
Referenced by gindex().
|
virtual |
Get a branch prediction from the bimodal predictor.
pc | The unshifted branch PC. |
bi | Pointer to information on the prediction. |
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 293 of file tage_base.cc.
References gem5::PowerISA::bi, and btablePrediction.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::getBimodePred(), and tagePredict().
int8_t gem5::branch_prediction::TAGEBase::getCtr | ( | int | hitBank, |
int | hitBankIndex ) const |
Definition at line 768 of file tage_base.cc.
References gem5::branch_prediction::TAGEBase::TageEntry::ctr, and gtable.
Referenced by gem5::branch_prediction::TAGE_SC_L::predict().
unsigned gem5::branch_prediction::TAGEBase::getGHR | ( | ThreadID | tid, |
BranchInfo * | bi ) const |
Definition at line 711 of file tage_base.cc.
References gem5::PowerISA::bi, histBufferSize, gem5::ArmISA::i, threadHistory, and gem5::X86ISA::val.
int gem5::branch_prediction::TAGEBase::getPathHist | ( | ThreadID | tid | ) | const |
Definition at line 780 of file tage_base.cc.
References threadHistory.
Referenced by gem5::branch_prediction::MultiperspectivePerceptronTAGE::lookup(), gem5::branch_prediction::TAGE_SC_L::predict(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), and gem5::branch_prediction::TAGE_SC_L::update().
size_t gem5::branch_prediction::TAGEBase::getSizeInBits | ( | ) | const |
Definition at line 792 of file tage_base.cc.
References gem5::bits(), histLengths, gem5::ArmISA::i, logRatioBiModalHystEntries, logTagTableSizes, logUResetPeriod, nHistoryTables, numUseAltOnNa, pathHistBits, tagTableCounterBits, tagTableTagWidths, tagTableUBits, and useAltOnNaBits.
Referenced by gem5::branch_prediction::MultiperspectivePerceptronTAGE::init().
unsigned gem5::branch_prediction::TAGEBase::getTageCtrBits | ( | ) | const |
Definition at line 774 of file tage_base.cc.
References tagTableCounterBits.
Referenced by gem5::branch_prediction::TAGE_SC_L::predict().
|
virtual |
Calculation of the index for useAltPredForNewlyAllocated On this base TAGE implementation it is always 0.
Reimplemented in gem5::branch_prediction::MPP_TAGE, and gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 353 of file tage_base.cc.
Referenced by condBranchUpdate(), and tagePredict().
Computes the index used to access a partially tagged table.
tid | The thread ID used to select the global histories to use. |
pc | The unshifted branch PC. |
bank | The partially tagged table to access. |
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 230 of file tage_base.cc.
References F(), histLengths, gem5::MipsISA::index, instShiftAmt, logTagTableSizes, pathHistBits, gem5::MipsISA::pc, and threadHistory.
Referenced by calculateIndicesAndTags().
Computes the partial tag of a tagged table.
tid | the thread ID used to select the global histories to use. |
pc | The unshifted branch PC. |
bank | The partially tagged table to access. |
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE, gem5::branch_prediction::TAGE_SC_L_TAGE_64KB, and gem5::branch_prediction::TAGE_SC_L_TAGE_8KB.
Definition at line 248 of file tage_base.cc.
References instShiftAmt, gem5::MipsISA::pc, tagTableTagWidths, and threadHistory.
Referenced by calculateIndicesAndTags().
|
virtual |
Handles Allocation and U bits reset on an update.
Reimplemented in gem5::branch_prediction::MPP_TAGE, gem5::branch_prediction::TAGE_SC_L_TAGE, gem5::branch_prediction::TAGE_SC_L_TAGE_64KB, and gem5::branch_prediction::TAGE_SC_L_TAGE_8KB.
Definition at line 444 of file tage_base.cc.
References gem5::PowerISA::bi, gem5::branch_prediction::TAGEBase::TageEntry::ctr, gtable, handleUReset(), gem5::ArmISA::i, maxNumAlloc, nHistoryTables, gem5::branch_prediction::TAGEBase::TageEntry::tag, tCounter, gem5::branch_prediction::TAGEBase::TageEntry::u, and gem5::X86ISA::X.
Referenced by condBranchUpdate().
|
virtual |
Handles the update of the TAGE entries.
Reimplemented in gem5::branch_prediction::MPP_TAGE, gem5::branch_prediction::TAGE_SC_L_TAGE, gem5::branch_prediction::TAGE_SC_L_TAGE_64KB, and gem5::branch_prediction::TAGE_SC_L_TAGE_8KB.
Definition at line 555 of file tage_base.cc.
References baseUpdate(), gem5::PowerISA::bi, gem5::branch_prediction::TAGEBase::TageEntry::ctr, ctrUpdate(), DPRINTF, gtable, tagTableCounterBits, tagTableUBits, gem5::branch_prediction::TAGEBase::TageEntry::u, and unsignedCtrUpdate().
Referenced by condBranchUpdate().
|
virtual |
Handles the U bits reset.
Reimplemented in gem5::branch_prediction::MPP_TAGE, and gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 493 of file tage_base.cc.
References gtable, gem5::ArmISA::i, logTagTableSizes, logUResetPeriod, nHistoryTables, resetUctr(), tCounter, and gem5::ArmISA::u.
Referenced by handleAllocAndUReset().
|
overridevirtual |
init() is called after all C++ SimObjects have been created and all ports are connected.
Initializations that are independent of unserialization but rely on a fully instantiated and connected SimObject graph should be done here.
Reimplemented from gem5::SimObject.
Definition at line 87 of file tage_base.cc.
References btableHysteresis, btablePrediction, buildTageTables(), calculateParameters(), gtable, histBufferSize, histLengths, initFoldedHistories(), initialized, initialTCounterValue, logRatioBiModalHystEntries, logTagTableSizes, logUResetPeriod, maxHist, nHistoryTables, numUseAltOnNa, pathHistBits, tableIndices, tableTags, tagTableTagWidths, tagTableUBits, tCounter, threadHistory, and useAltPredForNewlyAllocated.
Referenced by gem5::branch_prediction::MultiperspectivePerceptronTAGE::init().
|
protectedvirtual |
Initialization of the folded histories.
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE_8KB.
Definition at line 151 of file tage_base.cc.
References gem5::branch_prediction::TAGEBase::ThreadHistory::computeIndices, gem5::branch_prediction::TAGEBase::ThreadHistory::computeTags, DPRINTF, histLengths, gem5::ArmISA::i, gem5::branch_prediction::TAGEBase::FoldedHistory::init(), logTagTableSizes, nHistoryTables, gem5::branch_prediction::TAGEBase::FoldedHistory::origLength, and tagTableTagWidths.
Referenced by init().
|
inlinevirtual |
Reimplemented in gem5::branch_prediction::MPP_TAGE.
Definition at line 410 of file tage_base.hh.
Referenced by gem5::branch_prediction::MultiperspectivePerceptronTAGE::lookup().
bool gem5::branch_prediction::TAGEBase::isSpeculativeUpdateEnabled | ( | ) | const |
Definition at line 786 of file tage_base.cc.
References speculativeHistUpdate.
Referenced by gem5::branch_prediction::MultiperspectivePerceptronTAGE::MultiperspectivePerceptronTAGE(), gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), and gem5::branch_prediction::TAGE_SC_L::update().
|
virtual |
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 82 of file tage_base.cc.
|
virtual |
Algorithm for resetting a single U counter.
Reimplemented in gem5::branch_prediction::MPP_TAGE, and gem5::branch_prediction::TAGE_SC_L_TAGE_8KB.
Definition at line 508 of file tage_base.cc.
References gem5::ArmISA::u.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::handleUReset(), and handleUReset().
|
virtual |
Restores speculatively updated path and direction histories.
Also recomputes compressed (folded) histories based on the correct branch outcome. This version of squash() is called once on a branch misprediction.
tid | The Thread ID to select the histories to rollback. |
taken | The correct branch outcome. |
bp_history | Wrapping pointer to BranchInfo (to allow storing derived class prediction information in the base class). |
target | The correct branch target |
Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 629 of file tage_base.cc.
References gem5::PowerISA::bi, gem5::branch_prediction::TAGEBase::FoldedHistory::comp, gem5::branch_prediction::TAGEBase::ThreadHistory::computeIndices, gem5::branch_prediction::TAGEBase::ThreadHistory::computeTags, DPRINTF, gem5::branch_prediction::TAGEBase::ThreadHistory::gHist, gem5::branch_prediction::TAGEBase::ThreadHistory::globalHistory, gem5::ArmISA::i, nHistoryTables, gem5::branch_prediction::TAGEBase::ThreadHistory::pathHist, gem5::branch_prediction::TAGEBase::ThreadHistory::ptGhist, speculativeHistUpdate, threadHistory, and gem5::branch_prediction::TAGEBase::FoldedHistory::update().
Referenced by gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), gem5::branch_prediction::TAGE::update(), and gem5::branch_prediction::TAGE_SC_L::update().
bool gem5::branch_prediction::TAGEBase::tagePredict | ( | ThreadID | tid, |
Addr | branch_pc, | ||
bool | cond_branch, | ||
BranchInfo * | bi ) |
TAGE prediction called from TAGE::predict.
tid | The thread ID to select the global histories to use. |
branch_pc | The unshifted branch PC. |
cond_branch | True if the branch is conditional. |
bi | Pointer to the BranchInfo |
Definition at line 360 of file tage_base.cc.
References gem5::PowerISA::bi, BIMODAL_ALT_MATCH, BIMODAL_ONLY, bindex(), calculateIndicesAndTags(), gem5::branch_prediction::TAGEBase::TageEntry::ctr, DPRINTF, extraAltCalc(), getBimodePred(), getUseAltIdx(), gtable, gem5::ArmISA::i, nHistoryTables, noSkip, gem5::MipsISA::pc, tableIndices, tableTags, TAGE_ALT_MATCH, TAGE_LONGEST_MATCH, and useAltPredForNewlyAllocated.
Referenced by gem5::branch_prediction::MultiperspectivePerceptronTAGE::lookup(), gem5::branch_prediction::LTAGE::predict(), gem5::branch_prediction::TAGE::predict(), and gem5::branch_prediction::TAGE_SC_L::predict().
|
static |
Updates an unsigned counter based on up/down parameter.
ctr | Reference to counter to update. |
up | Boolean indicating if the counter is incremented/decremented If true it is incremented, if false it is decremented |
nbits | Counter width. |
Definition at line 279 of file tage_base.cc.
References gem5::ArmISA::up.
Referenced by handleTAGEUpdate().
void gem5::branch_prediction::TAGEBase::update | ( | ThreadID | tid, |
Addr | branch_pc, | ||
bool | taken, | ||
BranchInfo * | bi ) |
Update TAGE.
Called at execute to repair histories on a misprediction and at commit to update the tables.
tid | The thread ID to select the global histories to use. |
branch_pc | The unshifted branch PC. |
taken | Actual branch outcome. |
bi | Pointer to information on the prediction recorded at prediction time. |
void gem5::branch_prediction::TAGEBase::updateGHist | ( | uint8_t *& | h, |
bool | dir, | ||
uint8_t * | tab, | ||
int & | PT ) |
(Speculatively) updates the global branch history.
h | Reference to pointer to global branch history. |
dir | (Predicted) outcome to update the histories with. |
tab | |
PT | Reference to path history. |
Definition at line 322 of file tage_base.cc.
References DPRINTF, histBufferSize, gem5::ArmISA::i, maxHist, and gem5::pt.
Referenced by updateHistories(), gem5::branch_prediction::MPP_TAGE::updatePathAndGlobalHistory(), and gem5::branch_prediction::TAGE_SC_L_TAGE::updatePathAndGlobalHistory().
|
virtual |
(Speculatively) updates global histories (path and direction).
Also recomputes compressed (folded) histories based on the branch direction.
tid | The thread ID to select the histories to update. |
branch_pc | The unshifted branch PC. |
taken | (Predicted) branch direction. |
b | Wrapping pointer to BranchInfo (to allow storing derived class prediction information in the base class). |
Reimplemented in gem5::branch_prediction::MPP_TAGE, and gem5::branch_prediction::TAGE_SC_L_TAGE.
Definition at line 588 of file tage_base.cc.
References gem5::PowerISA::bi, gem5::branch_prediction::TAGEBase::FoldedHistory::comp, gem5::branch_prediction::TAGEBase::ThreadHistory::computeIndices, gem5::branch_prediction::TAGEBase::ThreadHistory::computeTags, DPRINTF, gem5::branch_prediction::TAGEBase::ThreadHistory::gHist, gem5::branch_prediction::TAGEBase::ThreadHistory::globalHistory, gem5::ArmISA::i, instShiftAmt, nHistoryTables, gem5::branch_prediction::TAGEBase::ThreadHistory::pathHist, pathHistBits, gem5::branch_prediction::TAGEBase::ThreadHistory::ptGhist, speculativeHistUpdate, threadHistory, gem5::branch_prediction::TAGEBase::FoldedHistory::update(), and updateGHist().
Referenced by gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), gem5::branch_prediction::TAGE::update(), gem5::branch_prediction::TAGE_SC_L::update(), and gem5::branch_prediction::TAGE::updateHistories().
|
virtual |
Update the stats.
taken | Actual branch outcome |
bi | Pointer to information on the prediction recorded at prediction time. |
Definition at line 662 of file tage_base.cc.
References gem5::branch_prediction::TAGEBase::TAGEBaseStats::altMatchProvider, gem5::branch_prediction::TAGEBase::TAGEBaseStats::altMatchProviderCorrect, gem5::branch_prediction::TAGEBase::TAGEBaseStats::altMatchProviderWouldHaveHit, gem5::branch_prediction::TAGEBase::TAGEBaseStats::altMatchProviderWrong, gem5::PowerISA::bi, BIMODAL_ALT_MATCH, BIMODAL_ONLY, gem5::branch_prediction::TAGEBase::TAGEBaseStats::bimodalAltMatchProviderCorrect, gem5::branch_prediction::TAGEBase::TAGEBaseStats::bimodalAltMatchProviderWrong, gem5::branch_prediction::TAGEBase::TAGEBaseStats::bimodalProviderCorrect, gem5::branch_prediction::TAGEBase::TAGEBaseStats::bimodalProviderWrong, gem5::branch_prediction::TAGEBase::TAGEBaseStats::longestMatchProvider, gem5::branch_prediction::TAGEBase::TAGEBaseStats::longestMatchProviderCorrect, gem5::branch_prediction::TAGEBase::TAGEBaseStats::longestMatchProviderWouldHaveHit, gem5::branch_prediction::TAGEBase::TAGEBaseStats::longestMatchProviderWrong, stats, TAGE_ALT_MATCH, and TAGE_LONGEST_MATCH.
Referenced by gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::MultiperspectivePerceptronTAGE::update(), gem5::branch_prediction::TAGE::update(), and gem5::branch_prediction::TAGE_SC_L::update().
|
protected |
Definition at line 437 of file tage_base.hh.
Referenced by baseUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE::getBimodePred(), init(), and gem5::branch_prediction::MPP_TAGE::isHighConfidence().
|
protected |
Definition at line 436 of file tage_base.hh.
Referenced by baseUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE::getBimodePred(), getBimodePred(), init(), and gem5::branch_prediction::MPP_TAGE::isHighConfidence().
|
protected |
Definition at line 438 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::buildTageTables(), buildTageTables(), gem5::branch_prediction::TAGE_SC_L_TAGE::extraAltCalc(), getCtr(), gem5::branch_prediction::MPP_TAGE::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), handleAllocAndUReset(), gem5::branch_prediction::MPP_TAGE::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(), handleTAGEUpdate(), gem5::branch_prediction::MPP_TAGE::handleUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE::handleUReset(), handleUReset(), init(), gem5::branch_prediction::MPP_TAGE::isHighConfidence(), and tagePredict().
|
protected |
Definition at line 428 of file tage_base.hh.
Referenced by getGHR(), init(), and updateGHist().
|
protected |
Definition at line 471 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::calculateIndicesAndTags(), gem5::branch_prediction::MPP_TAGE::calculateParameters(), gem5::branch_prediction::TAGE_SC_L_TAGE::calculateParameters(), calculateParameters(), getSizeInBits(), gem5::branch_prediction::TAGE_SC_L_TAGE::gindex(), gindex(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::gtag(), init(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::initFoldedHistories(), and initFoldedHistories().
|
protected |
Definition at line 492 of file tage_base.hh.
Referenced by init().
|
protected |
Definition at line 478 of file tage_base.hh.
Referenced by init().
|
protected |
Definition at line 490 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::bindex(), bindex(), gindex(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::gtag(), gtag(), updateHistories(), and gem5::branch_prediction::TAGE_SC_L_TAGE::updatePathAndGlobalHistory().
|
protected |
Definition at line 424 of file tage_base.hh.
Referenced by baseUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE::getBimodePred(), getSizeInBits(), init(), and gem5::branch_prediction::MPP_TAGE::isHighConfidence().
|
protected |
Definition at line 434 of file tage_base.hh.
Referenced by gem5::branch_prediction::MPP_TAGE::bindex(), gem5::branch_prediction::TAGE_SC_L_TAGE::bindex(), bindex(), buildTageTables(), gem5::branch_prediction::TAGE_SC_L_TAGE::calculateIndicesAndTags(), gem5::branch_prediction::TAGE_SC_L_TAGE::calculateParameters(), gem5::branch_prediction::TAGE_SC_L_TAGE::F(), F(), getSizeInBits(), gem5::branch_prediction::TAGE_SC_L_TAGE::gindex(), gindex(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::gindex_ext(), gem5::branch_prediction::MPP_TAGE::handleUReset(), handleUReset(), init(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::initFoldedHistories(), and initFoldedHistories().
|
protected |
Definition at line 477 of file tage_base.hh.
Referenced by getSizeInBits(), gem5::branch_prediction::MPP_TAGE::handleUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE::handleUReset(), handleUReset(), and init().
|
protected |
Definition at line 430 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::calculateParameters(), calculateParameters(), init(), and updateGHist().
|
protected |
Definition at line 481 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), and handleAllocAndUReset().
|
protected |
Definition at line 429 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::calculateParameters(), and calculateParameters().
|
protected |
Definition at line 425 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGEBase::BranchInfo::BranchInfo(), btbUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE::buildTageTables(), buildTageTables(), gem5::branch_prediction::TAGE_SC_L_TAGE::calculateIndicesAndTags(), calculateIndicesAndTags(), gem5::branch_prediction::MPP_TAGE::calculateParameters(), gem5::branch_prediction::TAGE_SC_L_TAGE::calculateParameters(), calculateParameters(), condBranchUpdate(), getSizeInBits(), gem5::branch_prediction::MPP_TAGE::getUseAltIdx(), gem5::branch_prediction::MPP_TAGE::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), handleAllocAndUReset(), gem5::branch_prediction::MPP_TAGE::handleUReset(), handleUReset(), init(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::initFoldedHistories(), initFoldedHistories(), squash(), TAGEBase(), gem5::branch_prediction::TAGEBase::TAGEBaseStats::TAGEBaseStats(), tagePredict(), updateHistories(), gem5::branch_prediction::MPP_TAGE::updatePathAndGlobalHistory(), and gem5::branch_prediction::TAGE_SC_L_TAGE::updatePathAndGlobalHistory().
|
protected |
Definition at line 486 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::calculateIndicesAndTags(), gem5::branch_prediction::MPP_TAGE::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), TAGEBase(), and tagePredict().
|
protected |
Definition at line 479 of file tage_base.hh.
Referenced by getSizeInBits(), gem5::branch_prediction::MPP_TAGE::getUseAltIdx(), gem5::branch_prediction::TAGE_SC_L_TAGE::getUseAltIdx(), and init().
|
protected |
Definition at line 431 of file tage_base.hh.
Referenced by getSizeInBits(), gem5::branch_prediction::TAGE_SC_L_TAGE::gindex(), gindex(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::gtag(), init(), updateHistories(), and gem5::branch_prediction::TAGE_SC_L_TAGE::updatePathAndGlobalHistory().
|
protected |
Definition at line 488 of file tage_base.hh.
Referenced by btbUpdate(), isSpeculativeUpdateEnabled(), squash(), gem5::branch_prediction::MPP_TAGE::updateHistories(), gem5::branch_prediction::TAGE_SC_L_TAGE::updateHistories(), and updateHistories().
|
protected |
Referenced by updateStats().
|
protected |
Definition at line 472 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::calculateIndicesAndTags(), calculateIndicesAndTags(), init(), and tagePredict().
|
protected |
Definition at line 473 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::calculateIndicesAndTags(), calculateIndicesAndTags(), init(), and tagePredict().
|
protected |
Definition at line 426 of file tage_base.hh.
Referenced by getSizeInBits(), getTageCtrBits(), gem5::branch_prediction::MPP_TAGE::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(), handleTAGEUpdate(), and gem5::branch_prediction::MPP_TAGE::isHighConfidence().
|
protected |
Definition at line 433 of file tage_base.hh.
Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE::calculateParameters(), getSizeInBits(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::gtag(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::gtag(), gtag(), init(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::initFoldedHistories(), and initFoldedHistories().
|
protected |
Definition at line 427 of file tage_base.hh.
Referenced by getSizeInBits(), gem5::branch_prediction::MPP_TAGE::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(), handleTAGEUpdate(), and init().
|
protected |
Definition at line 476 of file tage_base.hh.
Referenced by gem5::branch_prediction::MPP_TAGE::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleAllocAndUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset(), handleAllocAndUReset(), gem5::branch_prediction::MPP_TAGE::handleUReset(), gem5::branch_prediction::TAGE_SC_L_TAGE::handleUReset(), handleUReset(), and init().
|
protected |
Definition at line 464 of file tage_base.hh.
Referenced by btbUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE::calculateIndicesAndTags(), getGHR(), getPathHist(), gem5::branch_prediction::TAGE_SC_L_TAGE::gindex(), gindex(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::gtag(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::gtag(), gtag(), init(), squash(), gem5::branch_prediction::MPP_TAGE::updateHistories(), gem5::branch_prediction::TAGE_SC_L_TAGE::updateHistories(), and updateHistories().
|
protected |
Definition at line 480 of file tage_base.hh.
Referenced by condBranchUpdate(), and getSizeInBits().
|
protected |
Definition at line 475 of file tage_base.hh.
Referenced by condBranchUpdate(), init(), and tagePredict().