47 assert(sector_blk !=
nullptr);
152 for (
auto& blk :
blks) {
153 blk->setPosition(
set, way);
160 std::string sub_blk_print;
161 for (
const auto& sub_blk :
blks) {
162 if (sub_blk->isValid()) {
163 sub_blk_print +=
"\t[" + sub_blk->print() +
"]\n";
166 return csprintf(
"%s valid sub-blks (%d):\n%s",
void insert(const Addr tag, const bool is_secure, const int src_requestor_ID, const uint32_t task_ID, const uint64_t partition_id)
Set member variables when a block insertion occurs.
std::string print() const override
Pretty-print tag, set and way, and interpret state bits to readable form including mapping to a MOESI...
virtual void invalidate() override
Invalidate the block and clear all state.
virtual Addr getTag() const
Get tag associated to this block.
virtual void setValid()
Set valid bit.
virtual bool isValid() const
Checks if the entry is valid.
virtual void setPosition(const uint32_t set, const uint32_t way)
Set both the set and way.
void invalidateSubBlk()
Decrease the number of valid sub-blocks.
std::vector< SectorSubBlk * > blks
List of blocks associated to this sector.
std::string print() const override
Print relevant information for this sector block and its sub-blocks.
bool isValid() const override
Checks that a sector block is valid.
uint8_t getNumValid() const
Get the number of sub-blocks that have been validated.
void setPosition(const uint32_t set, const uint32_t way) override
Sets the position of the sub-entries, besides its own.
uint8_t _validCounter
Counter of the number of valid sub-blocks.
void validateSubBlk()
Increase the number of valid sub-blocks.
int getSectorOffset() const
Get offset of this sub-block within the sector.
SectorBlk * _sectorBlk
Sector block associated to this block.
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.
Addr getTag() const override
Get tag associated to this block.
void invalidate() override
Invalidate the block and inform sector block.
void insert(const Addr tag, const bool is_secure) override
Insert the block by assigning it a tag and marking it valid.
void setValid() override
Set valid bit and inform sector block.
std::string print() const override
Pretty-print sector offset and other CacheBlk information.
int _sectorOffset
The offset of this sub-block in the sector.
SectorBlk * getSectorBlock() const
Get sector block associated to this block.
A tagged entry is an entry containing a tag.
void invalidate() override
Invalidate the block.
std::string print() const override
Prints relevant information about this entry.
virtual bool matchTag(Addr tag, bool is_secure) const
Checks if the given tag information corresponds to this entry's.
virtual void insert(const Addr tag, const bool is_secure)
Insert the block by assigning it a tag and marking it valid.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
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.
std::string csprintf(const char *format, const Args &...args)
Copyright (c) 2018, 2020 Inria All rights reserved.