gem5
v20.1.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) | |
void | init (FALRUBlk *head, FALRUBlk *tail) |
Initialiaze cache blocks and the tracking mechanism. More... | |
void | moveBlockToHead (FALRUBlk *blk) |
Update boundaries as a block will be moved to the MRU. More... | |
void | moveBlockToTail (FALRUBlk *blk) |
Update boundaries as a block will be moved to the LRU. More... | |
void | recordAccess (FALRUBlk *blk) |
Notify of a block access. More... | |
void | check (const FALRUBlk *head, const FALRUBlk *tail) const |
Check that the tracking mechanism is in consistent state. More... | |
void | regStats (std::string name) |
Register the stats for this object. More... | |
Protected Attributes | |
Stats::Vector | hits |
Hits in each cache. More... | |
Stats::Vector | misses |
Misses in each cache. More... | |
Stats::Scalar | accesses |
Total number of accesses. More... | |
Private Attributes | |
const unsigned | blkSize |
The size of the cache block. More... | |
const unsigned | minTrackedSize |
The smallest cache we are tracking. More... | |
const int | numTrackedCaches |
The number of different size caches being tracked. More... | |
const CachesMask | inAllCachesMask |
A mask for all cache being tracked. More... | |
std::vector< FALRUBlk * > | boundaries |
Array of pointers to blocks at the cache boundaries. More... | |
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.
|
inline |
Definition at line 282 of file fa_lru.hh.
References fatal_if, and numTrackedCaches.
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 289 of file fa_lru.cc.
References blkSize, boundaries, FALRU::head, inAllCachesMask, FALRUBlk::inCachesMask, ArmISA::j, minTrackedSize, FALRUBlk::next, panic_if, and FALRU::tail.
Referenced by FALRU::moveToHead(), and 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 317 of file fa_lru.cc.
References BaseTags::blkSize, FALRU::head, FALRUBlk::inCachesMask, ArmISA::j, FALRUBlk::next, and FALRU::tail.
Referenced by FALRU::tagsInit().
void 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 344 of file fa_lru.cc.
References ArmISA::i, FALRUBlk::inCachesMask, and FALRUBlk::prev.
Referenced by FALRU::moveToHead().
void 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 370 of file fa_lru.cc.
References ArmISA::i, FALRUBlk::inCachesMask, and FALRUBlk::next.
Referenced by FALRU::moveToTail().
void 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 395 of file fa_lru.cc.
References ArmISA::i, FALRUBlk::inCachesMask, and CacheBlk::isValid().
Referenced by FALRU::accessBlock().
void FALRU::CacheTracking::regStats | ( | std::string | name | ) |
Register the stats for this object.
Definition at line 428 of file fa_lru.cc.
References ArmISA::i, SimObject::name(), and printSize().
Referenced by FALRU::regStats().
|
private |
|
private |
|
private |
|
private |
|
private |
The number of different size caches being tracked.
Definition at line 364 of file fa_lru.hh.
Referenced by CacheTracking().