gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TAGEBase Class Reference

#include <tage_base.hh>

Inheritance diagram for TAGEBase:
SimObject EventManager Serializable Drainable Stats::Group MPP_TAGE TAGE_SC_L_TAGE MPP_TAGE_8KB TAGE_SC_L_TAGE_64KB TAGE_SC_L_TAGE_8KB

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 BranchInfomakeBranchInfo ()
 
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
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...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual PortgetPort (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...
 
const Paramsparams () const
 
 SimObject (const Params *_params)
 
- Public Member Functions inherited from EventManager
EventQueueeventQueue () 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)
 
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- 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 (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...
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 

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 SimObjectfind (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 ()
 Gets 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...
 

Protected Attributes

const unsigned logRatioBiModalHystEntries
 
const unsigned nHistoryTables
 
const unsigned tagTableCounterBits
 
const unsigned tagTableUBits
 
const unsigned histBufferSize
 
const unsigned minHist
 
const unsigned maxHist
 
const unsigned pathHistBits
 
std::vector< unsigned > tagTableTagWidths
 
std::vector< int > logTagTableSizes
 
std::vector< bool > btablePrediction
 
std::vector< bool > btableHysteresis
 
TageEntry ** gtable
 
std::vector< ThreadHistorythreadHistory
 
int * histLengths
 
int * tableIndices
 
int * tableTags
 
std::vector< int8_t > useAltPredForNewlyAllocated
 
int64_t tCounter
 
uint64_t logUResetPeriod
 
const int64_t initialTCounterValue
 
unsigned numUseAltOnNa
 
unsigned useAltOnNaBits
 
unsigned maxNumAlloc
 
std::vector< bool > noSkip
 
const bool speculativeHistUpdate
 
const unsigned instShiftAmt
 
bool initialized
 
Stats::Scalar tageLongestMatchProviderCorrect
 
Stats::Scalar tageAltMatchProviderCorrect
 
Stats::Scalar bimodalAltMatchProviderCorrect
 
Stats::Scalar tageBimodalProviderCorrect
 
Stats::Scalar tageLongestMatchProviderWrong
 
Stats::Scalar tageAltMatchProviderWrong
 
Stats::Scalar bimodalAltMatchProviderWrong
 
Stats::Scalar tageBimodalProviderWrong
 
Stats::Scalar tageAltMatchProviderWouldHaveHit
 
Stats::Scalar tageLongestMatchProviderWouldHaveHit
 
Stats::Vector tageLongestMatchProvider
 
Stats::Vector tageAltMatchProvider
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 58 of file tage_base.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
BIMODAL_ONLY 
TAGE_LONGEST_MATCH 
BIMODAL_ALT_MATCH 
TAGE_ALT_MATCH 
LAST_TAGE_PROVIDER_TYPE 

Definition at line 112 of file tage_base.hh.

Constructor & Destructor Documentation

◆ TAGEBase()

TAGEBase::TAGEBase ( const TAGEBaseParams *  p)

Definition at line 45 of file tage_base.cc.

References nHistoryTables, and noSkip.

Referenced by getSizeInBits().

Member Function Documentation

◆ adjustAlloc()

void TAGEBase::adjustAlloc ( bool &  alloc,
bool  taken,
bool  pred_taken 
)
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 430 of file tage_base.cc.

Referenced by condBranchUpdate(), and TAGEBase::BranchInfo::~BranchInfo().

◆ baseUpdate()

void TAGEBase::baseUpdate ( Addr  pc,
bool  taken,
BranchInfo bi 
)

Updates the bimodal predictor.

Parameters
pcThe unshifted branch PC.
takenThe actual branch outcome.
biPointer to information on the prediction recorded at prediction time.

Definition at line 294 of file tage_base.cc.

References TAGEBase::BranchInfo::bimodalIndex, btableHysteresis, btablePrediction, DPRINTF, and logRatioBiModalHystEntries.

Referenced by MPP_TAGE::handleTAGEUpdate(), handleTAGEUpdate(), and TAGEBase::BranchInfo::~BranchInfo().

◆ bindex()

int TAGEBase::bindex ( Addr  pc_in) const
virtual

Computes the index used to access the bimodal table.

Parameters
pc_inThe unshifted branch PC.

Reimplemented in TAGE_SC_L_TAGE, and MPP_TAGE.

Definition at line 199 of file tage_base.cc.

References instShiftAmt, logTagTableSizes, and ULL.

Referenced by tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().

◆ btbUpdate()

void TAGEBase::btbUpdate ( ThreadID  tid,
Addr  branch_addr,
BranchInfo *&  bi 
)

◆ buildTageTables()

void TAGEBase::buildTageTables ( )
virtual

Instantiates the TAGE table entries.

Reimplemented in TAGE_SC_L_TAGE.

Definition at line 158 of file tage_base.cc.

References gtable, ArmISA::i, logTagTableSizes, and nHistoryTables.

Referenced by init(), and TAGEBase::BranchInfo::~BranchInfo().

◆ calculateIndicesAndTags()

void TAGEBase::calculateIndicesAndTags ( ThreadID  tid,
Addr  branch_pc,
BranchInfo bi 
)
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 332 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().

◆ calculateParameters()

void TAGEBase::calculateParameters ( )
virtual

Calculates the history lengths and some other paramters in derived classes.

Reimplemented in TAGE_SC_L_TAGE, and MPP_TAGE.

Definition at line 166 of file tage_base.cc.

References histLengths, ArmISA::i, maxHist, minHist, and nHistoryTables.

Referenced by init(), and TAGEBase::BranchInfo::~BranchInfo().

◆ condBranchUpdate()

void TAGEBase::condBranchUpdate ( ThreadID  tid,
Addr  branch_pc,
bool  taken,
BranchInfo bi,
int  nrand,
Addr  corrTarget,
bool  pred,
bool  preAdjustAlloc = false 
)
virtual

Update TAGE for conditional branches.

Parameters
branch_pcThe unshifted branch PC.
takenActual branch outcome.
biPointer to information on the prediction recorded at prediction time. Random int number from 0 to 3
corrTargetThe correct branch target
predFinal prediction for this branch
preAdjustAlloccall adjustAlloc before checking pseudo newly allocated entries

Definition at line 506 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().

◆ ctrUpdate()

template<typename T >
template void TAGEBase::ctrUpdate ( T &  ctr,
bool  taken,
int  nbits 
)
static

Updates a direction counter based on the actual branch outcome.

Parameters
ctrReference to counter to update.
takenActual branch outcome.
nbitsCounter width.

Definition at line 253 of file tage_base.cc.

Referenced by condBranchUpdate(), MPP_TAGE::handleTAGEUpdate(), handleTAGEUpdate(), and TAGEBase::BranchInfo::~BranchInfo().

◆ extraAltCalc()

void TAGEBase::extraAltCalc ( BranchInfo bi)
virtual

Extra steps for calculating altTaken For this base TAGE class it does nothing.

Reimplemented in TAGE_SC_L_TAGE.

Definition at line 647 of file tage_base.cc.

Referenced by tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().

◆ F()

int TAGEBase::F ( int  phist,
int  size,
int  bank 
) const
virtual

Utility function to shuffle the path history depending on which tagged table we are accessing.

Parameters
phistThe path history.
sizeNumber of path history bits to use.
bankThe partially tagged table to access.

Reimplemented in TAGE_SC_L_TAGE.

Definition at line 205 of file tage_base.cc.

References logTagTableSizes, and ULL.

Referenced by gindex(), and TAGEBase::BranchInfo::~BranchInfo().

◆ getBimodePred()

bool TAGEBase::getBimodePred ( Addr  pc,
BranchInfo bi 
) const
virtual

Get a branch prediction from the bimodal predictor.

Parameters
pcThe unshifted branch PC.
biPointer to information on the prediction.

Reimplemented in TAGE_SC_L_TAGE.

Definition at line 285 of file tage_base.cc.

References TAGEBase::BranchInfo::bimodalIndex, and btablePrediction.

Referenced by TAGE_SC_L_TAGE::getBimodePred(), tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().

◆ getCtr()

int8_t TAGEBase::getCtr ( int  hitBank,
int  hitBankIndex 
) const

Definition at line 780 of file tage_base.cc.

References TAGEBase::TageEntry::ctr, and gtable.

Referenced by isHighConfidence(), and TAGE_SC_L::predict().

◆ getGHR()

unsigned TAGEBase::getGHR ( ThreadID  tid,
BranchInfo bi 
) const

◆ getPathHist()

int TAGEBase::getPathHist ( ThreadID  tid) const

◆ getSizeInBits()

size_t TAGEBase::getSizeInBits ( ) const

◆ getTageCtrBits()

unsigned TAGEBase::getTageCtrBits ( ) const

Definition at line 786 of file tage_base.cc.

References tagTableCounterBits.

Referenced by isHighConfidence(), and TAGE_SC_L::predict().

◆ getUseAltIdx()

unsigned TAGEBase::getUseAltIdx ( BranchInfo bi,
Addr  branch_pc 
)
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 345 of file tage_base.cc.

Referenced by condBranchUpdate(), tagePredict(), and TAGEBase::BranchInfo::~BranchInfo().

◆ gindex()

int TAGEBase::gindex ( ThreadID  tid,
Addr  pc,
int  bank 
) const
virtual

Computes the index used to access a partially tagged table.

Parameters
tidThe thread ID used to select the global histories to use.
pcThe unshifted branch PC.
bankThe partially tagged table to access.

Reimplemented in TAGE_SC_L_TAGE.

Definition at line 222 of file tage_base.cc.

References F(), histLengths, MipsISA::index, instShiftAmt, logTagTableSizes, pathHistBits, threadHistory, and ULL.

Referenced by calculateIndicesAndTags(), and TAGEBase::BranchInfo::~BranchInfo().

◆ gtag()

uint16_t TAGEBase::gtag ( ThreadID  tid,
Addr  pc,
int  bank 
) const
virtual

Computes the partial tag of a tagged table.

Parameters
tidthe thread ID used to select the global histories to use.
pcThe unshifted branch PC.
bankThe 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 240 of file tage_base.cc.

References instShiftAmt, tagTableTagWidths, threadHistory, and ULL.

Referenced by calculateIndicesAndTags(), and TAGEBase::BranchInfo::~BranchInfo().

◆ handleAllocAndUReset()

void TAGEBase::handleAllocAndUReset ( bool  alloc,
bool  taken,
BranchInfo bi,
int  nrand 
)
virtual

◆ handleTAGEUpdate()

void TAGEBase::handleTAGEUpdate ( Addr  branch_pc,
bool  taken,
BranchInfo bi 
)
virtual

◆ handleUReset()

void TAGEBase::handleUReset ( )
virtual

Handles the U bits reset.

Reimplemented in TAGE_SC_L_TAGE, and MPP_TAGE.

Definition at line 485 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().

◆ init()

void TAGEBase::init ( )
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 80 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().

◆ initFoldedHistories()

void TAGEBase::initFoldedHistories ( ThreadHistory history)
protectedvirtual

◆ isHighConfidence()

virtual bool TAGEBase::isHighConfidence ( BranchInfo bi) const
inlinevirtual

◆ isSpeculativeUpdateEnabled()

bool TAGEBase::isSpeculativeUpdateEnabled ( ) const

◆ makeBranchInfo()

TAGEBase::BranchInfo * TAGEBase::makeBranchInfo ( )
virtual

Reimplemented in TAGE_SC_L_TAGE.

Definition at line 75 of file tage_base.cc.

Referenced by TAGEBase::BranchInfo::~BranchInfo().

◆ regStats()

void TAGEBase::regStats ( )
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 716 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.

◆ resetUctr()

void TAGEBase::resetUctr ( uint8_t &  u)
virtual

Algorithm for resetting a single U counter.

Reimplemented in MPP_TAGE, and TAGE_SC_L_TAGE_8KB.

Definition at line 500 of file tage_base.cc.

Referenced by handleUReset(), and TAGEBase::BranchInfo::~BranchInfo().

◆ squash()

void TAGEBase::squash ( ThreadID  tid,
bool  taken,
TAGEBase::BranchInfo bi,
Addr  target 
)
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.

Parameters
tidThe Thread ID to select the histories to rollback.
takenThe correct branch outcome.
bp_historyWrapping pointer to BranchInfo (to allow storing derived class prediction information in the base class).
targetThe correct branch target
Postcondition
bp_history points to valid memory.

Reimplemented in TAGE_SC_L_TAGE.

Definition at line 621 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().

◆ tagePredict()

bool TAGEBase::tagePredict ( ThreadID  tid,
Addr  branch_pc,
bool  cond_branch,
BranchInfo bi 
)

◆ unsignedCtrUpdate()

void TAGEBase::unsignedCtrUpdate ( uint8_t &  ctr,
bool  up,
unsigned  nbits 
)
static

Updates an unsigned counter based on up/down parameter.

Parameters
ctrReference to counter to update.
upBoolean indicating if the counter is incremented/decremented If true it is incremented, if false it is decremented
nbitsCounter width.

Definition at line 271 of file tage_base.cc.

Referenced by handleTAGEUpdate(), and TAGEBase::BranchInfo::~BranchInfo().

◆ update()

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.

Parameters
tidThe thread ID to select the global histories to use.
branch_pcThe unshifted branch PC.
takenActual branch outcome.
biPointer to information on the prediction recorded at prediction time.

Referenced by TAGEBase::BranchInfo::~BranchInfo(), and MultiperspectivePerceptronTAGE::MPPTAGEBranchInfo::~MPPTAGEBranchInfo().

◆ updateGHist()

void TAGEBase::updateGHist ( uint8_t *&  h,
bool  dir,
uint8_t *  tab,
int &  PT 
)

(Speculatively) updates the global branch history.

Parameters
hReference to pointer to global branch history.
dir(Predicted) outcome to update the histories with.
tab
PTReference to path history.

Definition at line 314 of file tage_base.cc.

References DPRINTF, histBufferSize, ArmISA::i, and maxHist.

Referenced by updateHistories(), MPP_TAGE::updatePathAndGlobalHistory(), and TAGEBase::BranchInfo::~BranchInfo().

◆ updateHistories()

void TAGEBase::updateHistories ( ThreadID  tid,
Addr  branch_pc,
bool  taken,
BranchInfo b,
bool  speculative,
const StaticInstPtr inst = StaticInst::nullStaticInstPtr,
Addr  target = MaxAddr 
)
virtual

(Speculatively) updates global histories (path and direction).

Also recomputes compressed (folded) histories based on the branch direction.

Parameters
tidThe thread ID to select the histories to update.
branch_pcThe unshifted branch PC.
taken(Predicted) branch direction.
bWrapping 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 580 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().

◆ updateStats()

void TAGEBase::updateStats ( bool  taken,
BranchInfo bi 
)
virtual

Member Data Documentation

◆ bimodalAltMatchProviderCorrect

Stats::Scalar TAGEBase::bimodalAltMatchProviderCorrect
protected

Definition at line 489 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ bimodalAltMatchProviderWrong

Stats::Scalar TAGEBase::bimodalAltMatchProviderWrong
protected

Definition at line 493 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ btableHysteresis

std::vector<bool> TAGEBase::btableHysteresis
protected

Definition at line 430 of file tage_base.hh.

Referenced by baseUpdate(), init(), and MPP_TAGE::isHighConfidence().

◆ btablePrediction

std::vector<bool> TAGEBase::btablePrediction
protected

Definition at line 429 of file tage_base.hh.

Referenced by baseUpdate(), getBimodePred(), init(), and MPP_TAGE::isHighConfidence().

◆ gtable

TageEntry** TAGEBase::gtable
protected

◆ histBufferSize

const unsigned TAGEBase::histBufferSize
protected

Definition at line 421 of file tage_base.hh.

Referenced by getGHR(), init(), and updateGHist().

◆ histLengths

int* TAGEBase::histLengths
protected

◆ initialized

bool TAGEBase::initialized
protected

Definition at line 484 of file tage_base.hh.

Referenced by init().

◆ initialTCounterValue

const int64_t TAGEBase::initialTCounterValue
protected

Definition at line 470 of file tage_base.hh.

Referenced by init().

◆ instShiftAmt

const unsigned TAGEBase::instShiftAmt
protected

Definition at line 482 of file tage_base.hh.

Referenced by bindex(), gindex(), gtag(), and updateHistories().

◆ logRatioBiModalHystEntries

const unsigned TAGEBase::logRatioBiModalHystEntries
protected

Definition at line 417 of file tage_base.hh.

Referenced by baseUpdate(), getSizeInBits(), init(), and MPP_TAGE::isHighConfidence().

◆ logTagTableSizes

std::vector<int> TAGEBase::logTagTableSizes
protected

◆ logUResetPeriod

uint64_t TAGEBase::logUResetPeriod
protected

Definition at line 469 of file tage_base.hh.

Referenced by getSizeInBits(), MPP_TAGE::handleUReset(), handleUReset(), and init().

◆ maxHist

const unsigned TAGEBase::maxHist
protected

Definition at line 423 of file tage_base.hh.

Referenced by calculateParameters(), init(), and updateGHist().

◆ maxNumAlloc

unsigned TAGEBase::maxNumAlloc
protected

Definition at line 473 of file tage_base.hh.

Referenced by handleAllocAndUReset().

◆ minHist

const unsigned TAGEBase::minHist
protected

Definition at line 422 of file tage_base.hh.

Referenced by calculateParameters().

◆ nHistoryTables

const unsigned TAGEBase::nHistoryTables
protected

◆ noSkip

std::vector<bool> TAGEBase::noSkip
protected

Definition at line 478 of file tage_base.hh.

Referenced by MPP_TAGE::handleAllocAndUReset(), TAGEBase(), and tagePredict().

◆ numUseAltOnNa

unsigned TAGEBase::numUseAltOnNa
protected

Definition at line 471 of file tage_base.hh.

Referenced by getSizeInBits(), MPP_TAGE::getUseAltIdx(), and init().

◆ pathHistBits

const unsigned TAGEBase::pathHistBits
protected

Definition at line 424 of file tage_base.hh.

Referenced by getSizeInBits(), gindex(), init(), and updateHistories().

◆ speculativeHistUpdate

const bool TAGEBase::speculativeHistUpdate
protected

◆ tableIndices

int* TAGEBase::tableIndices
protected

Definition at line 464 of file tage_base.hh.

Referenced by calculateIndicesAndTags(), init(), and tagePredict().

◆ tableTags

int* TAGEBase::tableTags
protected

Definition at line 465 of file tage_base.hh.

Referenced by calculateIndicesAndTags(), init(), and tagePredict().

◆ tageAltMatchProvider

Stats::Vector TAGEBase::tageAltMatchProvider
protected

Definition at line 499 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageAltMatchProviderCorrect

Stats::Scalar TAGEBase::tageAltMatchProviderCorrect
protected

Definition at line 488 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageAltMatchProviderWouldHaveHit

Stats::Scalar TAGEBase::tageAltMatchProviderWouldHaveHit
protected

Definition at line 495 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageAltMatchProviderWrong

Stats::Scalar TAGEBase::tageAltMatchProviderWrong
protected

Definition at line 492 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageBimodalProviderCorrect

Stats::Scalar TAGEBase::tageBimodalProviderCorrect
protected

Definition at line 490 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageBimodalProviderWrong

Stats::Scalar TAGEBase::tageBimodalProviderWrong
protected

Definition at line 494 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageLongestMatchProvider

Stats::Vector TAGEBase::tageLongestMatchProvider
protected

Definition at line 498 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageLongestMatchProviderCorrect

Stats::Scalar TAGEBase::tageLongestMatchProviderCorrect
protected

Definition at line 487 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageLongestMatchProviderWouldHaveHit

Stats::Scalar TAGEBase::tageLongestMatchProviderWouldHaveHit
protected

Definition at line 496 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tageLongestMatchProviderWrong

Stats::Scalar TAGEBase::tageLongestMatchProviderWrong
protected

Definition at line 491 of file tage_base.hh.

Referenced by regStats(), and updateStats().

◆ tagTableCounterBits

const unsigned TAGEBase::tagTableCounterBits
protected

◆ tagTableTagWidths

std::vector<unsigned> TAGEBase::tagTableTagWidths
protected

Definition at line 426 of file tage_base.hh.

Referenced by getSizeInBits(), gtag(), init(), and initFoldedHistories().

◆ tagTableUBits

const unsigned TAGEBase::tagTableUBits
protected

Definition at line 420 of file tage_base.hh.

Referenced by getSizeInBits(), MPP_TAGE::handleTAGEUpdate(), handleTAGEUpdate(), and init().

◆ tCounter

int64_t TAGEBase::tCounter
protected

◆ threadHistory

std::vector<ThreadHistory> TAGEBase::threadHistory
protected

◆ useAltOnNaBits

unsigned TAGEBase::useAltOnNaBits
protected

Definition at line 472 of file tage_base.hh.

Referenced by condBranchUpdate(), and getSizeInBits().

◆ useAltPredForNewlyAllocated

std::vector<int8_t> TAGEBase::useAltPredForNewlyAllocated
protected

Definition at line 467 of file tage_base.hh.

Referenced by condBranchUpdate(), init(), and tagePredict().


The documentation for this class was generated from the following files:

Generated on Thu May 28 2020 16:21:52 for gem5 by doxygen 1.8.13