59 :
BaseTags(p), cacheBoundaries(nullptr)
62 fatal(
"cache block size (in bytes) `%d' must be a power of two",
65 fatal(
"Cache Size must be power of 2 for now");
109 assert(index == numBlocks);
124 using namespace Stats;
129 .
desc(
"The number of hits in each cache size.")
134 .
desc(
"The number of misses in each cache size.")
138 .
desc(
"The number of accesses to the FA LRU cache.")
142 stringstream size_str;
144 size_str << (1<<(
i+7)) <<
"K";
146 size_str << (1<<(
i-3)) <<
"M";
150 hits.
subdesc(
i,
"Hits in a " + size_str.str() +
" cache");
161 return (*iter).second;
183 int tmp_in_cache = 0;
198 assert(blk->
tag == blkAddr);
220 *inCache = tmp_in_cache;
235 assert(blk->
tag == blkAddr);
281 if ((1<<
i) & updateMask) {
291 assert(blk->
next ==
nullptr);
310 int boundary = 1<<17;
318 if (tot_size == boundary && blk !=
tail) {
323 boundary = boundary<<1;
332 FALRUParams::create()
334 return new FALRU(
this);
Counter value() const
Return the current value of this stat as its base type.
FALRU(const Params *p)
Construct and initialize this cache tagstore.
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation...
Cycles is a wrapper class for representing cycle counts, i.e.
Tick whenReady
Which curTick() will this block be accessable.
CacheBlk * findVictim(Addr addr) override
Find a replacement block for the address provided.
Addr tag
Data block tag value.
Cycles ticksToCycles(Tick t) const
Stats::Average tagsInUse
Per cycle average of the number of tags that hold valid data.
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.
Derived & subdesc(off_type index, const std::string &desc)
Set the subfield description for the given index and marks this stat to print at the end of simulatio...
FALRUBlk * next
The next block in LRU order.
Stats::Vector replacements
Number of replacements of valid blocks per thread.
void insertBlock(PacketPtr pkt, CacheBlk *blk) override
int cacheMask
A mask for the FALRUBlk::inCache bits.
Derived & init(size_type size)
Set this vector to have the given size.
Declaration of a fully associative LRU tag store.
FALRUBlk ** cacheBoundaries
Array of pointers to blocks at the cache size boundaries.
FALRUBlk * tail
The LRU block.
Tick curTick()
The current simulated tick.
A fully associative cache block.
Stats::Vector hits
Hits in each cache size >= 128K.
void invalidate(CacheBlk *blk) override
Invalidate a cache block.
unsigned numCaches
The number of different size caches being tracked.
bool isPowerOf2(const T &n)
Stats::Scalar warmupCycle
The cycle that the warmup percentage was hit.
hash_t tagHash
The address hash table.
void moveToHead(FALRUBlk *blk)
Move a cache block to the MRU position.
Stats::Scalar accesses
Total number of accesses.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define ULL(N)
uint64_t constant
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.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
int floorLog2(unsigned x)
void regStats() override
Register the stats for this object.
virtual const std::string name() const
bool isTouched
Has this block been touched?
CacheBlk * accessBlock(Addr addr, bool is_secure, Cycles &lat, int *inCache)
Access block and update replacement data.
FALRUBlk * blks
The cache blocks.
FALRUBlk * prev
The previous block in LRU order.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
int set
The set and way this block belongs to.
FALRUBlk * hashLookup(Addr addr) const
Find the cache block for the given address.
hash_t::const_iterator tagIterator
Iterator into the address hash table.
bool isValid() const
Checks that a block is valid.
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.