|
gem5
v19.0.0.0
|
#include <tage_base.hh>
Classes | |
| struct | BranchInfo |
| struct | FoldedHistory |
| 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 SimObject | |
| typedef SimObjectParams | Params |
Public Member Functions | |
| TAGEBase (const TAGEBaseParams *p) | |
| void | regStats () override |
| Callback to set stat parameters. More... | |
| void | init () override |
| init() is called after all C++ SimObjects have been created and all ports are connected. More... | |
| virtual BranchInfo * | makeBranchInfo () |
| virtual int | bindex (Addr pc_in) const |
| Computes the index used to access the bimodal table. More... | |
| virtual int | gindex (ThreadID tid, Addr pc, int bank) const |
| Computes the index used to access a partially tagged table. More... | |
| 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. More... | |
| virtual uint16_t | gtag (ThreadID tid, Addr pc, int bank) const |
| Computes the partial tag of a tagged table. More... | |
| virtual bool | getBimodePred (Addr pc, BranchInfo *bi) const |
| Get a branch prediction from the bimodal predictor. More... | |
| void | baseUpdate (Addr pc, bool taken, BranchInfo *bi) |
| Updates the bimodal predictor. More... | |
| void | updateGHist (uint8_t *&h, bool dir, uint8_t *tab, int &PT) |
| (Speculatively) updates the global branch history. More... | |
| void | update (ThreadID tid, Addr branch_pc, bool taken, BranchInfo *bi) |
| Update TAGE. More... | |
| 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). More... | |
| virtual void | squash (ThreadID tid, bool taken, BranchInfo *bi, Addr target) |
| Restores speculatively updated path and direction histories. More... | |
| 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. More... | |
| bool | tagePredict (ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo *bi) |
| TAGE prediction called from TAGE::predict. More... | |
| virtual void | updateStats (bool taken, BranchInfo *bi) |
| Update the stats. More... | |
| virtual void | buildTageTables () |
| Instantiates the TAGE table entries. More... | |
| virtual void | calculateParameters () |
| Calculates the history lengths and some other paramters in derived classes. More... | |
| 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. More... | |
| virtual unsigned | getUseAltIdx (BranchInfo *bi, Addr branch_pc) |
| Calculation of the index for useAltPredForNewlyAllocated On this base TAGE implementation it is always 0. More... | |
| 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. More... | |
| virtual void | handleAllocAndUReset (bool alloc, bool taken, BranchInfo *bi, int nrand) |
| Handles Allocation and U bits reset on an update. More... | |
| virtual void | handleUReset () |
| Handles the U bits reset. More... | |
| virtual void | handleTAGEUpdate (Addr branch_pc, bool taken, BranchInfo *bi) |
| Handles the update of the TAGE entries. More... | |
| virtual void | resetUctr (uint8_t &u) |
| Algorithm for resetting a single U counter. More... | |
| virtual void | extraAltCalc (BranchInfo *bi) |
| Extra steps for calculating altTaken For this base TAGE class it does nothing. More... | |
| 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 SimObject | |
| const Params * | params () const |
| SimObject (const Params *_params) | |
| virtual | ~SimObject () |
| virtual const std::string | name () const |
| virtual void | loadState (CheckpointIn &cp) |
| loadState() is called on each SimObject when restoring from a checkpoint. More... | |
| virtual void | initState () |
| initState() is called on each SimObject when not restoring from a checkpoint. More... | |
| virtual void | regProbePoints () |
| Register probe points for this object. More... | |
| virtual void | regProbeListeners () |
| Register probe listeners for this object. More... | |
| ProbeManager * | getProbeManager () |
| Get the probe manager for this object. More... | |
| virtual Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) |
| Get a port with a given name and index. More... | |
| virtual void | startup () |
| startup() is the final initialization call before simulation. More... | |
| DrainState | drain () override |
| Provide a default implementation of the drain interface for objects that don't need draining. More... | |
| virtual void | memWriteback () |
| Write back dirty buffers to memory using functional writes. More... | |
| virtual void | memInvalidate () |
| Invalidate the contents of memory buffers. More... | |
| void | serialize (CheckpointOut &cp) const override |
| Serialize an object. More... | |
| void | unserialize (CheckpointIn &cp) override |
| Unserialize an object. More... | |
Public Member Functions inherited from EventManager | |
| EventManager (EventManager &em) | |
| EventManager (EventManager *em) | |
| EventManager (EventQueue *eq) | |
| 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) |
| void | setCurTick (Tick newVal) |
Public Member Functions inherited from Serializable | |
| Serializable () | |
| virtual | ~Serializable () |
| void | serializeSection (CheckpointOut &cp, const char *name) const |
| Serialize an object into a new section. More... | |
| void | serializeSection (CheckpointOut &cp, const std::string &name) const |
| void | unserializeSection (CheckpointIn &cp, const char *name) |
| Unserialize an a child object. More... | |
| void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from Drainable | |
| DrainState | drainState () const |
| Return the current drain state of an object. More... | |
| virtual void | notifyFork () |
| Notify a child process of a fork. More... | |
Public Member Functions inherited from Stats::Group | |
| Group ()=delete | |
| Group (const Group &)=delete | |
| Group & | operator= (const Group &)=delete |
| Group (Group *parent, const char *name=nullptr) | |
| Construct a new statistics group. More... | |
| virtual | ~Group () |
| virtual void | resetStats () |
| Callback to reset stats. More... | |
| virtual void | preDumpStats () |
| Callback before stats are dumped. More... | |
| void | addStat (Stats::Info *info) |
| Register a stat with this group. More... | |
| const std::map< std::string, Group * > & | getStatGroups () const |
| Get all child groups associated with this object. More... | |
| const std::vector< Info * > & | getStats () const |
| Get all stats associated with this object. More... | |
| void | addStatGroup (const char *name, Group *block) |
| Add a stat block as a child of this block. More... | |
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. More... | |
| static void | unsignedCtrUpdate (uint8_t &ctr, bool up, unsigned nbits) |
| Updates an unsigned counter based on up/down parameter. More... | |
Static Public Member Functions inherited from SimObject | |
| static void | serializeAll (CheckpointOut &cp) |
| Serialize all SimObjects in the system. More... | |
| static SimObject * | find (const char *name) |
| Find the SimObject with the given name and return a pointer to it. More... | |
Static Public Member Functions inherited from Serializable | |
| static const std::string & | currentSection () |
| Get the fully-qualified name of the active section. More... | |
| static void | serializeAll (const std::string &cpt_dir) |
| static void | unserializeGlobals (CheckpointIn &cp) |
Protected Member Functions | |
| virtual void | initFoldedHistories (ThreadHistory &history) |
| Initialization of the folded histories. More... | |
Protected Member Functions inherited from Drainable | |
| Drainable () | |
| virtual | ~Drainable () |
| virtual void | drainResume () |
| Resume execution after a successful drain. More... | |
| void | signalDrainDone () const |
| Signal that an object is drained. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Serializable | |
| static int | ckptCount = 0 |
| static int | ckptMaxCount = 0 |
| static int | ckptPrevCount = -1 |
Definition at line 61 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 115 of file tage_base.hh.
| TAGEBase::TAGEBase | ( | const TAGEBaseParams * | p | ) |
Definition at line 48 of file tage_base.cc.
References nHistoryTables, and noSkip.
Referenced by getSizeInBits().
|
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 TAGE_SC_L_TAGE, and MPP_TAGE.
Definition at line 433 of file tage_base.cc.
Referenced by condBranchUpdate(), and TAGEBase::BranchInfo::~BranchInfo().
| void 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 297 of file tage_base.cc.
References TAGEBase::BranchInfo::bimodalIndex, btableHysteresis, btablePrediction, DPRINTF, and logRatioBiModalHystEntries.
Referenced by MPP_TAGE::handleTAGEUpdate(), handleTAGEUpdate(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
Computes the index used to access the bimodal table.
| pc_in | The unshifted branch PC. |
Reimplemented in TAGE_SC_L_TAGE, and MPP_TAGE.
Definition at line 202 of file tage_base.cc.
References instShiftAmt, logTagTableSizes, and ULL.
Referenced by tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().
| void TAGEBase::btbUpdate | ( | ThreadID | tid, |
| Addr | branch_addr, | ||
| BranchInfo *& | bi | ||
| ) |
Definition at line 183 of file tage_base.cc.
References TAGEBase::BranchInfo::ci, TAGEBase::FoldedHistory::comp, TAGEBase::ThreadHistory::computeIndices, TAGEBase::ThreadHistory::computeTags, TAGEBase::BranchInfo::ct0, TAGEBase::BranchInfo::ct1, DPRINTF, TAGEBase::ThreadHistory::gHist, TAGEBase::ThreadHistory::globalHistory, ArmISA::i, nHistoryTables, TAGEBase::ThreadHistory::ptGhist, speculativeHistUpdate, threadHistory, and TAGEBase::FoldedHistory::update().
Referenced by TAGE::btbUpdate(), and isHighConfidence().
|
virtual |
Instantiates the TAGE table entries.
Reimplemented in TAGE_SC_L_TAGE.
Definition at line 161 of file tage_base.cc.
References gtable, ArmISA::i, logTagTableSizes, and nHistoryTables.
Referenced by init(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
On a prediction, calculates the TAGE indices and tags for all the different history lengths.
Reimplemented in TAGE_SC_L_TAGE.
Definition at line 335 of file tage_base.cc.
References gindex(), gtag(), ArmISA::i, nHistoryTables, TAGEBase::BranchInfo::tableIndices, tableIndices, TAGEBase::BranchInfo::tableTags, and tableTags.
Referenced by tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
Calculates the history lengths and some other paramters in derived classes.
Reimplemented in TAGE_SC_L_TAGE, and MPP_TAGE.
Definition at line 169 of file tage_base.cc.
References histLengths, ArmISA::i, maxHist, minHist, and nHistoryTables.
Referenced by init(), and TAGEBase::BranchInfo::~BranchInfo().
|
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. 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 509 of file tage_base.cc.
References adjustAlloc(), TAGEBase::BranchInfo::altTaken, ctrUpdate(), getUseAltIdx(), handleAllocAndUReset(), handleTAGEUpdate(), TAGEBase::BranchInfo::hitBank, TAGEBase::BranchInfo::longestMatchPred, nHistoryTables, TAGEBase::BranchInfo::pseudoNewAlloc, TAGEBase::BranchInfo::tagePred, useAltOnNaBits, and useAltPredForNewlyAllocated.
Referenced by LTAGE::update(), TAGE::update(), TAGE_SC_L::update(), MultiperspectivePerceptronTAGE::update(), MPP_StatisticalCorrector::BranchInfo::~BranchInfo(), and TAGEBase::BranchInfo::~BranchInfo().
|
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 256 of file tage_base.cc.
Referenced by condBranchUpdate(), MPP_TAGE::handleTAGEUpdate(), handleTAGEUpdate(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
Extra steps for calculating altTaken For this base TAGE class it does nothing.
Reimplemented in TAGE_SC_L_TAGE.
Definition at line 650 of file tage_base.cc.
Referenced by tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().
|
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 TAGE_SC_L_TAGE.
Definition at line 208 of file tage_base.cc.
References logTagTableSizes, and ULL.
Referenced by gindex(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
Get a branch prediction from the bimodal predictor.
| pc | The unshifted branch PC. |
| bi | Pointer to information on the prediction. |
Reimplemented in TAGE_SC_L_TAGE.
Definition at line 288 of file tage_base.cc.
References TAGEBase::BranchInfo::bimodalIndex, and btablePrediction.
Referenced by TAGE_SC_L_TAGE::getBimodePred(), tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().
| int8_t TAGEBase::getCtr | ( | int | hitBank, |
| int | hitBankIndex | ||
| ) | const |
Definition at line 783 of file tage_base.cc.
References TAGEBase::TageEntry::ctr, and gtable.
Referenced by isHighConfidence(), and TAGE_SC_L::predict().
| unsigned TAGEBase::getGHR | ( | ThreadID | tid, |
| BranchInfo * | bi | ||
| ) | const |
Definition at line 704 of file tage_base.cc.
References histBufferSize, ArmISA::i, TAGEBase::BranchInfo::ptGhist, threadHistory, and X86ISA::val.
Referenced by isHighConfidence().
| int TAGEBase::getPathHist | ( | ThreadID | tid | ) | const |
Definition at line 795 of file tage_base.cc.
References threadHistory.
Referenced by isHighConfidence(), MultiperspectivePerceptronTAGE::lookup(), TAGE_SC_L::predict(), TAGE_SC_L::update(), and MultiperspectivePerceptronTAGE::update().
| size_t TAGEBase::getSizeInBits | ( | ) | const |
Definition at line 807 of file tage_base.cc.
References bits(), histLengths, ArmISA::i, logRatioBiModalHystEntries, logTagTableSizes, logUResetPeriod, nHistoryTables, numUseAltOnNa, pathHistBits, TAGEBase(), tagTableCounterBits, tagTableTagWidths, tagTableUBits, ULL, and useAltOnNaBits.
Referenced by MultiperspectivePerceptronTAGE::init(), and isHighConfidence().
| unsigned TAGEBase::getTageCtrBits | ( | ) | const |
Definition at line 789 of file tage_base.cc.
References tagTableCounterBits.
Referenced by isHighConfidence(), and TAGE_SC_L::predict().
|
virtual |
Calculation of the index for useAltPredForNewlyAllocated On this base TAGE implementation it is always 0.
Reimplemented in TAGE_SC_L_TAGE, and MPP_TAGE.
Definition at line 348 of file tage_base.cc.
Referenced by condBranchUpdate(), tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().
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 TAGE_SC_L_TAGE.
Definition at line 225 of file tage_base.cc.
References F(), histLengths, MipsISA::index, instShiftAmt, logTagTableSizes, pathHistBits, threadHistory, and ULL.
Referenced by calculateIndicesAndTags(), and TAGEBase::BranchInfo::~BranchInfo().
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 TAGE_SC_L_TAGE, TAGE_SC_L_TAGE_64KB, and TAGE_SC_L_TAGE_8KB.
Definition at line 243 of file tage_base.cc.
References instShiftAmt, tagTableTagWidths, threadHistory, and ULL.
Referenced by calculateIndicesAndTags(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
Handles Allocation and U bits reset on an update.
Reimplemented in TAGE_SC_L_TAGE, MPP_TAGE, TAGE_SC_L_TAGE_64KB, and TAGE_SC_L_TAGE_8KB.
Definition at line 439 of file tage_base.cc.
References TAGEBase::TageEntry::ctr, gtable, handleUReset(), TAGEBase::BranchInfo::hitBank, ArmISA::i, maxNumAlloc, nHistoryTables, TAGEBase::BranchInfo::tableIndices, TAGEBase::BranchInfo::tableTags, TAGEBase::TageEntry::tag, tCounter, TAGEBase::TageEntry::u, ULL, and X86ISA::X.
Referenced by condBranchUpdate(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
Handles the update of the TAGE entries.
Reimplemented in TAGE_SC_L_TAGE, MPP_TAGE, TAGE_SC_L_TAGE_64KB, and TAGE_SC_L_TAGE_8KB.
Definition at line 550 of file tage_base.cc.
References TAGEBase::BranchInfo::altBank, TAGEBase::BranchInfo::altBankIndex, TAGEBase::BranchInfo::altTaken, baseUpdate(), TAGEBase::TageEntry::ctr, ctrUpdate(), DPRINTF, gtable, TAGEBase::BranchInfo::hitBank, TAGEBase::BranchInfo::hitBankIndex, TAGEBase::BranchInfo::tagePred, tagTableCounterBits, tagTableUBits, TAGEBase::TageEntry::u, and unsignedCtrUpdate().
Referenced by condBranchUpdate(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
Handles the U bits reset.
Reimplemented in TAGE_SC_L_TAGE, and MPP_TAGE.
Definition at line 488 of file tage_base.cc.
References gtable, ArmISA::i, ArmISA::j, logTagTableSizes, logUResetPeriod, nHistoryTables, resetUctr(), tCounter, ArmISA::u, and ULL.
Referenced by handleAllocAndUReset(), and TAGEBase::BranchInfo::~BranchInfo().
|
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 SimObject.
Definition at line 83 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, ULL, and useAltPredForNewlyAllocated.
Referenced by MultiperspectivePerceptronTAGE::init(), and MultiperspectivePerceptronTAGE::MPPTAGEBranchInfo::~MPPTAGEBranchInfo().
|
protectedvirtual |
Initialization of the folded histories.
Reimplemented in TAGE_SC_L_TAGE_8KB.
Definition at line 146 of file tage_base.cc.
References TAGEBase::ThreadHistory::computeIndices, TAGEBase::ThreadHistory::computeTags, DPRINTF, histLengths, ArmISA::i, TAGEBase::FoldedHistory::init(), logTagTableSizes, nHistoryTables, TAGEBase::FoldedHistory::origLength, and tagTableTagWidths.
Referenced by init().
|
inlinevirtual |
Reimplemented in MPP_TAGE.
Definition at line 406 of file tage_base.hh.
References btbUpdate(), getCtr(), getGHR(), getPathHist(), getSizeInBits(), getTageCtrBits(), and isSpeculativeUpdateEnabled().
Referenced by MultiperspectivePerceptronTAGE::lookup().
| bool TAGEBase::isSpeculativeUpdateEnabled | ( | ) | const |
Definition at line 801 of file tage_base.cc.
References speculativeHistUpdate.
Referenced by isHighConfidence(), MultiperspectivePerceptronTAGE::MultiperspectivePerceptronTAGE(), LTAGE::update(), TAGE_SC_L::update(), and MultiperspectivePerceptronTAGE::update().
|
virtual |
Reimplemented in TAGE_SC_L_TAGE.
Definition at line 78 of file tage_base.cc.
Referenced by TAGEBase::BranchInfo::~BranchInfo().
|
overridevirtual |
Callback to set stat parameters.
This callback is typically used for complex stats (e.g., distributions) that need parameters in addition to a name and a description. Stat names and descriptions should typically be set from the constructor usingo from the constructor using the ADD_STAT macro.
Reimplemented from Stats::Group.
Definition at line 719 of file tage_base.cc.
References bimodalAltMatchProviderCorrect, bimodalAltMatchProviderWrong, Stats::DataWrap< Derived, InfoProxyType >::desc(), Stats::VectorBase< Derived, Stor >::init(), SimObject::name(), Stats::DataWrap< Derived, InfoProxyType >::name(), nHistoryTables, tageAltMatchProvider, tageAltMatchProviderCorrect, tageAltMatchProviderWouldHaveHit, tageAltMatchProviderWrong, tageBimodalProviderCorrect, tageBimodalProviderWrong, tageLongestMatchProvider, tageLongestMatchProviderCorrect, tageLongestMatchProviderWouldHaveHit, and tageLongestMatchProviderWrong.
|
virtual |
Algorithm for resetting a single U counter.
Reimplemented in MPP_TAGE, and TAGE_SC_L_TAGE_8KB.
Definition at line 503 of file tage_base.cc.
Referenced by handleUReset(), and TAGEBase::BranchInfo::~BranchInfo().
|
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 TAGE_SC_L_TAGE.
Definition at line 624 of file tage_base.cc.
References TAGEBase::BranchInfo::branchPC, TAGEBase::BranchInfo::ci, TAGEBase::FoldedHistory::comp, TAGEBase::ThreadHistory::computeIndices, TAGEBase::ThreadHistory::computeTags, TAGEBase::BranchInfo::ct0, TAGEBase::BranchInfo::ct1, DPRINTF, TAGEBase::ThreadHistory::gHist, TAGEBase::ThreadHistory::globalHistory, ArmISA::i, nHistoryTables, TAGEBase::BranchInfo::pathHist, TAGEBase::ThreadHistory::pathHist, TAGEBase::BranchInfo::ptGhist, TAGEBase::ThreadHistory::ptGhist, speculativeHistUpdate, threadHistory, and TAGEBase::FoldedHistory::update().
Referenced by LTAGE::update(), TAGE::update(), TAGE_SC_L::update(), MultiperspectivePerceptronTAGE::update(), TAGEBase::BranchInfo::~BranchInfo(), and MultiperspectivePerceptronTAGE::MPPTAGEBranchInfo::~MPPTAGEBranchInfo().
| bool 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 355 of file tage_base.cc.
References TAGEBase::BranchInfo::altBank, TAGEBase::BranchInfo::altBankIndex, TAGEBase::BranchInfo::altTaken, BIMODAL_ALT_MATCH, BIMODAL_ONLY, TAGEBase::BranchInfo::bimodalIndex, bindex(), TAGEBase::BranchInfo::branchPC, calculateIndicesAndTags(), TAGEBase::BranchInfo::condBranch, TAGEBase::TageEntry::ctr, DPRINTF, extraAltCalc(), getBimodePred(), getUseAltIdx(), gtable, TAGEBase::BranchInfo::hitBank, TAGEBase::BranchInfo::hitBankIndex, ArmISA::i, TAGEBase::BranchInfo::longestMatchPred, nHistoryTables, noSkip, MipsISA::pc, TAGEBase::BranchInfo::provider, TAGEBase::BranchInfo::pseudoNewAlloc, tableIndices, tableTags, TAGE_ALT_MATCH, TAGE_LONGEST_MATCH, TAGEBase::BranchInfo::tagePred, and useAltPredForNewlyAllocated.
Referenced by MultiperspectivePerceptronTAGE::lookup(), TAGE::predict(), LTAGE::predict(), TAGE_SC_L::predict(), and TAGEBase::BranchInfo::~BranchInfo().
|
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 274 of file tage_base.cc.
Referenced by handleTAGEUpdate(), and TAGEBase::BranchInfo::~BranchInfo().
| void 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. |
Referenced by TAGEBase::BranchInfo::~BranchInfo(), and MultiperspectivePerceptronTAGE::MPPTAGEBranchInfo::~MPPTAGEBranchInfo().
| void 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 317 of file tage_base.cc.
References DPRINTF, histBufferSize, ArmISA::i, and maxHist.
Referenced by updateHistories(), MPP_TAGE::updatePathAndGlobalHistory(), and TAGEBase::BranchInfo::~BranchInfo().
|
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 TAGE_SC_L_TAGE, and MPP_TAGE.
Definition at line 583 of file tage_base.cc.
References TAGEBase::BranchInfo::ci, TAGEBase::FoldedHistory::comp, TAGEBase::ThreadHistory::computeIndices, TAGEBase::ThreadHistory::computeTags, TAGEBase::BranchInfo::ct0, TAGEBase::BranchInfo::ct1, DPRINTF, TAGEBase::ThreadHistory::gHist, TAGEBase::ThreadHistory::globalHistory, ArmISA::i, instShiftAmt, nHistoryTables, TAGEBase::BranchInfo::pathHist, TAGEBase::ThreadHistory::pathHist, pathHistBits, TAGEBase::BranchInfo::ptGhist, TAGEBase::ThreadHistory::ptGhist, speculativeHistUpdate, threadHistory, ULL, TAGEBase::FoldedHistory::update(), and updateGHist().
Referenced by TAGE::lookup(), TAGE::uncondBranch(), LTAGE::update(), TAGE::update(), TAGE_SC_L::update(), MultiperspectivePerceptronTAGE::update(), and TAGEBase::BranchInfo::~BranchInfo().
|
virtual |
Update the stats.
| taken | Actual branch outcome |
| bi | Pointer to information on the prediction recorded at prediction time. |
Definition at line 657 of file tage_base.cc.
References TAGEBase::BranchInfo::altBank, TAGEBase::BranchInfo::altTaken, BIMODAL_ALT_MATCH, BIMODAL_ONLY, bimodalAltMatchProviderCorrect, bimodalAltMatchProviderWrong, TAGEBase::BranchInfo::hitBank, TAGEBase::BranchInfo::longestMatchPred, TAGEBase::BranchInfo::provider, TAGE_ALT_MATCH, TAGE_LONGEST_MATCH, tageAltMatchProvider, tageAltMatchProviderCorrect, tageAltMatchProviderWouldHaveHit, tageAltMatchProviderWrong, tageBimodalProviderCorrect, tageBimodalProviderWrong, tageLongestMatchProvider, tageLongestMatchProviderCorrect, tageLongestMatchProviderWouldHaveHit, tageLongestMatchProviderWrong, and TAGEBase::BranchInfo::tagePred.
Referenced by LTAGE::update(), TAGE::update(), TAGE_SC_L::update(), MultiperspectivePerceptronTAGE::update(), and TAGEBase::BranchInfo::~BranchInfo().
|
protected |
Definition at line 492 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 496 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 433 of file tage_base.hh.
Referenced by baseUpdate(), init(), and MPP_TAGE::isHighConfidence().
|
protected |
Definition at line 432 of file tage_base.hh.
Referenced by baseUpdate(), getBimodePred(), init(), and MPP_TAGE::isHighConfidence().
|
protected |
Definition at line 434 of file tage_base.hh.
Referenced by buildTageTables(), getCtr(), MPP_TAGE::handleAllocAndUReset(), handleAllocAndUReset(), MPP_TAGE::handleTAGEUpdate(), handleTAGEUpdate(), MPP_TAGE::handleUReset(), handleUReset(), init(), MPP_TAGE::isHighConfidence(), and tagePredict().
|
protected |
Definition at line 424 of file tage_base.hh.
Referenced by getGHR(), init(), and updateGHist().
|
protected |
Definition at line 466 of file tage_base.hh.
Referenced by MPP_TAGE::calculateParameters(), calculateParameters(), getSizeInBits(), gindex(), init(), and initFoldedHistories().
|
protected |
Definition at line 487 of file tage_base.hh.
Referenced by init().
|
protected |
Definition at line 473 of file tage_base.hh.
Referenced by init().
|
protected |
Definition at line 485 of file tage_base.hh.
Referenced by bindex(), gindex(), gtag(), and updateHistories().
|
protected |
Definition at line 420 of file tage_base.hh.
Referenced by baseUpdate(), getSizeInBits(), init(), and MPP_TAGE::isHighConfidence().
|
protected |
Definition at line 430 of file tage_base.hh.
Referenced by MPP_TAGE::bindex(), bindex(), buildTageTables(), F(), getSizeInBits(), gindex(), MPP_TAGE::handleUReset(), handleUReset(), init(), and initFoldedHistories().
|
protected |
Definition at line 472 of file tage_base.hh.
Referenced by getSizeInBits(), MPP_TAGE::handleUReset(), handleUReset(), and init().
|
protected |
Definition at line 426 of file tage_base.hh.
Referenced by calculateParameters(), init(), and updateGHist().
|
protected |
Definition at line 476 of file tage_base.hh.
Referenced by handleAllocAndUReset().
|
protected |
Definition at line 425 of file tage_base.hh.
Referenced by calculateParameters().
|
protected |
Definition at line 421 of file tage_base.hh.
Referenced by TAGEBase::BranchInfo::BranchInfo(), btbUpdate(), buildTageTables(), calculateIndicesAndTags(), MPP_TAGE::calculateParameters(), calculateParameters(), condBranchUpdate(), getSizeInBits(), MPP_TAGE::getUseAltIdx(), MPP_TAGE::handleAllocAndUReset(), handleAllocAndUReset(), MPP_TAGE::handleUReset(), handleUReset(), init(), initFoldedHistories(), regStats(), squash(), TAGEBase(), tagePredict(), updateHistories(), and MPP_TAGE::updatePathAndGlobalHistory().
|
protected |
Definition at line 481 of file tage_base.hh.
Referenced by MPP_TAGE::handleAllocAndUReset(), TAGEBase(), and tagePredict().
|
protected |
Definition at line 474 of file tage_base.hh.
Referenced by getSizeInBits(), MPP_TAGE::getUseAltIdx(), and init().
|
protected |
Definition at line 427 of file tage_base.hh.
Referenced by getSizeInBits(), gindex(), init(), and updateHistories().
|
protected |
Definition at line 483 of file tage_base.hh.
Referenced by btbUpdate(), isSpeculativeUpdateEnabled(), squash(), MPP_TAGE::updateHistories(), and updateHistories().
|
protected |
Definition at line 467 of file tage_base.hh.
Referenced by calculateIndicesAndTags(), init(), and tagePredict().
|
protected |
Definition at line 468 of file tage_base.hh.
Referenced by calculateIndicesAndTags(), init(), and tagePredict().
|
protected |
Definition at line 502 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 491 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 498 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 495 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 493 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 497 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 501 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 490 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 499 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 494 of file tage_base.hh.
Referenced by regStats(), and updateStats().
|
protected |
Definition at line 422 of file tage_base.hh.
Referenced by getSizeInBits(), getTageCtrBits(), MPP_TAGE::handleTAGEUpdate(), handleTAGEUpdate(), and MPP_TAGE::isHighConfidence().
|
protected |
Definition at line 429 of file tage_base.hh.
Referenced by getSizeInBits(), gtag(), init(), and initFoldedHistories().
|
protected |
Definition at line 423 of file tage_base.hh.
Referenced by getSizeInBits(), MPP_TAGE::handleTAGEUpdate(), handleTAGEUpdate(), and init().
|
protected |
Definition at line 471 of file tage_base.hh.
Referenced by MPP_TAGE::handleAllocAndUReset(), handleAllocAndUReset(), MPP_TAGE::handleUReset(), handleUReset(), and init().
|
protected |
Definition at line 459 of file tage_base.hh.
Referenced by btbUpdate(), getGHR(), getPathHist(), gindex(), gtag(), init(), squash(), MPP_TAGE::updateHistories(), and updateHistories().
|
protected |
Definition at line 475 of file tage_base.hh.
Referenced by condBranchUpdate(), and getSizeInBits().
|
protected |
Definition at line 470 of file tage_base.hh.
Referenced by condBranchUpdate(), init(), and tagePredict().