gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::FALRU::CacheTracking Class Reference

Mechanism that allows us to simultaneously collect miss statistics for multiple caches. More...

Inheritance diagram for gem5::FALRU::CacheTracking:
gem5::statistics::Group

Public Member Functions

 CacheTracking (unsigned min_size, unsigned max_size, unsigned block_size, statistics::Group *parent)
 
void init (FALRUBlk *head, FALRUBlk *tail)
 Initialiaze cache blocks and the tracking mechanism.
 
void moveBlockToHead (FALRUBlk *blk)
 Update boundaries as a block will be moved to the MRU.
 
void moveBlockToTail (FALRUBlk *blk)
 Update boundaries as a block will be moved to the LRU.
 
void recordAccess (FALRUBlk *blk)
 Notify of a block access.
 
void check (const FALRUBlk *head, const FALRUBlk *tail) const
 Check that the tracking mechanism is in consistent state.
 
- Public Member Functions inherited from gem5::statistics::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group.
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters.
 
virtual void resetStats ()
 Callback to reset stats.
 
virtual void preDumpStats ()
 Callback before stats are dumped.
 
void addStat (statistics::Info *info)
 Register a stat with this group.
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object.
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object.
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block.
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group.
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block.
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 

Protected Attributes

statistics::Vector hits
 Hits in each cache.
 
statistics::Vector misses
 Misses in each cache.
 
statistics::Scalar accesses
 Total number of accesses.
 

Private Attributes

const unsigned blkSize
 The size of the cache block.
 
const unsigned minTrackedSize
 The smallest cache we are tracking.
 
const int numTrackedCaches
 The number of different size caches being tracked.
 
const CachesMask inAllCachesMask
 A mask for all cache being tracked.
 
std::vector< FALRUBlk * > boundaries
 Array of pointers to blocks at the cache boundaries.
 

Detailed Description

Mechanism that allows us to simultaneously collect miss statistics for multiple caches.

Currently, we keep track of caches from a set minimum size of interest up to the actual cache size.

Definition at line 276 of file fa_lru.hh.

Constructor & Destructor Documentation

◆ CacheTracking()

Member Function Documentation

◆ check()

void gem5::FALRU::CacheTracking::check ( const FALRUBlk * head,
const FALRUBlk * tail ) const

Check that the tracking mechanism is in consistent state.

Iterate from the head (MRU) to the tail (LRU) of the list of blocks and assert the inCachesMask and the boundaries are in consistent state.

Parameters
headthe MRU block of the actual cache
headthe LRU block of the actual cache

Definition at line 339 of file fa_lru.cc.

References gem5::BaseTags::blkSize, gem5::FALRU::head, gem5::FALRUBlk::inCachesMask, gem5::FALRUBlk::next, panic_if, and gem5::FALRU::tail.

Referenced by gem5::FALRU::moveToHead(), and gem5::FALRU::moveToTail().

◆ init()

void gem5::FALRU::CacheTracking::init ( FALRUBlk * head,
FALRUBlk * tail )

Initialiaze cache blocks and the tracking mechanism.

All blocks in the cache need to be initialized once.

Parameters
blkthe MRU block
blkthe LRU block

Definition at line 367 of file fa_lru.cc.

References gem5::BaseTags::blkSize, gem5::FALRU::head, gem5::FALRUBlk::inCachesMask, gem5::FALRUBlk::next, and gem5::FALRU::tail.

Referenced by gem5::FALRU::tagsInit().

◆ moveBlockToHead()

void gem5::FALRU::CacheTracking::moveBlockToHead ( FALRUBlk * blk)

Update boundaries as a block will be moved to the MRU.

For all caches that didn't fit the block before moving it, we move their boundaries one block closer to the MRU. We also update InCacheMasks as neccessary.

Parameters
blkthe block that will be moved to the head

Definition at line 394 of file fa_lru.cc.

References gem5::ArmISA::i, gem5::FALRUBlk::inCachesMask, and gem5::FALRUBlk::prev.

Referenced by gem5::FALRU::moveToHead().

◆ moveBlockToTail()

void gem5::FALRU::CacheTracking::moveBlockToTail ( FALRUBlk * blk)

Update boundaries as a block will be moved to the LRU.

For all caches that fitted the block before moving it, we move their boundaries one block closer to the LRU. We also update InCacheMasks as neccessary.

Parameters
blkthe block that will be moved to the head

Definition at line 420 of file fa_lru.cc.

References gem5::ArmISA::i, gem5::FALRUBlk::inCachesMask, and gem5::FALRUBlk::next.

Referenced by gem5::FALRU::moveToTail().

◆ recordAccess()

void gem5::FALRU::CacheTracking::recordAccess ( FALRUBlk * blk)

Notify of a block access.

This should be called every time a block is accessed and it updates statistics. If the input block is nullptr then we treat the access as a miss. The block's InCacheMask determines the caches in which the block fits.

Parameters
blkthe block to record the access for

Definition at line 445 of file fa_lru.cc.

References gem5::ArmISA::i, gem5::FALRUBlk::inCachesMask, and gem5::CacheEntry::isValid().

Referenced by gem5::FALRU::accessBlock().

Member Data Documentation

◆ blkSize

const unsigned gem5::FALRU::CacheTracking::blkSize
private

The size of the cache block.

Definition at line 340 of file fa_lru.hh.

◆ boundaries

std::vector<FALRUBlk*> gem5::FALRU::CacheTracking::boundaries
private

Array of pointers to blocks at the cache boundaries.

Definition at line 348 of file fa_lru.hh.

◆ inAllCachesMask

const CachesMask gem5::FALRU::CacheTracking::inAllCachesMask
private

A mask for all cache being tracked.

Definition at line 346 of file fa_lru.hh.

◆ minTrackedSize

const unsigned gem5::FALRU::CacheTracking::minTrackedSize
private

The smallest cache we are tracking.

Definition at line 342 of file fa_lru.hh.

Referenced by CacheTracking().

◆ numTrackedCaches

const int gem5::FALRU::CacheTracking::numTrackedCaches
private

The number of different size caches being tracked.

Definition at line 344 of file fa_lru.hh.

Referenced by CacheTracking().


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

Generated on Tue Jun 18 2024 16:24:11 for gem5 by doxygen 1.11.0