48 #ifndef __MEM_CACHE_TAGS_BASESETASSOC_HH__
49 #define __MEM_CACHE_TAGS_BASESETASSOC_HH__
60 #include "params/BaseSetAssoc.hh"
170 if (blk !=
nullptr) {
177 if (blk !=
nullptr) {
272 assert(master_id < cache->
system->maxMasters());
289 fatal_if(ways < 1,
"Allocation limit must be greater than zero");
341 std::string
print()
const override;
362 if (!visitor(
blks[
i]))
368 #endif // __MEM_CACHE_TAGS_BASESETASSOC_HH__
const bool sequentialAccess
Whether tags and data are accessed sequentially.
Counter value() const
Return the current value of this stat as its base type.
unsigned allocAssoc
The allocatable associativity of the cache (alloc mask).
Declares a basic cache interface BaseCache.
Stats::Scalar sampledRefs
The number of reference counts sampled.
void insertBlock(PacketPtr pkt, CacheBlk *blk) override
Insert the new block into the cache.
Cycles is a wrapper class for representing cycle counts, i.e.
Tick whenReady
Which curTick() will this block be accessable.
Addr tag
Data block tag value.
CacheBlk * findBlockBySetAndWay(int set, int way) const override
Find the cache block given set and way.
Cycles ticksToCycles(Tick t) const
Stats::Average tagsInUse
Per cycle average of the number of tags that hold valid data.
Stats::Scalar totalRefs
The total number of references to a block before it is replaced.
System * system
System we are currently operating in.
BlkType * blks
The cache blocks.
An associative set of cache blocks.
Blktype * findBlk(Addr tag, bool is_secure, int &way_id) const
Find a block matching the tag in this set.
unsigned refCount
Number of references to this block since it was brought in.
Stats::Vector replacements
Number of replacements of valid blocks per thread.
CacheBlk * accessBlock(Addr addr, bool is_secure, Cycles &lat) override
Access block and update replacement data.
Blktype ** blks
Cache blocks in this set, maintained in LRU order 0 = MRU.
void forEachBlk(CacheBlkVisitor &visitor) override
Visit each block in the tag store and apply a visitor to the block.
Tick curTick()
The current simulated tick.
BaseSetAssoc(const Params *p)
Construct and initialize this tag store.
int tagShift
The amount to shift the address to get the tag.
CacheBlk * findVictim(Addr addr) override
Find an invalid block to evict for the address provided.
A BaseSetAssoc cache tag store.
std::string print() const override
Print all tags used.
void computeStats() override
Called prior to dumping stats to compute task occupancy.
Declaration of an associative set.
Stats::Scalar tagAccesses
Number of tags consulted over all accesses.
const RequestPtr req
A pointer to the original request.
SetType * sets
The cache sets.
Stats::Scalar warmupCycle
The cycle that the warmup percentage was hit.
Definitions of a simple cache block class.
void invalidate()
Invalidate the block and clear all state.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void invalidate(CacheBlk *blk) override
Invalidate the given block.
CacheSet< CacheBlk > SetType
Typedef the set type used in this tag store.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
uint8_t * dataBlks
The data blocks, 1 per cache block.
const unsigned numSets
The number of sets in the cache.
MasterID maxMasters()
Get the number of masters registered in the system.
Stats::Scalar dataAccesses
Number of data blocks consulted over all accesses.
bool isTouched
whether this block has been touched
int setShift
The amount to shift the address to get the set.
MasterID masterId() const
Accesssor for the requestor id.
BaseSetAssocParams Params
Convenience typedef.
Declaration of the Packet class.
CacheBlk BlkType
Typedef the block type used in this tag store.
Addr extractTag(Addr addr) const override
Generate the tag from the given address.
int extractSet(Addr addr) const override
Calculate the set index from the address.
void cleanupRefs() override
Called at end of simulation to complete average block reference stats.
virtual void setWayAllocationMax(int ways) override
Limit the allocation for the cache ways.
const unsigned assoc
The associativity of the cache.
int srcMasterId
holds the source requestor ID for this block.
uint32_t task_id
Task Id associated with this block.
fatal_if(p->js_features.size() > 16,"Too many job slot feature registers specified (%i)\n", p->js_features.size())
bool isValid() const
Checks that a block is valid.
virtual int getWayAllocationMax() const override
Get the way allocation mask limit.
CacheBlk * findBlock(Addr addr, bool is_secure) const override
Finds the given address in the cache, do not update replacement data.
virtual ~BaseSetAssoc()
Destructor.
Base class for cache block visitor, operating on the cache block base class (later subclassed for the...
Stats::AverageVector occupancies
Average occupancy of each requestor using the cache.
unsigned setMask
Mask out all bits that aren't part of the set index.
Invalid master id for assertion checking only.
Addr regenerateBlkAddr(Addr tag, unsigned set) const override
Regenerate the block address from the tag.