gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::SectorSubBlk Class Reference

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

#include <sector_blk.hh>

Inheritance diagram for gem5::SectorSubBlk:
gem5::CacheBlk gem5::TaggedEntry gem5::CacheEntry gem5::ReplaceableEntry gem5::CompressionBlk

Public Member Functions

 SectorSubBlk ()
 
 SectorSubBlk (const SectorSubBlk &)=delete
 
SectorSubBlkoperator= (const SectorSubBlk &)=delete
 
 SectorSubBlk (SectorSubBlk &&)=delete
 
SectorSubBlkoperator= (SectorSubBlk &&other)=default
 Move assignment operator.
 
 ~SectorSubBlk ()=default
 
void setSectorBlock (SectorBlk *sector_blk)
 Set sector block associated to this block.
 
SectorBlkgetSectorBlock () 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.
 
CacheBlkoperator= (const CacheBlk &)=delete
 
virtual CacheBlkoperator= (CacheBlk &&other)
 Move assignment operator.
 
- Public Member Functions inherited from gem5::CacheBlk
 CacheBlk ()
 
 CacheBlk (const CacheBlk &)=delete
 
CacheBlkoperator= (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.
 

Protected Attributes

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< LocklockList
 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.
 

Additional Inherited Members

- 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 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::ReplacementDatareplacementData
 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.
 

Detailed Description

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

Definition at line 51 of file sector_blk.hh.

Constructor & Destructor Documentation

◆ SectorSubBlk() [1/3]

gem5::SectorSubBlk::SectorSubBlk ( )
inline

Definition at line 65 of file sector_blk.hh.

◆ SectorSubBlk() [2/3]

gem5::SectorSubBlk::SectorSubBlk ( const SectorSubBlk & )
delete

◆ SectorSubBlk() [3/3]

gem5::SectorSubBlk::SectorSubBlk ( SectorSubBlk && )
delete

◆ ~SectorSubBlk()

gem5::SectorSubBlk::~SectorSubBlk ( )
default

Member Function Documentation

◆ getSectorBlock()

◆ getSectorOffset()

int gem5::SectorSubBlk::getSectorOffset ( ) const

Get offset of this sub-block within the sector.

Returns
sector_offset The block's offset.

Definition at line 64 of file sector_blk.cc.

References _sectorOffset.

Referenced by print(), and gem5::SectorTags::regenerateBlkAddr().

◆ getTag()

Addr gem5::SectorSubBlk::getTag ( ) const
overridevirtual

Get tag associated to this block.

Returns
The tag value.

Reimplemented from gem5::CacheEntry.

Definition at line 70 of file sector_blk.cc.

References _sectorBlk, gem5::CacheEntry::getTag(), gem5::CacheEntry::isValid(), and gem5::CacheEntry::tag.

◆ insert()

void gem5::SectorSubBlk::insert ( const Addr tag,
const bool is_secure )
overridevirtual

Insert the block by assigning it a tag and marking it valid.

Touches block if it hadn't been touched previously.

Parameters
tagThe tag value.

Reimplemented from gem5::CacheBlk.

Definition at line 86 of file sector_blk.cc.

References _sectorBlk, gem5::CacheBlk::insert(), gem5::TaggedEntry::insert(), gem5::SectorBlk::isValid(), gem5::TaggedEntry::matchTag(), gem5::MaxAddr, panic_if, and gem5::CacheEntry::tag.

◆ invalidate()

void gem5::SectorSubBlk::invalidate ( )
overridevirtual

Invalidate the block and inform sector block.

Reimplemented from gem5::CacheBlk.

Definition at line 101 of file sector_blk.cc.

References _sectorBlk, gem5::CacheBlk::invalidate(), and gem5::SectorBlk::invalidateSubBlk().

Referenced by gem5::CompressionBlk::invalidate().

◆ operator=() [1/4]

virtual CacheBlk & gem5::CacheBlk::operator= ( CacheBlk && other)
inlinevirtual

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 173 of file cache_blk.hh.

◆ operator=() [2/4]

CacheBlk & gem5::CacheBlk::operator= ( const CacheBlk & )
delete

◆ operator=() [3/4]

SectorSubBlk & gem5::SectorSubBlk::operator= ( const SectorSubBlk & )
delete

◆ operator=() [4/4]

SectorSubBlk & gem5::SectorSubBlk::operator= ( SectorSubBlk && other)
default

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 change its sector block nor its offset.

◆ print()

std::string gem5::SectorSubBlk::print ( ) const
overridevirtual

Pretty-print sector offset and other CacheBlk information.

Returns
string with basic state information

Reimplemented from gem5::CacheBlk.

Definition at line 108 of file sector_blk.cc.

References gem5::csprintf(), getSectorOffset(), and gem5::CacheBlk::print().

Referenced by gem5::CompressionBlk::print().

◆ setSectorBlock()

void gem5::SectorSubBlk::setSectorBlock ( SectorBlk * sector_blk)

Set sector block associated to this block.

Parameters
sector_blkThe sector block pointer.

Definition at line 45 of file sector_blk.cc.

References _sectorBlk.

Referenced by gem5::CompressedTags::tagsInit(), and gem5::SectorTags::tagsInit().

◆ setSectorOffset()

void gem5::SectorSubBlk::setSectorOffset ( const int sector_offset)

Set offset of this sub-block within the sector.

Parameters
sector_offsetThe block's offset.

Definition at line 58 of file sector_blk.cc.

References _sectorOffset.

Referenced by gem5::CompressedTags::tagsInit(), and gem5::SectorTags::tagsInit().

◆ setValid()

void gem5::SectorSubBlk::setValid ( )
overridevirtual

Set valid bit and inform sector block.

Reimplemented from gem5::CacheEntry.

Definition at line 79 of file sector_blk.cc.

References _sectorBlk, gem5::CacheEntry::setValid(), and gem5::SectorBlk::validateSubBlk().

Member Data Documentation

◆ _sectorBlk

SectorBlk* gem5::SectorSubBlk::_sectorBlk
protected

Sector block associated to this block.

Definition at line 57 of file sector_blk.hh.

Referenced by getSectorBlock(), getTag(), insert(), invalidate(), setSectorBlock(), and setValid().

◆ _sectorOffset

int gem5::SectorSubBlk::_sectorOffset
protected

The offset of this sub-block in the sector.

Definition at line 62 of file sector_blk.hh.

Referenced by getSectorOffset(), and setSectorOffset().


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

Generated on Tue Jun 18 2024 16:24:14 for gem5 by doxygen 1.11.0