gem5 v24.0.0.0
|
Mechanism that allows us to simultaneously collect miss statistics for multiple caches. More...
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 Info * | resolveStat (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 | |
Group & | operator= (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. | |
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.
gem5::FALRU::CacheTracking::CacheTracking | ( | unsigned | min_size, |
unsigned | max_size, | ||
unsigned | block_size, | ||
statistics::Group * | parent ) |
Definition at line 302 of file fa_lru.cc.
References fatal_if, hits, gem5::ArmISA::i, gem5::statistics::VectorBase< Derived, Stor >::init(), minTrackedSize, misses, numTrackedCaches, gem5::printSize(), gem5::statistics::DataWrapVec< Derived, InfoProxyType >::subdesc(), and gem5::statistics::DataWrapVec< Derived, InfoProxyType >::subname().
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.
head | the MRU block of the actual cache |
head | the 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().
Initialiaze cache blocks and the tracking mechanism.
All blocks in the cache need to be initialized once.
blk | the MRU block |
blk | the 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().
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.
blk | the 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().
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.
blk | the 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().
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.
blk | the 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().
|
private |
|
private |
|
private |
|
private |
The smallest cache we are tracking.
Definition at line 342 of file fa_lru.hh.
Referenced by CacheTracking().
|
private |
The number of different size caches being tracked.
Definition at line 344 of file fa_lru.hh.
Referenced by CacheTracking().