46#ifndef __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
47#define __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
64#include "params/BaseSetAssoc.hh"
137 if (blk !=
nullptr) {
145 if (blk !=
nullptr) {
171 const std::size_t
size,
173 const uint64_t partition_id=0)
override
185 CacheBlk* victim = entries.empty() ? nullptr :
189 evict_blks.push_back(victim);
225 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 Addr regenerateAddr(const Addr tag, const ReplaceableEntry *entry) const =0
Regenerate an entry's address from its tag and assigned indexing bits.
virtual std::vector< ReplaceableEntry * > getPossibleEntries(const Addr addr) const =0
Find all possible entries for insertion and replacement of an 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.
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.
CacheBlk * findVictim(Addr addr, const bool is_secure, const std::size_t size, std::vector< CacheBlk * > &evict_blks, const uint64_t partition_id=0) override
Find replacement victim based on address.
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.
bool anyBlk(std::function< bool(CacheBlk &)> visitor) override
Find if any of the blocks satisfies a condition.
BaseSetAssocParams Params
Convenience typedef.
CacheBlk * accessBlock(const PacketPtr pkt, Cycles &lat) override
Access block and update replacement data.
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.
virtual Addr getTag() const
Get tag associated to this block.
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.
void filterByPartition(std::vector< ReplaceableEntry * > &entries, const uint64_t partition_id) const
void notifyAcquire(uint64_t partition_id)
Notify of acquisition of ownership of a cache line.
virtual uint64_t readPacketPartitionID(PacketPtr pkt) const
PartitionManager interface to retrieve PartitionID from a packet; This base implementation returns ze...
A common base class of cache replacement policy objects.
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.
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
#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.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Declaration of the Packet class.