48 #ifndef __MEM_CACHE_TAGS_FA_LRU_HH__
49 #define __MEM_CACHE_TAGS_FA_LRU_HH__
52 #include <unordered_map>
58 #include "params/FALRU.hh"
111 typedef std::unordered_map<Addr, FALRUBlk *, std::hash<Addr> >
hash_t;
258 virtual std::string
print()
const override {
return ""; }
274 if (!visitor(
blks[
i]))
281 #endif // __MEM_CACHE_TAGS_FA_LRU_HH__
Declares a basic cache interface BaseCache.
FALRU(const Params *p)
Construct and initialize this cache tagstore.
Cycles is a wrapper class for representing cycle counts, i.e.
CacheBlk * findVictim(Addr addr) override
Find a replacement block for the address provided.
FALRUBlk * head
The MRU block.
A fully associative LRU cache.
CacheBlk * findBlock(Addr addr, bool is_secure) const override
Find the block in the cache, do not update the replacement data.
A vector of scalar stats.
FALRUBlk * next
The next block in LRU order.
void insertBlock(PacketPtr pkt, CacheBlk *blk) override
int cacheMask
A mask for the FALRUBlk::inCache bits.
This is a simple scalar statistic, like a counter.
FALRUBlk ** cacheBoundaries
Array of pointers to blocks at the cache size boundaries.
FALRUBlk * tail
The LRU block.
A fully associative cache block.
std::unordered_map< Addr, FALRUBlk *, std::hash< Addr > > hash_t
Hash table type mapping addresses to cache block pointers.
Stats::Vector hits
Hits in each cache size >= 128K.
void invalidate(CacheBlk *blk) override
Invalidate a cache block.
void forEachBlk(CacheBlkVisitor &visitor) override
Visit each block in the tag store and apply a visitor to the block.
Addr regenerateBlkAddr(Addr tag, unsigned set) const override
Regenerate the block address from the tag and the set.
unsigned numCaches
The number of different size caches being tracked.
hash_t tagHash
The address hash table.
void moveToHead(FALRUBlk *blk)
Move a cache block to the MRU position.
Definitions of a simple cache block class.
Stats::Scalar accesses
Total number of accesses.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Stats::Vector misses
Misses in each cache size >= 128K.
int inCache
A bit mask of the sizes of cache that this block is resident in.
void regStats() override
Register the stats for this object.
Declaration of the Packet class.
bool isTouched
Has this block been touched?
Addr extractTag(Addr addr) const override
Generate the tag from the addres.
CacheBlk * accessBlock(Addr addr, bool is_secure, Cycles &lat, int *inCache)
Access block and update replacement data.
FALRUBlk * blks
The cache blocks.
virtual std::string print() const override
FALRUBlk * prev
The previous block in LRU order.
FALRUBlk * hashLookup(Addr addr) const
Find the cache block for the given address.
int extractSet(Addr addr) const override
Return the set of an address.
hash_t::const_iterator tagIterator
Iterator into the address hash table.
FALRUBlk BlkType
Typedef the block type used in this class.
Base class for cache block visitor, operating on the cache block base class (later subclassed for the...
bool check()
Check to make sure all the cache boundaries are still where they should be.
CacheBlk * findBlockBySetAndWay(int set, int way) const override
Find the cache block given set and way.