gem5  v20.1.0.0
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  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 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=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 Paramsparams () 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...
 
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 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 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 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 (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)
 Serializes all the SimObjects. More...
 
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
 
TAGEBase::TAGEBaseStats stats
 
- 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 111 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.

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 432 of file tage_base.cc.

Referenced by condBranchUpdate().

◆ 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 296 of file tage_base.cc.

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

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

◆ 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 201 of file tage_base.cc.

References instShiftAmt, logTagTableSizes, and ULL.

Referenced by tagePredict().

◆ 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 160 of file tage_base.cc.

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

Referenced by init().

◆ 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 334 of file tage_base.cc.

References PowerISA::bi, gindex(), gtag(), ArmISA::i, nHistoryTables, tableIndices, and tableTags.

Referenced by tagePredict().

◆ 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 168 of file tage_base.cc.

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

Referenced by init().

◆ 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. @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 508 of file tage_base.cc.

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

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

◆ 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 255 of file tage_base.cc.

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

◆ 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 649 of file tage_base.cc.

Referenced by tagePredict().

◆ 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 207 of file tage_base.cc.

References logTagTableSizes, and ULL.

Referenced by gindex().

◆ 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 287 of file tage_base.cc.

References PowerISA::bi, and btablePrediction.

Referenced by TAGE_SC_L_TAGE::getBimodePred(), and tagePredict().

◆ getCtr()

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

Definition at line 754 of file tage_base.cc.

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

Referenced by TAGE_SC_L::predict().

◆ getGHR()

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

Definition at line 705 of file tage_base.cc.

References PowerISA::bi, histBufferSize, ArmISA::i, threadHistory, and X86ISA::val.

◆ getPathHist()

int TAGEBase::getPathHist ( ThreadID  tid) const

◆ getSizeInBits()

size_t TAGEBase::getSizeInBits ( ) const

◆ getTageCtrBits()

unsigned TAGEBase::getTageCtrBits ( ) const

Definition at line 760 of file tage_base.cc.

References tagTableCounterBits.

Referenced by 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 347 of file tage_base.cc.

Referenced by condBranchUpdate(), and tagePredict().

◆ 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 224 of file tage_base.cc.

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

Referenced by calculateIndicesAndTags().

◆ 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 242 of file tage_base.cc.

References instShiftAmt, MipsISA::pc, tagTableTagWidths, threadHistory, and ULL.

Referenced by calculateIndicesAndTags().

◆ 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 487 of file tage_base.cc.

References gtable, ArmISA::i, ArmISA::j, logTagTableSizes, logUResetPeriod, nHistoryTables, resetUctr(), tCounter, ArmISA::u, and ULL.

Referenced by handleAllocAndUReset().

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

◆ initFoldedHistories()

void TAGEBase::initFoldedHistories ( ThreadHistory history)
protectedvirtual

◆ isHighConfidence()

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

Reimplemented in MPP_TAGE.

Definition at line 402 of file tage_base.hh.

Referenced by MultiperspectivePerceptronTAGE::lookup().

◆ isSpeculativeUpdateEnabled()

bool TAGEBase::isSpeculativeUpdateEnabled ( ) const

◆ makeBranchInfo()

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

Reimplemented in TAGE_SC_L_TAGE.

Definition at line 76 of file tage_base.cc.

◆ 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 502 of file tage_base.cc.

References ArmISA::u.

Referenced by TAGE_SC_L_TAGE::handleUReset(), and handleUReset().

◆ 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 623 of file tage_base.cc.

References PowerISA::bi, TAGEBase::FoldedHistory::comp, TAGEBase::ThreadHistory::computeIndices, TAGEBase::ThreadHistory::computeTags, DPRINTF, TAGEBase::ThreadHistory::gHist, TAGEBase::ThreadHistory::globalHistory, ArmISA::i, nHistoryTables, TAGEBase::ThreadHistory::pathHist, TAGEBase::ThreadHistory::ptGhist, speculativeHistUpdate, threadHistory, and TAGEBase::FoldedHistory::update().

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

◆ tagePredict()

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

TAGE prediction called from TAGE::predict.

Parameters
tidThe thread ID to select the global histories to use.
branch_pcThe unshifted branch PC.
cond_branchTrue if the branch is conditional.
biPointer to the BranchInfo

