gem5
v20.1.0.0
|
A basic compression superblock. More...
#include <super_blk.hh>
Public Member Functions | |
SuperBlk () | |
SuperBlk (const SuperBlk &)=delete | |
SuperBlk & | operator= (const SuperBlk &)=delete |
~SuperBlk () | |
bool | isCompressed (const CompressionBlk *ignored_blk=nullptr) const |
Returns whether the superblock contains compressed blocks or not. More... | |
bool | canCoAllocate (const std::size_t compressed_size) const |
Checks whether a superblock can co-allocate given compressed data block. More... | |
void | setBlkSize (const std::size_t blk_size) |
Set block size. More... | |
Public Member Functions inherited from SectorBlk | |
SectorBlk () | |
SectorBlk (const SectorBlk &)=delete | |
SectorBlk & | operator= (const SectorBlk &)=delete |
~SectorBlk () | |
bool | isValid () const |
Checks that a sector block is valid. More... | |
uint8_t | getNumValid () const |
Get the number of sub-blocks that have been validated. More... | |
bool | isSecure () const |
Checks that a sector block is secure. More... | |
void | setTag (const Addr tag) |
Set tag associated to this block. More... | |
Addr | getTag () const |
Get tag associated to this block. More... | |
void | validateSubBlk () |
Increase the number of valid sub-blocks. More... | |
void | invalidateSubBlk () |
Decrease the number of valid sub-blocks. More... | |
void | setSecure () |
Set secure bit. More... | |
void | setPosition (const uint32_t set, const uint32_t way) override |
Sets the position of the sub-entries, besides its own. More... | |
Public Member Functions inherited from ReplaceableEntry | |
ReplaceableEntry ()=default | |
virtual | ~ReplaceableEntry ()=default |
uint32_t | getSet () const |
Get set number. More... | |
uint32_t | getWay () const |
Get way number. More... | |
virtual std::string | print () const |
Prints relevant information about this entry. More... | |
Protected Attributes | |
std::size_t | blkSize |
Block size, in bytes. More... | |
Protected Attributes inherited from SectorBlk | |
Addr | _tag |
Sector tag value. More... | |
bool | _secureBit |
Whether sector blk is in secure-space or not. More... | |
Protected Attributes inherited from ReplaceableEntry | |
uint32_t | _set |
Set to which this entry belongs. More... | |
uint32_t | _way |
Way (relative position within the set) to which this entry belongs. More... | |
Additional Inherited Members | |
Public Attributes inherited from SectorBlk | |
std::vector< SectorSubBlk * > | blks |
List of blocks associated to this sector. More... | |
Public Attributes inherited from ReplaceableEntry | |
std::shared_ptr< ReplacementData > | replacementData |
Replacement data associated to this entry. More... | |
A basic compression superblock.
Contains the tag and a list of blocks associated to this superblock.
Definition at line 125 of file super_blk.hh.
|
inline |
Definition at line 132 of file super_blk.hh.
|
delete |
|
inline |
Definition at line 135 of file super_blk.hh.
bool SuperBlk::canCoAllocate | ( | const std::size_t | compressed_size | ) | const |
Checks whether a superblock can co-allocate given compressed data block.
compressed_size | Size, in bits, of new block to allocate. |
Definition at line 108 of file super_blk.cc.
References SectorBlk::blks, and blkSize.
Referenced by CompressedTags::findVictim(), CompressedTags::insertBlock(), and BaseCache::updateCompressionData().
bool SuperBlk::isCompressed | ( | const CompressionBlk * | ignored_blk = nullptr | ) | const |
Returns whether the superblock contains compressed blocks or not.
By default, if not blocks are valid, the superblock is compressible.
ignored_blk | If provided don't consider the given block. |
Definition at line 95 of file super_blk.cc.
References SectorBlk::blks.
Referenced by CompressedTags::findVictim(), CompressedTags::insertBlock(), and BaseCache::updateCompressionData().
void SuperBlk::setBlkSize | ( | const std::size_t | blk_size | ) |
Set block size.
Should be called only once, when initializing blocks.
blk_size | The uncompressed block size. |
Definition at line 117 of file super_blk.cc.
References blkSize.
Referenced by CompressedTags::tagsInit().
|
protected |
Block size, in bytes.
Definition at line 129 of file super_blk.hh.
Referenced by canCoAllocate(), and setBlkSize().