Go to the documentation of this file.
46 #ifndef __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
47 #define __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
63 #include "params/BaseSetAssoc.hh"
134 if (blk !=
nullptr) {
142 if (blk !=
nullptr) {
167 const std::size_t
size,
179 evict_blks.push_back(victim);
208 fatal_if(ways < 1,
"Allocation limit must be greater than zero");
248 #endif //__MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
CacheBlk * accessBlock(Addr addr, bool is_secure, Cycles &lat) override
Access block and update replacement data.
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.
virtual Addr regenerateAddr(const Addr tag, const ReplaceableEntry *entry) const =0
Regenerate an entry's address from its tag and assigned indexing bits.
const bool sequentialAccess
Whether tags and data are accessed sequentially.
BaseSetAssoc(const Params *p)
Construct and initialize this tag store.
void tagsInit() override
Initialize blocks as CacheBlk instances.
void invalidate(CacheBlk *blk) override
This function updates the tags when a block is invalidated.
void insertBlock(const PacketPtr pkt, CacheBlk *blk) override
Insert the new block into the cache and update replacement data.
A common base class of cache replacement policy objects.
void forEachBlk(std::function< void(CacheBlk &)> visitor) override
Visit each block in the tags and apply a visitor.
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
unsigned refCount
Number of references to this block since it was brought in.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual std::vector< ReplaceableEntry * > getPossibleEntries(const Addr addr) const =0
Find all possible entries for insertion and replacement of an address.
Addr regenerateBlkAddr(const CacheBlk *blk) const override
Regenerate the block address from the tag and indexing location.
virtual ~BaseSetAssoc()
Destructor.
Addr tag
Data block tag value.
virtual int getWayAllocationMax() const override
Get the way allocation mask limit.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Update replacement data.
bool anyBlk(std::function< bool(CacheBlk &)> visitor) override
Find if any of the blocks satisfies a condition.
Cycles is a wrapper class for representing cycle counts, i.e.
std::shared_ptr< ReplacementData > replacementData
Replacement data associated to this entry.
unsigned allocAssoc
The allocatable associativity of the cache (alloc mask).
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Reset replacement data.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
BaseSetAssocParams Params
Convenience typedef.
virtual void setWayAllocationMax(int ways) override
Limit the allocation for the cache ways.
std::vector< CacheBlk > blks
The cache blocks.
BaseReplacementPolicy * replacementPolicy
Replacement policy.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17