diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mem/cache/tags/sector_blk.cc | 8 | ||||
-rw-r--r-- | src/mem/cache/tags/sector_blk.hh | 20 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/mem/cache/tags/sector_blk.cc b/src/mem/cache/tags/sector_blk.cc index 7e4468dc3..13c90b68c 100644 --- a/src/mem/cache/tags/sector_blk.cc +++ b/src/mem/cache/tags/sector_blk.cc @@ -116,7 +116,7 @@ SectorSubBlk::print() const } SectorBlk::SectorBlk() - : ReplaceableEntry(), _tag(MaxAddr), _validCounter(0), _secureBit(false) + : ReplaceableEntry(), _validCounter(0), _tag(MaxAddr), _secureBit(false) { } @@ -127,6 +127,12 @@ SectorBlk::isValid() const return _validCounter > 0; } +uint8_t +SectorBlk::getNumValid() const +{ + return _validCounter; +} + bool SectorBlk::isSecure() const { diff --git a/src/mem/cache/tags/sector_blk.hh b/src/mem/cache/tags/sector_blk.hh index a30fb817c..cfe67729c 100644 --- a/src/mem/cache/tags/sector_blk.hh +++ b/src/mem/cache/tags/sector_blk.hh @@ -144,18 +144,19 @@ class SectorSubBlk : public CacheBlk */ class SectorBlk : public ReplaceableEntry { - protected: - /** - * Sector tag value. A sector's tag is the tag of all its sub-blocks. - */ - Addr _tag; - + private: /** * Counter of the number of valid sub-blocks. The sector is valid if any * of its sub-blocks is valid. */ uint8_t _validCounter; + protected: + /** + * Sector tag value. A sector's tag is the tag of all its sub-blocks. + */ + Addr _tag; + /** * Whether sector blk is in secure-space or not. */ @@ -178,6 +179,13 @@ class SectorBlk : public ReplaceableEntry bool isValid() const; /** + * Get the number of sub-blocks that have been validated. + * + * @return The number of valid sub-blocks. + */ + uint8_t getNumValid() const; + + /** * Checks that a sector block is secure. A single secure block suffices * to imply that the whole sector is secure, as the insertion proccess * asserts that different secure spaces can't coexist in the same sector. |