46 #ifndef __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
47 #define __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
63 #include "params/BaseSetAssoc.hh"
136 if (blk !=
nullptr) {
144 if (blk !=
nullptr) {
169 const std::size_t
size,
181 evict_blks.push_back(victim);
212 fatal_if(ways < 1,
"Allocation limit must be greater than zero");
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
Definitions of a simple cache block class.
virtual std::vector< ReplaceableEntry * > getPossibleEntries(const Addr addr) const =0
Find all possible entries for insertion and replacement of an address.
virtual Addr regenerateAddr(const Addr tag, const ReplaceableEntry *entry) const =0
Regenerate an entry's address from its tag and assigned indexing bits.
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.
std::vector< CacheBlk > blks
The cache blocks.
void insertBlock(const PacketPtr pkt, CacheBlk *blk) override
Insert the new block into the cache and update replacement data.
const bool sequentialAccess
Whether tags and data are accessed sequentially.
void forEachBlk(std::function< void(CacheBlk &)> visitor) override
Visit each block in the tags and apply a visitor.
virtual int getWayAllocationMax() const override
Get the way allocation mask limit.
void invalidate(CacheBlk *blk) override
This function updates the tags when a block is invalidated.
BaseSetAssoc(const Params &p)
Construct and initialize this tag store.
virtual ~BaseSetAssoc()
Destructor.
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.
CacheBlk * accessBlock(const PacketPtr pkt, Cycles &lat) override
Access block and update replacement data.
bool anyBlk(std::function< bool(CacheBlk &)> visitor) override
Find if any of the blocks satisfies a condition.
BaseSetAssocParams Params
Convenience typedef.
replacement_policy::Base * replacementPolicy
Replacement policy.
Addr regenerateBlkAddr(const CacheBlk *blk) const override
Regenerate the block address from the tag and indexing location.
virtual void setWayAllocationMax(int ways) override
Limit the allocation for the cache ways.
void tagsInit() override
Initialize blocks as CacheBlk instances.
void increaseRefCount()
Get the number of references to this block since insertion.
Cycles is a wrapper class for representing cycle counts, i.e.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::shared_ptr< replacement_policy::ReplacementData > replacementData
Replacement data associated to this entry.
virtual Addr getTag() const
Get tag associated to this block.
A common base class of cache replacement policy objects.
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Reset replacement data.
virtual void touch(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Update replacement data.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
Declares a basic cache interface BaseCache.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of the Packet class.