Definition at line 354 of file tage_base.cc.

References PowerISA::bi, BIMODAL_ALT_MATCH, BIMODAL_ONLY, bindex(), calculateIndicesAndTags(), TAGEBase::TageEntry::ctr, DPRINTF, extraAltCalc(), getBimodePred(), getUseAltIdx(), gtable, ArmISA::i, nHistoryTables, noSkip, MipsISA::pc, tableIndices, tableTags, TAGE_ALT_MATCH, TAGE_LONGEST_MATCH, and useAltPredForNewlyAllocated.

Referenced by MultiperspectivePerceptronTAGE::lookup(), TAGE::predict(), LTAGE::predict(), and TAGE_SC_L::predict().

◆ 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 273 of file tage_base.cc.

References ArmISA::up.

Referenced by handleTAGEUpdate().

◆ 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.

◆ 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 316 of file tage_base.cc.

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

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

◆ 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 582 of file tage_base.cc.

References PowerISA::bi, TAGEBase::FoldedHistory::comp, TAGEBase::ThreadHistory::computeIndices, TAGEBase::ThreadHistory::computeTags, DPRINTF, TAGEBase::ThreadHistory::gHist, TAGEBase::ThreadHistory::globalHistory, ArmISA::i, instShiftAmt, nHistoryTables, TAGEBase::ThreadHistory::pathHist, pathHistBits, 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(), and MultiperspectivePerceptronTAGE::update().

◆ updateStats()

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

Member Data Documentation

◆ btableHysteresis

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

◆ btablePrediction

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

◆ gtable

TageEntry** TAGEBase::gtable
protected

◆ histBufferSize

const unsigned TAGEBase::histBufferSize
protected

Definition at line 420 of file tage_base.hh.

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

◆ histLengths

int* TAGEBase::histLengths
protected

◆ initialized

bool TAGEBase::initialized
protected

Definition at line 483 of file tage_base.hh.

Referenced by init().

◆ initialTCounterValue

const int64_t TAGEBase::initialTCounterValue
protected

Definition at line 469 of file tage_base.hh.

Referenced by init().

◆ instShiftAmt

const unsigned TAGEBase::instShiftAmt
protected

◆ logRatioBiModalHystEntries

const unsigned TAGEBase::logRatioBiModalHystEntries
protected

◆ logTagTableSizes

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

◆ logUResetPeriod

uint64_t TAGEBase::logUResetPeriod
protected

◆ maxHist

const unsigned TAGEBase::maxHist
protected

◆ maxNumAlloc

unsigned TAGEBase::maxNumAlloc
protected

◆ minHist

const unsigned TAGEBase::minHist
protected

Definition at line 421 of file tage_base.hh.

Referenced by TAGE_SC_L_TAGE::calculateParameters(), and calculateParameters().

◆ nHistoryTables

const unsigned TAGEBase::nHistoryTables
protected

◆ noSkip

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

◆ numUseAltOnNa

unsigned TAGEBase::numUseAltOnNa
protected

◆ pathHistBits

const unsigned TAGEBase::pathHistBits
protected

◆ speculativeHistUpdate

const bool TAGEBase::speculativeHistUpdate
protected

◆ stats

TAGEBase::TAGEBaseStats TAGEBase::stats
protected

Referenced by updateStats().

◆ tableIndices

int* TAGEBase::tableIndices
protected

◆ tableTags

int* TAGEBase::tableTags
protected

◆ tagTableCounterBits

const unsigned TAGEBase::tagTableCounterBits
protected

◆ tagTableTagWidths

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

◆ tagTableUBits

const unsigned TAGEBase::tagTableUBits
protected

◆ tCounter

int64_t TAGEBase::tCounter
protected

◆ threadHistory

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

◆ useAltOnNaBits

unsigned TAGEBase::useAltOnNaBits
protected

Definition at line 471 of file tage_base.hh.

Referenced by condBranchUpdate(), and getSizeInBits().

◆ useAltPredForNewlyAllocated

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

Definition at line 466 of file tage_base.hh.

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


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

Generated on Wed Sep 30 2020 14:02:33 for gem5 by doxygen 1.8.17