Go to the documentation of this file.
37 #include "debug/CacheComp.hh"
42 #include "params/CompressedTags.hh"
57 unsigned blk_index = 0;
58 for (
unsigned superblock_index = 0; superblock_index <
numSectors;
78 blk = &
blks[blk_index];
103 const std::size_t compressed_size,
113 SuperBlk* victim_superblock =
nullptr;
114 bool is_co_allocation =
false;
116 for (
const auto& entry : superblock_entries){
118 if (superblock->
matchTag(tag, is_secure) &&
123 victim_superblock = superblock;
124 is_co_allocation =
true;
131 if (victim_superblock ==
nullptr){
133 victim_superblock =
static_cast<SuperBlk*
>(
137 for (
const auto& blk : victim_superblock->
blks){
138 if (blk->isValid()) {
139 evict_blks.push_back(blk);
149 if (is_co_allocation){
153 DPRINTF(CacheComp,
"Co-Allocation: offset %d of %s\n",
offset,
154 victim_superblock->
print());
virtual ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
bool canCoAllocate(const std::size_t compressed_size) const
Checks whether a superblock can co-allocate given compressed data block.
virtual bool matchTag(Addr tag, bool is_secure) const
Checks if the given tag information corresponds to this entry's.
std::vector< SectorSubBlk * > blks
List of blocks associated to this sector.
void setSectorBlock(SectorBlk *sector_blk)
Set sector block associated to this block.
void setEntry(ReplaceableEntry *entry, const uint64_t index)
Associate a pointer to an entry to its physical counterpart.
virtual bool isValid() const
Checks if the entry is valid.
void setBlkSize(const std::size_t blk_size)
Set block size.
std::shared_ptr< ReplacementPolicy::ReplacementData > replacementData
Replacement data associated to this entry.
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.
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
uint8_t * data
Contains a copy of the data in this block for easy access.
A basic compression superblock.
void setSectorOffset(const int sector_offset)
Set offset of this sub-block within the sector.
bool isCompressed(const CompressionBlk *ignored_blk=nullptr) const
Returns whether the superblock contains compressed blocks or not.
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
std::string print() const override
Print relevant information for this sector block and its sub-blocks.
A superblock is composed of sub-blocks, and each sub-block has information regarding its superblock a...
Generated on Tue Mar 23 2021 19:41:27 for gem5 by doxygen 1.8.17