49#include "debug/CacheComp.hh"
55#include "params/CompressedTags.hh"
73 unsigned blk_index = 0;
74 for (
unsigned superblock_index = 0; superblock_index <
numSectors;
94 blk = &
blks[blk_index];
119 const std::size_t compressed_size,
121 const uint64_t partition_id=0)
135 SuperBlk* victim_superblock =
nullptr;
136 bool is_co_allocation =
false;
138 for (
const auto& entry : superblock_entries){
140 if (superblock->
match(key) &&
145 victim_superblock = superblock;
146 is_co_allocation =
true;
153 if (victim_superblock ==
nullptr){
157 if (superblock_entries.size() == 0){
162 victim_superblock =
static_cast<SuperBlk*
>(
166 for (
const auto& blk : victim_superblock->
blks){
167 if (blk->isValid()) {
168 evict_blks.push_back(blk);
178 if (is_co_allocation){
182 DPRINTF(CacheComp,
"Co-Allocation: offset %d of %s\n",
offset,
183 victim_superblock->
print());
uint8_t * data
Contains a copy of the data in this block for easy access.
A superblock is composed of sub-blocks, and each sub-block has information regarding its superblock a...
virtual std::vector< ReplaceableEntry * > getPossibleEntries(const KeyType &key) const =0
Find all possible entries for insertion and replacement of an address.
void setEntry(ReplaceableEntry *entry, const uint64_t index)
Associate a pointer to an entry to its physical counterpart.
std::shared_ptr< replacement_policy::ReplacementData > replacementData
Replacement data associated to this entry.
std::vector< SectorSubBlk * > blks
List of blocks associated to this sector.
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
void setSectorBlock(SectorBlk *sector_blk)
Set sector block associated to this block.
void setSectorOffset(const int sector_offset)
Set offset of this sub-block within the sector.
A basic compression superblock.
std::string print() const override
Print relevant information for this sector block and its sub-blocks.
bool isCompressed(const CompressionBlk *ignored_blk=nullptr) const
Returns whether the superblock contains compressed blocks or not.
void setBlkSize(const std::size_t blk_size)
Set block size.
bool canCoAllocate(const std::size_t compressed_size) const
Checks whether a superblock can co-allocate given compressed data block.
virtual bool isValid() const
Checks if the entry is valid.
bool match(const KeyType &key) const
Checks if the given tag information corresponds to this entry's.
void filterByPartition(std::vector< ReplaceableEntry * > &entries, const uint64_t partition_id) const
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
Copyright (c) 2024 Arm Limited All rights reserved.
Declaration of the Packet class.