gem5 v24.1.0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
gem5::branch_prediction::BTBEntry Class Reference
Inheritance diagram for gem5::branch_prediction::BTBEntry:
gem5::ReplaceableEntry

Public Types

using IndexingPolicy = gem5::BTBIndexingPolicy
 
using KeyType = gem5::BTBTagType::KeyType
 
using TagExtractor = std::function< Addr(Addr)>
 

Public Member Functions

 BTBEntry (TagExtractor ext)
 Default constructor.
 
void update (const PCStateBase &_target, StaticInstPtr _inst)
 Update the target and instruction in the BTB entry.
 
bool match (const KeyType &key) const
 Checks if the given tag information corresponds to this entry's.
 
void insert (const KeyType &key)
 Insert the block by assigning it a tag and marking it valid.
 
 BTBEntry (const BTBEntry &other)
 Copy constructor.
 
BTBEntryoperator= (const BTBEntry &other)
 Assignment operator.
 
bool isValid () const
 Checks if the entry is valid.
 
KeyType getTag () const
 Get tag associated to this block.
 
void invalidate ()
 Invalidate the block.
 
std::string print () const override
 Prints relevant information about this entry.
 
- Public Member Functions inherited from gem5::ReplaceableEntry
 ReplaceableEntry ()
 
virtual ~ReplaceableEntry ()=default
 
virtual void setPosition (const uint32_t set, const uint32_t way)
 Set both the set and way.
 
uint32_t getSet () const
 Get set number.
 
uint32_t getWay () const
 Get way number.
 

Public Attributes

std::unique_ptr< PCStateBasetarget
 The entry's target.
 
StaticInstPtr inst
 Pointer to the static branch inst at this address.
 
- Public Attributes inherited from gem5::ReplaceableEntry
std::shared_ptr< replacement_policy::ReplacementDatareplacementData
 Replacement data associated to this entry.
 

Protected Member Functions

void setTag (KeyType _tag)
 Set tag associated to this block.
 
void setValid ()
 Set valid bit.
 

Private Attributes

TagExtractor extractTag
 Callback used to extract the tag from the entry.
 
bool valid
 Valid bit.
 
KeyType tag
 The entry's tag.
 

Additional Inherited Members

- Protected Attributes inherited from gem5::ReplaceableEntry
uint32_t _set
 Set to which this entry belongs.
 
uint32_t _way
 Way (relative position within the set) to which this entry belongs.
 

Detailed Description

Definition at line 145 of file btb_entry.hh.

Member Typedef Documentation

◆ IndexingPolicy

Definition at line 148 of file btb_entry.hh.

◆ KeyType

Definition at line 149 of file btb_entry.hh.

◆ TagExtractor

Definition at line 150 of file btb_entry.hh.

Constructor & Destructor Documentation

◆ BTBEntry() [1/2]

gem5::branch_prediction::BTBEntry::BTBEntry ( TagExtractor  ext)
inline

Default constructor.

Definition at line 153 of file btb_entry.hh.

References gem5::MaxAddr.

◆ BTBEntry() [2/2]

gem5::branch_prediction::BTBEntry::BTBEntry ( const BTBEntry other)
inline

Copy constructor.

Definition at line 190 of file btb_entry.hh.

References extractTag, inst, gem5::ArmISA::set, tag, target, and valid.

Member Function Documentation

◆ getTag()

KeyType gem5::branch_prediction::BTBEntry::getTag ( ) const
inline

Get tag associated to this block.

Definition at line 219 of file btb_entry.hh.

◆ insert()

void gem5::branch_prediction::BTBEntry::insert ( const KeyType key)
inline

Insert the block by assigning it a tag and marking it valid.

Touches block if it hadn't been touched previously.

Definition at line 183 of file btb_entry.hh.

References gem5::BTBTagType::KeyType::address, and gem5::BTBTagType::KeyType::tid.

◆ invalidate()

void gem5::branch_prediction::BTBEntry::invalidate ( )
inline

Invalidate the block.

Its contents are no longer valid.

Definition at line 223 of file btb_entry.hh.

References gem5::MaxAddr.

◆ isValid()

bool gem5::branch_prediction::BTBEntry::isValid ( ) const
inline

Checks if the entry is valid.

Definition at line 214 of file btb_entry.hh.

◆ match()

bool gem5::branch_prediction::BTBEntry::match ( const KeyType key) const
inline

Checks if the given tag information corresponds to this entry's.

Definition at line 172 of file btb_entry.hh.

References gem5::BTBTagType::KeyType::address, and gem5::BTBTagType::KeyType::tid.

◆ operator=()

BTBEntry & gem5::branch_prediction::BTBEntry::operator= ( const BTBEntry other)
inline

Assignment operator.

Definition at line 200 of file btb_entry.hh.

References extractTag, inst, gem5::ArmISA::set, tag, target, and valid.

◆ print()

std::string gem5::branch_prediction::BTBEntry::print ( ) const
inlineoverridevirtual

Prints relevant information about this entry.

Returns
A string containg the contents of this entry.

Reimplemented from gem5::ReplaceableEntry.

Definition at line 236 of file btb_entry.hh.

References gem5::csprintf(), and gem5::ReplaceableEntry::print().

◆ setTag()

void gem5::branch_prediction::BTBEntry::setTag ( KeyType  _tag)
inlineprotected

Set tag associated to this block.

Definition at line 246 of file btb_entry.hh.

◆ setValid()

void gem5::branch_prediction::BTBEntry::setValid ( )
inlineprotected

Set valid bit.

The block must be invalid beforehand.

Definition at line 250 of file btb_entry.hh.

◆ update()

void gem5::branch_prediction::BTBEntry::update ( const PCStateBase _target,
StaticInstPtr  _inst 
)
inline

Update the target and instruction in the BTB entry.

During insertion, only the tag (key) is updated.

Definition at line 161 of file btb_entry.hh.

References gem5::ArmISA::set.

Referenced by gem5::branch_prediction::SimpleBTB::update().

Member Data Documentation

◆ extractTag

TagExtractor gem5::branch_prediction::BTBEntry::extractTag
private

Callback used to extract the tag from the entry.

Definition at line 258 of file btb_entry.hh.

Referenced by BTBEntry(), and operator=().

◆ inst

StaticInstPtr gem5::branch_prediction::BTBEntry::inst

Pointer to the static branch inst at this address.

Definition at line 233 of file btb_entry.hh.

Referenced by BTBEntry(), gem5::branch_prediction::SimpleBTB::getInst(), and operator=().

◆ tag

KeyType gem5::branch_prediction::BTBEntry::tag
private

The entry's tag.

Definition at line 268 of file btb_entry.hh.

Referenced by BTBEntry(), and operator=().

◆ target

std::unique_ptr<PCStateBase> gem5::branch_prediction::BTBEntry::target

The entry's target.

Definition at line 230 of file btb_entry.hh.

Referenced by BTBEntry(), gem5::branch_prediction::SimpleBTB::lookup(), and operator=().

◆ valid

bool gem5::branch_prediction::BTBEntry::valid
private

Valid bit.

The contents of this entry are only valid if this bit is set.

See also
invalidate()
insert()

Definition at line 265 of file btb_entry.hh.

Referenced by BTBEntry(), and operator=().


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

Generated on Mon Jan 13 2025 04:29:04 for gem5 by doxygen 1.9.8