gem5  v20.1.0.0
Public Member Functions | Protected Attributes | List of all members
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 SectorSubBlk:
CacheBlk ReplaceableEntry CompressionBlk

Public Member Functions

 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...
 
std::string print () const override
 Pretty-print sector offset and other CacheBlk information. 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...
 

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

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

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 48 of file sector_blk.hh.

Constructor & Destructor Documentation

◆ SectorSubBlk() [1/2]

SectorSubBlk::SectorSubBlk ( )
inline

Definition at line 62 of file sector_blk.hh.

◆ SectorSubBlk() [2/2]

SectorSubBlk::SectorSubBlk ( const SectorSubBlk )
delete

◆ ~SectorSubBlk()

SectorSubBlk::~SectorSubBlk ( )
inline

Definition at line 65 of file sector_blk.hh.

Member Function Documentation

◆ getSectorBlock()

const SectorBlk * SectorSubBlk::getSectorBlock ( ) const

Get sector block associated to this block.

Returns
The sector block pointer.

Definition at line 49 of file sector_blk.cc.

References _sectorBlk.

Referenced by SectorTags::accessBlock(), CompressedTags::insertBlock(), SectorTags::insertBlock(), SectorTags::invalidate(), SectorTags::regenerateBlkAddr(), and BaseCache::updateCompressionData().

◆ getSectorOffset()

int SectorSubBlk::getSectorOffset ( ) const

Get offset of this sub-block within the sector.

Returns
sector_offset The block's offset.

Definition at line 61 of file sector_blk.cc.

References _sectorOffset.

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

◆ getTag()

Addr SectorSubBlk::getTag ( ) const

Get tag associated to this block.

Returns
The tag value.

Definition at line 67 of file sector_blk.cc.

References _sectorBlk, and SectorBlk::getTag().

◆ insert()

void SectorSubBlk::insert ( const Addr  tag,
const bool  is_secure,
const int  src_requestor_ID,
const uint32_t  task_ID 
)
overridevirtual

Set member variables when a block insertion occurs.

Resets reference count to 1 (the insertion counts as a reference), and touch block if it hadn't been touched previously. Sets the insertion tick to the current tick. Marks the block valid.

Parameters
tagBlock address tag.
is_secureWhether the block is in secure space or not.
src_requestor_IDThe source requestor ID.
task_IDThe new task ID.

Reimplemented from CacheBlk.

Definition at line 94 of file sector_blk.cc.

References _sectorBlk, SectorBlk::getTag(), CacheBlk::insert(), SectorBlk::isSecure(), SectorBlk::isValid(), panic_if, SectorBlk::setTag(), and CacheBlk::tag.

◆ invalidate()

void SectorSubBlk::invalidate ( )
overridevirtual

Invalidate the block and inform sector block.

Reimplemented from CacheBlk.

Definition at line 87 of file sector_blk.cc.

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

◆ operator=()

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

◆ print()

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

Pretty-print sector offset and other CacheBlk information.

Returns
string with basic state information

Reimplemented from CacheBlk.

Reimplemented in CompressionBlk.

Definition at line 110 of file sector_blk.cc.

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

Referenced by CompressionBlk::print().

◆ setSectorBlock()

void SectorSubBlk::setSectorBlock ( SectorBlk sector_blk)

Set sector block associated to this block.

Parameters
sector_blkThe sector block pointer.

Definition at line 42 of file sector_blk.cc.

References _sectorBlk.

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

◆ setSectorOffset()

void SectorSubBlk::setSectorOffset ( const int  sector_offset)

Set offset of this sub-block within the sector.

Parameters
sector_offsetThe block's offset.

Definition at line 55 of file sector_blk.cc.

References _sectorOffset.

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

◆ setSecure()

void SectorSubBlk::setSecure ( )
overridevirtual

Set secure bit and inform sector block.

Reimplemented from CacheBlk.

Definition at line 80 of file sector_blk.cc.

References _sectorBlk, SectorBlk::setSecure(), and CacheBlk::setSecure().

◆ setValid()

void SectorSubBlk::setValid ( )
overridevirtual

Set valid bit and inform sector block.

Reimplemented from CacheBlk.

Definition at line 73 of file sector_blk.cc.

References _sectorBlk, CacheBlk::setValid(), and SectorBlk::validateSubBlk().

Member Data Documentation

◆ _sectorBlk

SectorBlk* SectorSubBlk::_sectorBlk
protected

Sector block associated to this block.

Definition at line 54 of file sector_blk.hh.

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

◆ _sectorOffset

int SectorSubBlk::_sectorOffset
protected

The offset of this sub-block in the sector.

Definition at line 59 of file sector_blk.hh.

Referenced by getSectorOffset(), and setSectorOffset().


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

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