gem5  v21.1.0.2
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gem5::branch_prediction::TAGEBase Class Reference

#include <tage_base.hh>

Inheritance diagram for gem5::branch_prediction::TAGEBase:
gem5::SimObject gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named gem5::branch_prediction::MPP_TAGE gem5::branch_prediction::TAGE_SC_L_TAGE gem5::branch_prediction::MPP_TAGE_8KB gem5::branch_prediction::TAGE_SC_L_TAGE_64KB gem5::branch_prediction::TAGE_SC_L_TAGE_8KB

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. 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=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 gem5::SimObject
const Paramsparams () const
 
 SimObject (const Params &p)
 
virtual ~SimObject ()
 
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...
 
- Public Member Functions inherited from gem5::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)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More...
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue. More...
 
 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. 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 gem5::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 gem5::statistics::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group. More...
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters. More...
 
virtual void resetStats ()
 Callback to reset stats. More...
 
virtual void preDumpStats ()
 Callback before stats are dumped. More...
 
void addStat (statistics::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...
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (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. 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 gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing 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 void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 

Protected Member Functions

virtual void initFoldedHistories (ThreadHistory &history)
 Initialization of the folded histories. More...
 
- Protected Member Functions inherited from gem5::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
 
gem5::branch_prediction::TAGEBase::TAGEBaseStats stats
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 65 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 118 of file tage_base.hh.

Constructor & Destructor Documentation

◆ TAGEBase()

gem5::branch_prediction::TAGEBase::TAGEBase ( const TAGEBaseParams &  p)

Definition at line 51 of file tage_base.cc.

References nHistoryTables, and noSkip.

Member Function Documentation

◆ adjustAlloc()

void gem5::branch_prediction::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 gem5::branch_prediction::TAGE_SC_L_TAGE, and gem5::branch_prediction::MPP_TAGE.

Definition at line 438 of file tage_base.cc.

Referenced by condBranchUpdate().

◆ baseUpdate()

void gem5::branch_prediction::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 302 of file tage_base.cc.

References gem5::PowerISA::bi, btableHysteresis, btablePrediction, DPRINTF, logRatioBiModalHystEntries, and gem5::MipsISA::pc.

Referenced by gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleTAGEUpdate(), gem5::branch_prediction::MPP_TAGE::handleTAGEUpdate(), and handleTAGEUpdate().

◆ bindex()

int gem5::branch_prediction::TAGEBase::bindex ( Addr  pc_in) const
virtual

Computes the index used to access the bimodal table.

Parameters
pc_inThe unshifted branch PC.

Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE, and gem5::branch_prediction::MPP_TAGE.

Definition at line 207 of file tage_base.cc.

References instShiftAmt, and logTagTableSizes.

Referenced by tagePredict().

◆ btbUpdate()

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

◆ buildTageTables()

void gem5::branch_prediction::TAGEBase::buildTageTables ( )
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().

◆ calculateIndicesAndTags()

void gem5::branch_prediction::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 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().

◆ calculateParameters()

void gem5::branch_prediction::TAGEBase::calculateParameters ( )
virtual

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

Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE, and gem5::branch_prediction::MPP_TAGE.

Definition at line 174 of file tage_base.cc.

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

Referenced by init().

◆ condBranchUpdate()

void gem5::branch_prediction::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. @nrand 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 514 of file tage_base.cc.

References adjustAlloc(), gem5::PowerISA::bi, ctrUpdate(), getUseAltIdx(), handleAllocAndUReset(), handleTAGEUpdate(), nHistoryTables, useAltOnNaBits, and useAltPredForNewlyAllocated.

Referenced by gem5::branch_prediction::LTAGE::update(), gem5::branch_prediction::TAGE::update(), gem5::branch_prediction::TAGE_SC_L::update(), and gem5::branch_prediction::MultiperspectivePerceptronTAGE::update().

◆ ctrUpdate()

template<typename T >
template void gem5::branch_prediction::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 261 of file tage_base.cc.

Referenced by condBranchUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleTAGEUpdate(), gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleTAGEUpdate(), gem5::branch_prediction::MPP_TAGE::handleTAGEUpdate(), and handleTAGEUpdate().

◆ extraAltCalc()

void gem5::branch_prediction::TAGEBase::extraAltCalc ( BranchInfo bi)
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().

◆ F()

int gem5::branch_prediction::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 gem5::branch_prediction::TAGE_SC_L_TAGE.

Definition at line 213 of file tage_base.cc.

References logTagTableSizes.

Referenced by gindex().

◆ getBimodePred()

bool gem5::branch_prediction::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 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().

◆ getCtr()

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

◆ getGHR()

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

◆ getPathHist()

int gem5::branch_prediction::TAGEBase::getPathHist ( ThreadID  tid) const

◆ getSizeInBits()

size_t gem5::branch_prediction::TAGEBase::getSizeInBits ( ) const

◆ getTageCtrBits()

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

◆ getUseAltIdx()

unsigned gem5::branch_prediction::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 gem5::branch_prediction::TAGE_SC_L_TAGE, and gem5::branch_prediction::MPP_TAGE.

Definition at line 353 of file tage_base.cc.

Referenced by condBranchUpdate(), and tagePredict().

◆ gindex()

int gem5::branch_prediction::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 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().

◆ gtag()

uint16_t gem5::branch_prediction::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 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().

◆ handleAllocAndUReset()

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

◆ handleTAGEUpdate()

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

◆ handleUReset()

void gem5::branch_prediction::TAGEBase::handleUReset ( )
virtual

◆ init()

void gem5::branch_prediction::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 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().

◆ initFoldedHistories()

void gem5::branch_prediction::TAGEBase::initFoldedHistories ( ThreadHistory history)
protectedvirtual

◆ isHighConfidence()

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

◆ isSpeculativeUpdateEnabled()

bool gem5::branch_prediction::TAGEBase::isSpeculativeUpdateEnabled ( ) const

◆ makeBranchInfo()

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

Reimplemented in gem5::branch_prediction::TAGE_SC_L_TAGE.

Definition at line 82 of file tage_base.cc.

◆ resetUctr()

void gem5::branch_prediction::TAGEBase::resetUctr ( uint8_t &  u)
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().

◆ squash()

void gem5::branch_prediction::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 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::TAGE::update(), gem5::branch_prediction::TAGE_SC_L::update(), and gem5::branch_prediction::MultiperspectivePerceptronTAGE::update().

◆ tagePredict()

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

◆ unsignedCtrUpdate()

void gem5::branch_prediction::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 279 of file tage_base.cc.

References gem5::ArmISA::up.

Referenced by handleTAGEUpdate().

◆ update()

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.

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.

◆ updateGHist()

void gem5::branch_prediction::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 322 of file tage_base.cc.

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

Referenced by updateHistories(), gem5::branch_prediction::MPP_TAGE::updatePathAndGlobalHistory(), and gem5::branch_prediction::TAGE_SC_L_TAGE::updatePathAndGlobalHistory().

◆ updateHistories()

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

◆ updateStats()

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

Member Data Documentation

◆ btableHysteresis

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

◆ btablePrediction

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

◆ gtable

TageEntry** gem5::branch_prediction::TAGEBase::gtable
protected

◆ histBufferSize

const unsigned gem5::branch_prediction::TAGEBase::histBufferSize
protected

Definition at line 428 of file tage_base.hh.

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

◆ histLengths

int* gem5::branch_prediction::TAGEBase::histLengths
protected

◆ initialized

bool gem5::branch_prediction::TAGEBase::initialized
protected

Definition at line 492 of file tage_base.hh.

Referenced by init().

◆ initialTCounterValue

const int64_t gem5::branch_prediction::TAGEBase::initialTCounterValue
protected

Definition at line 478 of file tage_base.hh.

Referenced by init().

◆ instShiftAmt

const unsigned gem5::branch_prediction::TAGEBase::instShiftAmt
protected

◆ logRatioBiModalHystEntries

const unsigned gem5::branch_prediction::TAGEBase::logRatioBiModalHystEntries
protected

◆ logTagTableSizes

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

◆ logUResetPeriod

uint64_t gem5::branch_prediction::TAGEBase::logUResetPeriod
protected

◆ maxHist

const unsigned gem5::branch_prediction::TAGEBase::maxHist
protected

◆ maxNumAlloc

unsigned gem5::branch_prediction::TAGEBase::maxNumAlloc
protected

◆ minHist

const unsigned gem5::branch_prediction::TAGEBase::minHist
protected

◆ nHistoryTables

const unsigned gem5::branch_prediction::TAGEBase::nHistoryTables
protected

◆ noSkip

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

◆ numUseAltOnNa

unsigned gem5::branch_prediction::TAGEBase::numUseAltOnNa
protected

◆ pathHistBits

const unsigned gem5::branch_prediction::TAGEBase::pathHistBits
protected

◆ speculativeHistUpdate

const bool gem5::branch_prediction::TAGEBase::speculativeHistUpdate
protected

◆ stats

gem5::branch_prediction::TAGEBase::TAGEBaseStats gem5::branch_prediction::TAGEBase::stats
protected

Referenced by updateStats().

◆ tableIndices

int* gem5::branch_prediction::TAGEBase::tableIndices
protected

◆ tableTags

int* gem5::branch_prediction::TAGEBase::tableTags
protected

◆ tagTableCounterBits

const unsigned gem5::branch_prediction::TAGEBase::tagTableCounterBits
protected

◆ tagTableTagWidths

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

◆ tagTableUBits

const unsigned gem5::branch_prediction::TAGEBase::tagTableUBits
protected

◆ tCounter

int64_t gem5::branch_prediction::TAGEBase::tCounter
protected

◆ threadHistory

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

◆ useAltOnNaBits

unsigned gem5::branch_prediction::TAGEBase::useAltOnNaBits
protected

Definition at line 480 of file tage_base.hh.

Referenced by condBranchUpdate(), and getSizeInBits().

◆ useAltPredForNewlyAllocated

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

Definition at line 475 of file tage_base.hh.

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


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

Generated on Tue Sep 21 2021 12:28:49 for gem5 by doxygen 1.8.17