gem5 v24.0.0.0
|
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>
Public Types | |
enum | OverwriteType : int { DATA_CONTRACTION = -1 , UNCHANGED = 0 , DATA_EXPANSION = 1 } |
When an overwrite happens, the data size may change an not fit in its current container any longer. More... | |
Public Types inherited from gem5::CacheBlk | |
enum | CoherenceBits : unsigned { WritableBit = 0x02 , ReadableBit = 0x04 , DirtyBit = 0x08 , AllBits = 0x0E } |
Cache block's enum listing the supported coherence bits. More... | |
Public Member Functions | |
CompressionBlk () | |
CompressionBlk (const CompressionBlk &)=delete | |
CompressionBlk & | operator= (const CompressionBlk &)=delete |
CompressionBlk (CompressionBlk &&)=delete | |
CompressionBlk & | operator= (CompressionBlk &&other) |
Move assignment operator. | |
CacheBlk & | operator= (CacheBlk &&other) override |
Move assignment operator. | |
~CompressionBlk ()=default | |
bool | isCompressed () const |
Check if this block holds compressed data. | |
void | setCompressed () |
Set compression bit. | |
void | setUncompressed () |
Clear compression bit. | |
std::size_t | getSizeBits () const |
void | setSizeBits (const std::size_t size) |
Set size, in bits, of this compressed block's data. | |
Cycles | getDecompressionLatency () const |
Get number of cycles needed to decompress this block. | |
void | setDecompressionLatency (const Cycles lat) |
Set number of cycles needed to decompress this block. | |
void | invalidate () override |
Invalidate the block and clear all state. | |
OverwriteType | checkExpansionContraction (const std::size_t size) const |
Determines if changing the size of the block will cause a data expansion (new size is bigger) or contraction (new size is smaller). | |
std::string | print () const override |
Pretty-print sector offset and other CacheBlk information. | |
Public Member Functions inherited from gem5::SectorSubBlk | |
SectorSubBlk () | |
SectorSubBlk (const SectorSubBlk &)=delete | |
SectorSubBlk & | operator= (const SectorSubBlk &)=delete |
SectorSubBlk (SectorSubBlk &&)=delete | |
SectorSubBlk & | operator= (SectorSubBlk &&other)=default |
Move assignment operator. | |
~SectorSubBlk ()=default | |
void | setSectorBlock (SectorBlk *sector_blk) |
Set sector block associated to this block. | |
SectorBlk * | getSectorBlock () const |
Get sector block associated to this block. | |
void | setSectorOffset (const int sector_offset) |
Set offset of this sub-block within the sector. | |
int | getSectorOffset () const |
Get offset of this sub-block within the sector. | |
Addr | getTag () const override |
Get tag associated to this block. | |
void | setValid () override |
Set valid bit 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 | invalidate () override |
Invalidate the block and inform sector block. | |
std::string | print () const override |
Pretty-print sector offset and other CacheBlk information. | |
CacheBlk & | operator= (const CacheBlk &)=delete |
virtual CacheBlk & | operator= (CacheBlk &&other) |
Move assignment operator. | |
Public Member Functions inherited from gem5::CacheBlk | |
CacheBlk () | |
CacheBlk (const CacheBlk &)=delete | |
CacheBlk & | operator= (const CacheBlk &)=delete |
CacheBlk (const CacheBlk &&)=delete | |
virtual | ~CacheBlk () |
void | setCoherenceBits (unsigned bits) |
Sets the corresponding coherence bits. | |
void | clearCoherenceBits (unsigned bits) |
Clear the corresponding coherence bits. | |
bool | isSet (unsigned bits) const |
Checks the given coherence bits are set. | |
bool | wasPrefetched () const |
Check if this block was the result of a hardware prefetch, yet to be touched. | |
void | clearPrefetched () |
Clear the prefetching bit. | |
void | setPrefetched () |
Marks this blocks as a recently prefetched block. | |
Tick | getWhenReady () const |
Get tick at which block's data will be available for access. | |
void | setWhenReady (const Tick tick) |
Set tick at which block's data will be available for access. | |
uint32_t | getTaskId () const |
Get the task id associated to this block. | |
uint32_t | getSrcRequestorId () const |
Get the requestor id associated to this block. | |
uint64_t | getPartitionId () const |
Getter for _partitionId. | |
unsigned | getRefCount () const |
Get the number of references to this block since insertion. | |
void | increaseRefCount () |
Get the number of references to this block since insertion. | |
Tick | getAge () const |
Get the block's age, that is, the number of ticks since its insertion. | |
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. | |
void | trackLoadLocked (PacketPtr pkt) |
Track the fact that a local locked was issued to the block. | |
void | clearLoadLocks (const RequestPtr &req) |
Clear the any load lock that intersect the request, and is from a different context. | |
bool | checkWrite (PacketPtr pkt) |
Handle interaction of load-locked operations and stores. | |
void | insert (const Addr tag) override |
Insert the block by assigning it a tag and marking it valid. | |
Public Member Functions inherited from gem5::TaggedEntry | |
TaggedEntry () | |
~TaggedEntry ()=default | |
bool | isSecure () const |
Check if this block holds data from the secure memory space. | |
virtual bool | matchTag (Addr tag, bool is_secure) const |
Checks if the given tag information corresponds to this entry's. | |
void | invalidate () override |
Invalidate the block. | |
std::string | print () const override |
Prints relevant information about this entry. | |
bool | matchTag (const Addr tag) const override |
Checks if the given tag information corresponds to this entry's. | |
void | insert (const Addr tag) override |
Insert the block by assigning it a tag and marking it valid. | |
Public Member Functions inherited from gem5::CacheEntry | |
CacheEntry ()=default | |
~CacheEntry ()=default | |
virtual bool | isValid () const |
Checks if the entry is valid. | |
Public Member Functions inherited from gem5::ReplaceableEntry | |
ReplaceableEntry () | |
virtual | ~ReplaceableEntry ()=default |
virtual void | setPosition (const uint32_t set, const uint32_t way) |
Set both the set and way. | |
uint32_t | getSet () const |
Get set number. | |
uint32_t | getWay () const |
Get way number. | |
Private Attributes | |
std::size_t | _size |
Set size, in bits, of this compressed block's data. | |
Cycles | _decompressionLatency |
Number of cycles needed to decompress this block. | |
bool | _compressed |
Compression bit. | |
Additional Inherited Members | |
Public Attributes inherited from gem5::CacheBlk | |
uint8_t * | data = nullptr |
Contains a copy of the data in this block for easy access. | |
Tick | whenReady = 0 |
Which curTick() will this block be accessible. | |
Public Attributes inherited from gem5::ReplaceableEntry | |
std::shared_ptr< replacement_policy::ReplacementData > | replacementData |
Replacement data associated to this entry. | |
Protected Member Functions inherited from gem5::CacheBlk | |
void | setTaskId (const uint32_t task_id) |
Set the task id value. | |
void | setSrcRequestorId (const uint32_t id) |
Set the source requestor id. | |
void | setPartitionId (const uint64_t partitionId) |
Setter for _partitionId. | |
void | setRefCount (const unsigned count) |
Set the number of references to this block since insertion. | |
void | setTickInserted () |
Set the current tick as this block's insertion tick. | |
Protected Member Functions inherited from gem5::TaggedEntry | |
virtual void | setSecure () |
Set secure bit. | |
Protected Member Functions inherited from gem5::CacheEntry | |
virtual void | setTag (Addr _tag) |
Set tag associated to this block. | |
Protected Attributes inherited from gem5::SectorSubBlk | |
SectorBlk * | _sectorBlk |
Sector block associated to this block. | |
int | _sectorOffset |
The offset of this sub-block in the sector. | |
Protected Attributes inherited from gem5::CacheBlk | |
std::list< Lock > | lockList |
List of thread contexts that have performed a load-locked (LL) on the block since the last store. | |
unsigned | coherence |
The current coherence status of this block. | |
Protected Attributes inherited from gem5::ReplaceableEntry | |
uint32_t | _set |
Set to which this entry belongs. | |
uint32_t | _way |
Way (relative position within the set) to which this entry belongs. | |
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 51 of file super_blk.hh.
enum gem5::CompressionBlk::OverwriteType : int |
When an overwrite happens, the data size may change an not fit in its current container any longer.
This enum declared which kind of size change happened in this situation.
Definition at line 74 of file super_blk.hh.
gem5::CompressionBlk::CompressionBlk | ( | ) |
Definition at line 45 of file super_blk.cc.
|
delete |
|
delete |
|
default |
CompressionBlk::OverwriteType gem5::CompressionBlk::checkExpansionContraction | ( | const std::size_t | size | ) | const |
Determines if changing the size of the block will cause a data expansion (new size is bigger) or contraction (new size is smaller).
Sizes are not necessarily compared at at bit granularities (e.g., 20 bits is considered equal to 23 bits when blocks use 32-bit spaces as minimum allocation units).
size | The new compressed size. |
Definition at line 148 of file super_blk.cc.
References gem5::SuperBlk::calculateCompressionFactor(), DATA_CONTRACTION, DATA_EXPANSION, gem5::SuperBlk::getCompressionFactor(), gem5::SectorSubBlk::getSectorBlock(), and UNCHANGED.
Referenced by gem5::BaseCache::updateCompressionData().
Cycles gem5::CompressionBlk::getDecompressionLatency | ( | ) | const |
Get number of cycles needed to decompress this block.
Definition at line 129 of file super_blk.cc.
References _decompressionLatency.
Referenced by gem5::compression::Base::getDecompressionLatency(), and print().
std::size_t gem5::CompressionBlk::getSizeBits | ( | ) | const |
Definition at line 93 of file super_blk.cc.
References _size.
Referenced by print(), and gem5::BaseCache::updateCompressionData().
|
overridevirtual |
Invalidate the block and clear all state.
Reimplemented from gem5::CacheBlk.
Definition at line 141 of file super_blk.cc.
References gem5::SectorSubBlk::invalidate(), and setUncompressed().
bool gem5::CompressionBlk::isCompressed | ( | ) | const |
Check if this block holds compressed data.
Definition at line 75 of file super_blk.cc.
References _compressed.
Referenced by gem5::compression::Base::getDecompressionLatency(), and print().
Move assignment operator.
This should only be used to move an existing valid entry into an invalid one, not to create a new entry. In the end the valid entry will become invalid, and the invalid, valid. All location related variables will remain the same, that is, an entry cannot move its data, just its metadata contents.
Reimplemented from gem5::CacheBlk.
Definition at line 51 of file super_blk.cc.
References operator=().
CompressionBlk & gem5::CompressionBlk::operator= | ( | CompressionBlk && | other | ) |
Move assignment operator.
This should only be used to move an existing valid entry into an invalid one, not to create a new entry. In the end the valid entry will become invalid, and the invalid, valid. All location related variables will remain the same.
Definition at line 58 of file super_blk.cc.
References gem5::CacheBlk::operator=(), setCompressed(), setDecompressionLatency(), and setUncompressed().
|
delete |
Referenced by operator=().
|
overridevirtual |
Pretty-print sector offset and other CacheBlk information.
Reimplemented from gem5::CacheBlk.
Definition at line 164 of file super_blk.cc.
References gem5::csprintf(), getDecompressionLatency(), getSizeBits(), isCompressed(), and gem5::SectorSubBlk::print().
Referenced by gem5::compression::Base::getDecompressionLatency().
void gem5::CompressionBlk::setCompressed | ( | ) |
Set compression bit.
Definition at line 81 of file super_blk.cc.
References _compressed.
Referenced by operator=(), and setSizeBits().
void gem5::CompressionBlk::setDecompressionLatency | ( | const Cycles | lat | ) |
Set number of cycles needed to decompress this block.
Decompression | latency. |
Definition at line 135 of file super_blk.cc.
References _decompressionLatency.
Referenced by operator=(), and gem5::BaseCache::updateCompressionData().
void gem5::CompressionBlk::setSizeBits | ( | const std::size_t | size | ) |
Set size, in bits, of this compressed block's data.
The | compressed size. |
Definition at line 99 of file super_blk.cc.
References _size, gem5::SuperBlk::calculateCompressionFactor(), gem5::SectorBlk::getNumValid(), gem5::SectorSubBlk::getSectorBlock(), gem5::SuperBlk::isCompressed(), setCompressed(), gem5::SuperBlk::setCompressionFactor(), and setUncompressed().
Referenced by gem5::BaseCache::updateCompressionData().
void gem5::CompressionBlk::setUncompressed | ( | ) |
Clear compression bit.
Definition at line 87 of file super_blk.cc.
References _compressed.
Referenced by invalidate(), operator=(), and setSizeBits().
|
private |
Compression bit.
Definition at line 66 of file super_blk.hh.
Referenced by isCompressed(), setCompressed(), and setUncompressed().
|
private |
Number of cycles needed to decompress this block.
We store it to avoid doing decompressions.
Definition at line 63 of file super_blk.hh.
Referenced by getDecompressionLatency(), and setDecompressionLatency().
|
private |
Set size, in bits, of this compressed block's data.
Definition at line 57 of file super_blk.hh.
Referenced by getSizeBits(), and setSizeBits().