gem5 v24.1.0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
gem5::CacheEntry Class Reference

A CacheEntry is an entry containing a tag. More...

#include <cache_entry.hh>

Inheritance diagram for gem5::CacheEntry:
gem5::ReplaceableEntry gem5::compression::FrequentValues::VFTEntry gem5::prefetch::DeltaCorrelatingPredictionTables::DCPTEntry

Public Types

using IndexingPolicy = BaseIndexingPolicy
 
using KeyType = Addr
 
using TagExtractor = std::function< Addr(Addr)>
 

Public Member Functions

 CacheEntry (TagExtractor ext)
 
 ~CacheEntry ()=default
 
virtual bool isValid () const
 Checks if the entry is valid.
 
virtual Addr getTag () const
 Get tag associated to this block.
 
virtual bool match (const Addr addr) const
 Checks if the given tag information corresponds to this entry's.
 
virtual void insert (const Addr addr)
 Insert the block by assigning it a tag and marking it valid.
 
virtual 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.
 

Protected Member Functions

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

Private Attributes

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

Additional Inherited Members

- Public Attributes inherited from gem5::ReplaceableEntry
std::shared_ptr< replacement_policy::ReplacementDatareplacementData
 Replacement data associated to this entry.
 
- 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

A CacheEntry is an entry containing a tag.

A tagged entry's contents are only relevant if it is marked as valid.

Definition at line 59 of file cache_entry.hh.

Member Typedef Documentation

◆ IndexingPolicy

Definition at line 62 of file cache_entry.hh.

◆ KeyType

Definition at line 63 of file cache_entry.hh.

◆ TagExtractor

using gem5::CacheEntry::TagExtractor = std::function<Addr(Addr)>

Definition at line 64 of file cache_entry.hh.

Constructor & Destructor Documentation

◆ CacheEntry()

gem5::CacheEntry::CacheEntry ( TagExtractor  ext)
inline

Definition at line 66 of file cache_entry.hh.

◆ ~CacheEntry()

gem5::CacheEntry::~CacheEntry ( )
default

Member Function Documentation

◆ getTag()

virtual Addr gem5::CacheEntry::getTag ( ) const
inlinevirtual

Get tag associated to this block.

Returns
The tag value.

Definition at line 83 of file cache_entry.hh.

References tag.

Referenced by match(), and print().

◆ insert()

virtual void gem5::CacheEntry::insert ( const Addr  addr)
inlinevirtual

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

Touches block if it hadn't been touched previously.

Parameters
addrThe address value.

Definition at line 104 of file cache_entry.hh.

References gem5::X86ISA::addr, extractTag, setTag(), and setValid().

◆ invalidate()

virtual void gem5::CacheEntry::invalidate ( )
inlinevirtual

◆ isValid()

virtual bool gem5::CacheEntry::isValid ( ) const
inlinevirtual

Checks if the entry is valid.

Returns
True if the entry is valid.

Definition at line 76 of file cache_entry.hh.

References valid.

Referenced by match(), print(), and setValid().

◆ match()

virtual bool gem5::CacheEntry::match ( const Addr  addr) const
inlinevirtual

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

Parameters
addrThe address value to be compared before tag is extracted
Returns
True if the tag information match this entry's.

Definition at line 92 of file cache_entry.hh.

References gem5::X86ISA::addr, extractTag, getTag(), and isValid().

◆ print()

std::string gem5::CacheEntry::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 119 of file cache_entry.hh.

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

◆ setTag()

virtual void gem5::CacheEntry::setTag ( Addr  _tag)
inlineprotectedvirtual

Set tag associated to this block.

Parameters
tagThe tag value.

Definition at line 131 of file cache_entry.hh.

References tag.

Referenced by insert(), and invalidate().

◆ setValid()

virtual void gem5::CacheEntry::setValid ( )
inlineprotectedvirtual

Set valid bit.

The block must be invalid beforehand.

Definition at line 135 of file cache_entry.hh.

References isValid(), and valid.

Referenced by insert().

Member Data Documentation

◆ extractTag

TagExtractor gem5::CacheEntry::extractTag
private

Callback used to extract the tag from the entry.

Definition at line 143 of file cache_entry.hh.

Referenced by insert(), and match().

◆ tag

Addr gem5::CacheEntry::tag
private

The entry's tag.

Definition at line 153 of file cache_entry.hh.

Referenced by getTag(), and setTag().

◆ valid

bool gem5::CacheEntry::valid
private

Valid bit.

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

See also
invalidate()
insert()

Definition at line 150 of file cache_entry.hh.

Referenced by invalidate(), isValid(), and setValid().


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

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