gem5  v21.1.0.2
Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
gem5::o3::DynInst::Regs Struct Reference

Collect register related information into a single struct. More...

#include <dyn_inst.hh>

Public Member Functions

size_t numSrcs () const
 
size_t numDests () const
 
void init ()
 
 Regs (size_t srcs, size_t dests)
 
const RegIdflattenedDestIdx (int idx) const
 
void flattenedDestIdx (int idx, const RegId &reg_id)
 
PhysRegIdPtr renamedDestIdx (int idx) const
 
void renamedDestIdx (int idx, PhysRegIdPtr phys_reg_id)
 
PhysRegIdPtr prevDestIdx (int idx) const
 
void prevDestIdx (int idx, PhysRegIdPtr phys_reg_id)
 
PhysRegIdPtr renamedSrcIdx (int idx) const
 
void renamedSrcIdx (int idx, PhysRegIdPtr phys_reg_id)
 
bool readySrcIdx (int idx) const
 
void readySrcIdx (int idx, bool ready)
 

Private Types

using BackingStorePtr = std::unique_ptr< uint8_t[]>
 
using BufCursor = BackingStorePtr::pointer
 

Static Private Member Functions

static size_t bytesForDests (size_t num)
 
static size_t bytesForSources (size_t num)
 
template<class T >
static void allocate (T *&ptr, BufCursor &cur, size_t count)
 

Private Attributes

size_t _numSrcs
 
size_t _numDests
 
BackingStorePtr buf
 
RegId_flatDestIdx
 
PhysRegIdPtr_destIdx
 
PhysRegIdPtr_prevDestIdx
 
PhysRegIdPtr_srcIdx
 
uint8_t * _readySrcIdx
 

Detailed Description

Collect register related information into a single struct.

The number of source and destination registers can vary, and storage for information about them needs to be allocated dynamically. This class figures out how much space is needed and allocates it all at once, and then trivially divies it up for each type of per-register array.

Definition at line 203 of file dyn_inst.hh.

Member Typedef Documentation

◆ BackingStorePtr

using gem5::o3::DynInst::Regs::BackingStorePtr = std::unique_ptr<uint8_t[]>
private

Definition at line 209 of file dyn_inst.hh.

◆ BufCursor

using gem5::o3::DynInst::Regs::BufCursor = BackingStorePtr::pointer
private

Definition at line 210 of file dyn_inst.hh.

Constructor & Destructor Documentation

◆ Regs()

gem5::o3::DynInst::Regs::Regs ( size_t  srcs,
size_t  dests 
)
inline

Definition at line 266 of file dyn_inst.hh.

References _destIdx, _flatDestIdx, _prevDestIdx, _readySrcIdx, _srcIdx, allocate(), buf, and init().

Member Function Documentation

◆ allocate()

template<class T >
static void gem5::o3::DynInst::Regs::allocate ( T *&  ptr,
BufCursor cur,
size_t  count 
)
inlinestaticprivate

Definition at line 250 of file dyn_inst.hh.

References gem5::RefCounted::count.

Referenced by Regs().

◆ bytesForDests()

static size_t gem5::o3::DynInst::Regs::bytesForDests ( size_t  num)
inlinestaticprivate

Definition at line 230 of file dyn_inst.hh.

◆ bytesForSources()

static size_t gem5::o3::DynInst::Regs::bytesForSources ( size_t  num)
inlinestaticprivate

Definition at line 242 of file dyn_inst.hh.

◆ flattenedDestIdx() [1/2]

const RegId& gem5::o3::DynInst::Regs::flattenedDestIdx ( int  idx) const
inline

Definition at line 282 of file dyn_inst.hh.

References _flatDestIdx.

◆ flattenedDestIdx() [2/2]

void gem5::o3::DynInst::Regs::flattenedDestIdx ( int  idx,
const RegId reg_id 
)
inline

Definition at line 290 of file dyn_inst.hh.

References _flatDestIdx.

◆ init()

void gem5::o3::DynInst::Regs::init ( )
inline

Definition at line 261 of file dyn_inst.hh.

References _readySrcIdx, gem5::MipsISA::fill, and numSrcs().

Referenced by gem5::o3::DynInst::DynInst(), and Regs().

◆ numDests()

size_t gem5::o3::DynInst::Regs::numDests ( ) const
inline

