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 ((tag == superblock->
getTag()) && superblock->
isValid() &&
119 (is_secure == superblock->
isSecure()) &&
124 victim_superblock = superblock;
125 is_co_allocation =
true;
132 if (victim_superblock ==
nullptr){
134 victim_superblock =
static_cast<SuperBlk*
>(
138 for (
const auto& blk : victim_superblock->
blks){
139 if (blk->isValid()) {
140 evict_blks.push_back(blk);
150 if (is_co_allocation){
154 DPRINTF(CacheComp,
"Co-Allocation: offset %d with blocks\n",
offset);
155 for (
const auto& blk : victim_superblock->
blks){
156 if (blk->isValid()) {
157 DPRINTFR(CacheComp,
"\t[%s]\n", blk->print());
176 const bool is_co_allocatable = superblock->
isCompressed() &&
183 if (is_co_allocatable) {
210 CompressedTagsParams::create()
bool canCoAllocate(const std::size_t compressed_size) const
Checks whether a superblock can co-allocate given compressed data block.
virtual std::shared_ptr< ReplacementData > instantiateEntry()=0
Instantiate a replacement data entry.
std::size_t getSizeBits() const
Addr getTag() const
Get tag associated to this block.
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 ReplaceableEntry * getVictim(const ReplacementCandidates &candidates) const =0
Find replacement victim among candidates.
void setBlkSize(const std::size_t blk_size)
Set block size.
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.
bool isValid() const
Checks that a sector block is valid.
void setCompressed()
Set compression bit.
void setUncompressed()
Clear compression bit.
bool isValid() const
Checks that a block is valid.
bool isSecure() const
Checks that a sector block is secure.
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 Packet is used to encapsulate a transfer between two objects in the memory system (e....
const SectorBlk * getSectorBlock() const
Get sector block associated to this block.
A sector is composed of sub-blocks, and each sub-block has information regarding its sector and a poi...
std::shared_ptr< ReplacementData > replacementData
Replacement data associated to this entry.
A superblock is composed of sub-blocks, and each sub-block has information regarding its superblock a...
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17