gem5  v20.1.0.0
Public Member Functions | Protected Attributes | List of all members
SuperBlk Class Reference

A basic compression superblock. More...

#include <super_blk.hh>

Inheritance diagram for SuperBlk:
SectorBlk ReplaceableEntry

Public Member Functions

 SuperBlk ()
 
 SuperBlk (const SuperBlk &)=delete
 
SuperBlkoperator= (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
 
SectorBlkoperator= (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< ReplacementDatareplacementData
 Replacement data associated to this entry. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SuperBlk() [1/2]

SuperBlk::SuperBlk ( )
inline

Definition at line 132 of file super_blk.hh.

◆ SuperBlk() [2/2]

SuperBlk::SuperBlk ( const SuperBlk )
delete

◆ ~SuperBlk()

SuperBlk::~SuperBlk ( )
inline

Definition at line 135 of file super_blk.hh.

Member Function Documentation

◆ canCoAllocate()

bool SuperBlk::canCoAllocate ( const std::size_t  compressed_size) const

Checks whether a superblock can co-allocate given compressed data block.

Parameters
compressed_sizeSize, in bits, of new block to allocate.
Returns
True if block can be co-allocated in superblock.

Definition at line 108 of file super_blk.cc.

References SectorBlk::blks, and blkSize.

Referenced by CompressedTags::findVictim(), CompressedTags::insertBlock(), and BaseCache::updateCompressionData().

◆ isCompressed()

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.

Parameters
ignored_blkIf provided don't consider the given block.
Returns
The compressibility state of the superblock.

Definition at line 95 of file super_blk.cc.

References SectorBlk::blks.

Referenced by CompressedTags::findVictim(), CompressedTags::insertBlock(), and BaseCache::updateCompressionData().

◆ operator=()

SuperBlk& SuperBlk::operator= ( const SuperBlk )
delete

◆ setBlkSize()

void SuperBlk::setBlkSize ( const std::size_t  blk_size)

Set block size.

Should be called only once, when initializing blocks.

Parameters
blk_sizeThe uncompressed block size.

Definition at line 117 of file super_blk.cc.

References blkSize.

Referenced by CompressedTags::tagsInit().

Member Data Documentation

◆ blkSize

std::size_t SuperBlk::blkSize
protected

Block size, in bytes.

Definition at line 129 of file super_blk.hh.

Referenced by canCoAllocate(), and setBlkSize().


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:32 for gem5 by doxygen 1.8.17