gem5  v20.1.0.0
Public Member Functions | Private Attributes | List of all members
CompressionBlk Class Reference

A superblock is composed of sub-blocks, and each sub-block has information regarding its superblock and a pointer to its superblock tag. More...

#include <super_blk.hh>

Inheritance diagram for CompressionBlk:
SectorSubBlk CacheBlk ReplaceableEntry

Public Member Functions

 CompressionBlk ()
 
 CompressionBlk (const CompressionBlk &)=delete
 
CompressionBlkoperator= (const CompressionBlk &)=delete
 
 ~CompressionBlk ()
 
bool isCompressed () const
 Check if this block holds compressed data. More...
 
void setCompressed ()
 Set compression bit. More...
 
void setUncompressed ()
 Clear compression bit. More...
 
std::size_t getSizeBits () const
 
void setSizeBits (const std::size_t size)
 Set size, in bits, of this compressed block's data. More...
 
Cycles getDecompressionLatency () const
 Get number of cycles needed to decompress this block. More...
 
void setDecompressionLatency (const Cycles lat)
 Set number of cycles needed to decompress this block. More...
 
std::string print () const override
 Pretty-print sector offset and other CacheBlk information. More...
 
- Public Member Functions inherited from SectorSubBlk
 SectorSubBlk ()
 
 SectorSubBlk (const SectorSubBlk &)=delete
 
SectorSubBlkoperator= (const SectorSubBlk &)=delete
 
 ~SectorSubBlk ()
 
void setSectorBlock (SectorBlk *sector_blk)
 Set sector block associated to this block. More...
 
const SectorBlkgetSectorBlock () const
 Get sector block associated to this block. More...
 
void setSectorOffset (const int sector_offset)
 Set offset of this sub-block within the sector. More...
 
int getSectorOffset () const
 Get offset of this sub-block within the sector. More...
 
Addr getTag () const
 Get tag associated to this block. More...
 
void setValid () override
 Set valid bit and inform sector block. More...
 
void setSecure () override
 Set secure bit and inform sector block. More...
 
void invalidate () override
 Invalidate the block and inform sector block. More...
 
void insert (const Addr tag, const bool is_secure, const int src_requestor_ID, const uint32_t task_ID) override
 Set member variables when a block insertion occurs. More...
 
- Public Member Functions inherited from CacheBlk
 CacheBlk ()
 
 CacheBlk (const CacheBlk &)=delete
 
CacheBlkoperator= (const CacheBlk &)=delete
 
virtual ~CacheBlk ()
 
bool isWritable () const
 Checks the write permissions of this block. More...
 
bool isReadable () const
 Checks the read permissions of this block. More...
 
bool isValid () const
 Checks that a block is valid. More...
 
bool isDirty () const
 Check to see if a block has been written. More...
 
bool wasPrefetched () const
 Check if this block was the result of a hardware prefetch, yet to be touched. More...
 
bool isSecure () const
 Check if this block holds data from the secure memory space. More...
 
Tick getWhenReady () const
 Get tick at which block's data will be available for access. More...
 
void setWhenReady (const Tick tick)
 Set tick at which block's data will be available for access. More...
 
void trackLoadLocked (PacketPtr pkt)
 Track the fact that a local locked was issued to the block. More...
 
void clearLoadLocks (const RequestPtr &req)
 Clear the any load lock that intersect the request, and is from a different context. More...
 
bool checkWrite (PacketPtr pkt)
 Handle interaction of load-locked operations and stores. More...
 
- Public Member Functions inherited from ReplaceableEntry
 ReplaceableEntry ()=default
 
virtual ~ReplaceableEntry ()=default
 
virtual void setPosition (const uint32_t set, const uint32_t way)
 Set both the set and way. More...
 
uint32_t getSet () const
 Get set number. More...
 
uint32_t getWay () const
 Get way number. More...
 

Private Attributes

std::size_t _size
 Set size, in bits, of this compressed block's data. More...
 
Cycles _decompressionLatency
 Number of cycles needed to decompress this block. More...
 

Additional Inherited Members

- Public Types inherited from CacheBlk
typedef unsigned State
 block state: OR of CacheBlkStatusBit More...
 
- Public Attributes inherited from CacheBlk
uint32_t task_id
 Task Id associated with this block. More...
 
Addr tag
 Data block tag value. More...
 
uint8_t * data
 Contains a copy of the data in this block for easy access. More...
 
