56 :
BaseTags(
p), allocAssoc(
p.assoc), blks(
p.size /
p.block_size),
57 sequentialAccess(
p.sequential_access),
58 replacementPolicy(
p.replacement_policy)
61 fatal_if(!
p.indexing_policy,
"An indexing policy is required");
65 fatal(
"Block size must be at least 4 and a power of 2");
73 for (
unsigned blk_index = 0; blk_index <
numBlocks; blk_index++) {
Declaration of a base set associative tag store.
void setEntry(ReplaceableEntry *entry, const uint64_t index)
Associate a pointer to an entry to its physical counterpart.
std::vector< CacheBlk > blks
The cache blocks.
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.
void moveBlock(CacheBlk *src_blk, CacheBlk *dest_blk) override
Move a block's metadata to another location decided by the replacement policy.
BaseSetAssocParams Params
Convenience typedef.
replacement_policy::Base * replacementPolicy
Replacement policy.
void tagsInit() override
Initialize blocks as CacheBlk instances.
uint64_t getPartitionId() const
Getter for _partitionId.
uint8_t * data
Contains a copy of the data in this block for easy access.
std::shared_ptr< replacement_policy::ReplacementData > replacementData
Replacement data associated to this entry.
void notifyRelease(uint64_t partition_id)
virtual void invalidate(const std::shared_ptr< ReplacementData > &replacement_data)=0
Invalidate replacement data to set it as the next probable victim.
virtual void reset(const std::shared_ptr< ReplacementData > &replacement_data, const PacketPtr pkt)
Reset replacement data.
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
static constexpr bool isPowerOf2(const T &n)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define fatal(...)
This implements a cprintf based fatal() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.