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);
210 fatal_if(ways < 1,
"Allocation limit must be greater than zero");
250 #endif //__MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
CacheBlk * accessBlock(Addr addr, bool is_secure, Cycles &lat) override
Access block and update replacement data.
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data) const =0
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.
ReplacementPolicy::Base * replacementPolicy
Replacement policy.
void tagsInit() override
Initialize blocks as CacheBlk instances.
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data) const =0
Reset replacement data.
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.
void forEachBlk(std::function< void(CacheBlk &)> visitor) override
Visit each block in the tags and apply a visitor.
A common base class of cache replacement policy objects.
std::shared_ptr< ReplacementPolicy::ReplacementData > replacementData
Replacement data associated to this entry.
BaseSetAssoc(const Params &p)
Construct and initialize this tag store.
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.
void increaseRefCount()
Get the number of references to this block since insertion.
virtual int getWayAllocationMax() const override
Get the way allocation mask limit.
virtual Addr getTag() const
Get tag associated to this block.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
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.
unsigned allocAssoc
The allocatable associativity of the cache (alloc mask).
void moveBlock(CacheBlk *src_blk, CacheBlk *dest_blk) override
Move a block's metadata to another location decided by the replacement policy.
#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.
Generated on Tue Mar 23 2021 19:41:27 for gem5 by doxygen 1.8.17