State status
 The current status of this block. More...
 
Tick whenReady
 Which curTick() will this block be accessible. More...
 
unsigned refCount
 Number of references to this block since it was brought in. More...
 
int srcRequestorId
 holds the source requestor ID for this block. More...
 
Tick tickInserted
 Tick on which the block was inserted in the cache. More...
 
- Public Attributes inherited from ReplaceableEntry
std::shared_ptr< ReplacementDatareplacementData
 Replacement data associated to this entry. More...
 
- Protected Attributes inherited from SectorSubBlk
SectorBlk_sectorBlk
 Sector block associated to this block. More...
 
int _sectorOffset
 The offset of this sub-block in the sector. More...
 
- Protected Attributes inherited from CacheBlk
std::list< LocklockList
 List of thread contexts that have performed a load-locked (LL) on the block since the last store. 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...
 

Detailed Description

A superblock is composed of sub-blocks, and each sub-block has information regarding its superblock and a pointer to its superblock tag.

A superblock can be seen as a variation of a sector block, and therefore we use a sector nomenclature.

Definition at line 48 of file super_blk.hh.

Constructor & Destructor Documentation

◆ CompressionBlk() [1/2]

CompressionBlk::CompressionBlk ( )

Definition at line 39 of file super_blk.cc.

◆ CompressionBlk() [2/2]

CompressionBlk::CompressionBlk ( const CompressionBlk )
delete

◆ ~CompressionBlk()

CompressionBlk::~CompressionBlk ( )
inline

Definition at line 66 of file super_blk.hh.

Member Function Documentation

◆ getDecompressionLatency()

Cycles CompressionBlk::getDecompressionLatency ( ) const

Get number of cycles needed to decompress this block.

Returns
Decompression latency.

Definition at line 75 of file super_blk.cc.

References _decompressionLatency.

Referenced by Compressor::Base::getDecompressionLatency(), and print().

◆ getSizeBits()

std::size_t CompressionBlk::getSizeBits ( ) const

Definition at line 63 of file super_blk.cc.

References _size.

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

◆ isCompressed()

bool CompressionBlk::isCompressed ( ) const

Check if this block holds compressed data.

Returns
True if the block holds compressed data.

Definition at line 45 of file super_blk.cc.

References BlkCompressed, and CacheBlk::status.

Referenced by Compressor::Base::getDecompressionLatency(), print(), and BaseCache::updateCompressionData().

◆ operator=()

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

◆ print()

std::string CompressionBlk::print ( ) const
overridevirtual

Pretty-print sector offset and other CacheBlk information.

Returns
string with basic state information

Reimplemented from SectorSubBlk.

Definition at line 87 of file super_blk.cc.

References csprintf(), getDecompressionLatency(), getSizeBits(), isCompressed(), and SectorSubBlk::print().

Referenced by Compressor::Base::getDecompressionLatency().

◆ setCompressed()

void CompressionBlk::setCompressed ( )

Set compression bit.

Definition at line 51 of file super_blk.cc.

References BlkCompressed, and CacheBlk::status.

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

◆ setDecompressionLatency()

void CompressionBlk::setDecompressionLatency ( const Cycles  lat)

Set number of cycles needed to decompress this block.

Parameters
Decompressionlatency.

Definition at line 81 of file super_blk.cc.

References _decompressionLatency.

Referenced by BaseCache::updateCompressionData().

◆ setSizeBits()

void CompressionBlk::setSizeBits ( const std::size_t  size)

Set size, in bits, of this compressed block's data.

Parameters
Thecompressed size.

Definition at line 69 of file super_blk.cc.

References _size.

Referenced by BaseCache::updateCompressionData().

◆ setUncompressed()

void CompressionBlk::setUncompressed ( )

Clear compression bit.

Definition at line 57 of file super_blk.cc.

References BlkCompressed, and CacheBlk::status.

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

Member Data Documentation

◆ _decompressionLatency

Cycles CompressionBlk::_decompressionLatency
private

Number of cycles needed to decompress this block.

We store it to avoid doing decompressions.

Definition at line 60 of file super_blk.hh.

Referenced by getDecompressionLatency(), and setDecompressionLatency().

◆ _size

std::size_t CompressionBlk::_size
private

Set size, in bits, of this compressed block's data.

Definition at line 54 of file super_blk.hh.

Referenced by getSizeBits(), and setSizeBits().


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

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