Go to the documentation of this file.
46 #ifndef __MEM_CACHE_TAGS_FA_LRU_HH__
47 #define __MEM_CACHE_TAGS_FA_LRU_HH__
52 #include <unordered_map>
63 #include "params/FALRU.hh"
99 std::string
print()
const override;
124 template <
class T1,
class T2>
127 return std::hash<T1>()(
p.first) ^ std::hash<T2>()(
p.second);
131 typedef std::unordered_map<TagHashKey, FALRUBlk *, PairHash>
TagHash;
224 const std::size_t
size,
265 if (visitor(
blks[
i])) {
292 "Not enough bits (%s) in type CachesMask type to keep "
392 #endif // __MEM_CACHE_TAGS_FA_LRU_HH__
const int numTrackedCaches
The number of different size caches being tracked.
A replaceable entry is a basic entry in a 2d table-like structure that needs to have replacement func...
CacheTracking cacheTracking
FALRUBlk * head
The MRU block.
FALRUBlk * next
The next block in LRU order.
std::string print() const override
Pretty-print inCachesMask and other CacheBlk information.
const unsigned minTrackedSize
The smallest cache we are tracking.
FALRUBlk BlkType
Typedef the block type used in this class.
std::pair< Addr, bool > TagHashKey
void recordAccess(FALRUBlk *blk)
Notify of a block access.
CachesMask inCachesMask
A bit mask of the caches that fit this block.
CacheBlk * accessBlock(Addr addr, bool is_secure, Cycles &lat, CachesMask *in_cache_mask)
Access block and update replacement data.
Stats::Vector misses
Misses in each cache.
FALRUBlk * tail
The LRU block.
void regStats(std::string name)
Register the stats for this object.
CacheTracking(unsigned min_size, unsigned max_size, unsigned block_size)
std::enable_if< std::is_integral< T >::value, int >::type floorLog2(T x)
void insertBlock(const PacketPtr pkt, CacheBlk *blk) override
Insert the new block into the cache and update replacement data.
A vector of scalar stats.
std::unordered_map< TagHashKey, FALRUBlk *, PairHash > TagHash
Mechanism that allows us to simultaneously collect miss statistics for multiple caches.
CacheBlk * findBlock(Addr addr, bool is_secure) const override
Find the block in the cache, do not update the replacement data.
This is a simple scalar statistic, like a counter.
const unsigned blkSize
The size of the cache block.
void moveToTail(FALRUBlk *blk)
Move a cache block to the LRU position.
const CachesMask inAllCachesMask
A mask for all cache being tracked.
void moveBlockToHead(FALRUBlk *blk)
Update boundaries as a block will be moved to the MRU.
A fully associative cache block.
void tagsInit() override
Initialize blocks as FALRUBlk instances.
FALRUBlk * prev
The previous block in LRU order.
CacheBlk * findVictim(Addr addr, const bool is_secure, const std::size_t size, std::vector< CacheBlk * > &evict_blks) override
Find replacement victim based on address.
bool anyBlk(std::function< bool(CacheBlk &)> visitor) override
Find if any of the blocks satisfies a condition.
void check(const FALRUBlk *head, const FALRUBlk *tail) const
Check that the tracking mechanism is in consistent state.
void moveBlockToTail(FALRUBlk *blk)
Update boundaries as a block will be moved to the LRU.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
TagHash tagHash
The address hash table.
std::vector< FALRUBlk * > boundaries
Array of pointers to blocks at the cache boundaries.
Stats::Scalar accesses
Total number of accesses.
void invalidate(CacheBlk *blk) override
Invalidate a cache block.
void forEachBlk(std::function< void(CacheBlk &)> visitor) override
Visit each block in the tags and apply a visitor.
Addr tag
Data block tag value.
Hash table type mapping addresses to cache block pointers.
virtual const std::string name() const
void init(FALRUBlk *head, FALRUBlk *tail)
Initialiaze cache blocks and the tracking mechanism.
void moveToHead(FALRUBlk *blk)
Move a cache block to the MRU position.
void regStats() override
Register the stats for this object.
FALRUBlk * blks
The cache blocks.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Cycles is a wrapper class for representing cycle counts, i.e.
std::size_t operator()(const std::pair< T1, T2 > &p) const
Addr extractTag(Addr addr) const override
Generate the tag from the addres.
A fully associative LRU cache.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
FALRU(const Params *p)
Construct and initialize this cache tagstore.
ReplaceableEntry * findBlockBySetAndWay(int set, int way) const override
Find a block given set and way.
Stats::Vector hits
Hits in each cache.
Addr regenerateBlkAddr(const CacheBlk *blk) const override
Regenerate the block address from the tag.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17