Definition at line 258 of file dyn_inst.hh.

References _numDests.

Referenced by gem5::o3::DynInst::numDestRegs().

◆ numSrcs()

size_t gem5::o3::DynInst::Regs::numSrcs ( ) const
inline

Definition at line 257 of file dyn_inst.hh.

References _numSrcs.

Referenced by init(), and gem5::o3::DynInst::numSrcRegs().

◆ prevDestIdx() [1/2]

PhysRegIdPtr gem5::o3::DynInst::Regs::prevDestIdx ( int  idx) const
inline

Definition at line 313 of file dyn_inst.hh.

References _prevDestIdx.

Referenced by gem5::o3::DynInst::forwardOldRegs(), and gem5::o3::DynInst::renameDestReg().

◆ prevDestIdx() [2/2]

void gem5::o3::DynInst::Regs::prevDestIdx ( int  idx,
PhysRegIdPtr  phys_reg_id 
)
inline

Definition at line 320 of file dyn_inst.hh.

References _prevDestIdx.

◆ readySrcIdx() [1/2]

bool gem5::o3::DynInst::Regs::readySrcIdx ( int  idx) const
inline

Definition at line 339 of file dyn_inst.hh.

References _readySrcIdx, and gem5::bits().

Referenced by gem5::o3::DynInst::markSrcRegReady().

◆ readySrcIdx() [2/2]

void gem5::o3::DynInst::Regs::readySrcIdx ( int  idx,
bool  ready 
)
inline

Definition at line 346 of file dyn_inst.hh.

References _readySrcIdx, and gem5::replaceBits().

◆ renamedDestIdx() [1/2]

PhysRegIdPtr gem5::o3::DynInst::Regs::renamedDestIdx ( int  idx) const
inline

◆ renamedDestIdx() [2/2]

void gem5::o3::DynInst::Regs::renamedDestIdx ( int  idx,
PhysRegIdPtr  phys_reg_id 
)
inline

Definition at line 305 of file dyn_inst.hh.

References _destIdx.

◆ renamedSrcIdx() [1/2]

PhysRegIdPtr gem5::o3::DynInst::Regs::renamedSrcIdx ( int  idx) const
inline

◆ renamedSrcIdx() [2/2]

void gem5::o3::DynInst::Regs::renamedSrcIdx ( int  idx,
PhysRegIdPtr  phys_reg_id 
)
inline

Definition at line 333 of file dyn_inst.hh.

References _srcIdx.

Member Data Documentation

◆ _destIdx

PhysRegIdPtr* gem5::o3::DynInst::Regs::_destIdx
private

Definition at line 223 of file dyn_inst.hh.

Referenced by Regs(), and renamedDestIdx().

◆ _flatDestIdx

RegId* gem5::o3::DynInst::Regs::_flatDestIdx
private

Definition at line 219 of file dyn_inst.hh.

Referenced by flattenedDestIdx(), and Regs().

◆ _numDests

size_t gem5::o3::DynInst::Regs::_numDests
private

Definition at line 207 of file dyn_inst.hh.

Referenced by numDests().

◆ _numSrcs

size_t gem5::o3::DynInst::Regs::_numSrcs
private

Definition at line 206 of file dyn_inst.hh.

Referenced by numSrcs().

◆ _prevDestIdx

PhysRegIdPtr* gem5::o3::DynInst::Regs::_prevDestIdx
private

Definition at line 227 of file dyn_inst.hh.

Referenced by prevDestIdx(), and Regs().

◆ _readySrcIdx

uint8_t* gem5::o3::DynInst::Regs::_readySrcIdx
private

Definition at line 239 of file dyn_inst.hh.

Referenced by init(), readySrcIdx(), and Regs().

◆ _srcIdx

PhysRegIdPtr* gem5::o3::DynInst::Regs::_srcIdx
private

Definition at line 236 of file dyn_inst.hh.

Referenced by Regs(), and renamedSrcIdx().

◆ buf

BackingStorePtr gem5::o3::DynInst::Regs::buf
private

Definition at line 212 of file dyn_inst.hh.

Referenced by Regs().


The documentation for this struct was generated from the following file:

Generated on Tue Sep 21 2021 12:31:43 for gem5 by doxygen 1.8.17