gem5  v22.1.0.0
Public Member Functions | Protected Attributes | List of all members
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::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. More...
 
 ~SectorSubBlk ()=default
 
void setSectorBlock (SectorBlk *sector_blk)
 Set sector block associated to this block. More...
 
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 override
 Get tag associated to this block. More...
 
void setValid () override
 Set valid bit and inform sector block. More...
 
void insert (const Addr tag, const bool is_secure) override
 Insert the block by assigning it a tag and marking it valid. More...
 
void invalidate () override
 Invalidate the block and inform sector block. More...
 
std::string print () const override
 Pretty-print sector offset and other CacheBlk information. More...
 
- Public Member Functions inherited from gem5::CacheBlk
 CacheBlk ()
 
 CacheBlk (const CacheBlk &)=delete
 
CacheBlkoperator= (const CacheBlk &)=delete
 
 CacheBlk (const CacheBlk &&)=delete
 
virtual CacheBlkoperator= (CacheBlk &&other)
 Move assignment operator. More...
 
virtual ~CacheBlk ()
 
void setCoherenceBits (unsigned bits)
 Sets the corresponding coherence bits. More...
 
void clearCoherenceBits (unsigned bits)
 Clear the corresponding coherence bits. More...
 
bool isSet (unsigned bits) const
 Checks the given coherence bits are set. More...
 
bool wasPrefetched () const
 Check if this block was the result of a hardware prefetch, yet to be touched. More...
 
void clearPrefetched ()
 Clear the prefetching bit. More...
 
void setPrefetched ()
 Marks this blocks as a recently prefetched block. 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...
 
uint32_t getTaskId () const
 Get the task id associated to this block. More...
 
uint32_t getSrcRequestorId () const
 Get the requestor id associated to this block. More...
 
unsigned getRefCount () const
 Get the number of references to this block since insertion. More...
 
void increaseRefCount ()
 Get the number of references to this block since insertion. More...
 
Tick getAge () const
 Get the block's age, that is, the number of ticks since its insertion. More...
 
void insert (const Addr tag, const bool is_secure, const int src_requestor_ID, const uint32_t task_ID)
 Set member variables when a block insertion occurs. 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...
 
virtual void insert (const Addr tag, const bool is_secure)
 Insert the block by assigning it a tag and marking it valid. More...
 
- Public Member Functions inherited from gem5::TaggedEntry
 TaggedEntry ()
 
 ~TaggedEntry ()=default
 
virtual bool isValid () const
 Checks if the entry is valid. More...
 
bool isSecure () const
 Check if this block holds data from the secure memory space. More...
 
virtual bool matchTag (Addr tag, bool is_secure) const
 Checks if the given tag information corresponds to this entry's. More...
 
std::string print () const override
 Prints relevant information about this entry. More...
 
- Public Member Functions inherited from gem5::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...
 

Protected Attributes

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 gem5::CacheBlk
std::list< LocklockList
 List of thread contexts that have performed a load-locked (LL) on the block since the last store. More...
 
unsigned coherence
 The current coherence status of this block. More...
 
- Protected Attributes inherited from gem5::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 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. More...
 
Tick whenReady = 0
 Which curTick() will this block be accessible. More...
 
- Public Attributes inherited from gem5::ReplaceableEntry
std::shared_ptr< replacement_policy::ReplacementDatareplacementData
 Replacement data associated to this entry. More...
 
- Protected Member Functions inherited from gem5::CacheBlk
void setTaskId (const uint32_t task_id)
 Set the task id value. More...
 
void setSrcRequestorId (const uint32_t id)
 Set the source requestor id. More...
 
void setRefCount (const unsigned count)
 Set the number of references to this block since insertion. More...
 
void setTickInserted ()
 Set the current tick as this block's insertion tick. More...
 
- Protected Member Functions inherited from gem5::TaggedEntry
virtual void setTag (Addr tag)
 Set tag associated to this block. More...
 
virtual void setSecure ()
 Set secure bit. More...
 

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()

SectorBlk * gem5::SectorSubBlk::getSectorBlock ( ) const

◆ 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::TaggedEntry.

Definition at line 70 of file sector_blk.cc.

References _sectorBlk, gem5::TaggedEntry::getTag(), and gem5::TaggedEntry::isValid().

◆ 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::TaggedEntry.

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, and panic_if.

◆ invalidate()

void gem5::SectorSubBlk::invalidate ( )
overridevirtual

Invalidate the block and inform sector block.

Reimplemented from gem5::CacheBlk.

Reimplemented in gem5::CompressionBlk.

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/2]

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

◆ operator=() [2/2]

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.

Reimplemented in gem5::CompressionBlk.

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

Definition at line 79 of file sector_blk.cc.

References _sectorBlk, gem5::TaggedEntry::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 Wed Dec 21 2022 10:23:26 for gem5 by doxygen 1.9.1