gem5  v21.0.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
BaseDynInst< Impl >::Regs Struct Reference

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

#include <base_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
 
size_t srcsReady = 0
 
BackingStorePtr buf
 
RegId_flatDestIdx
 
PhysRegIdPtr_destIdx
 
PhysRegIdPtr_prevDestIdx
 
PhysRegIdPtr_srcIdx
 
uint8_t * _readySrcIdx
 

Detailed Description

template<class Impl>
struct BaseDynInst< Impl >::Regs

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 188 of file base_dyn_inst.hh.

Member Typedef Documentation

◆ BackingStorePtr

template<class Impl >
using BaseDynInst< Impl >::Regs::BackingStorePtr = std::unique_ptr<uint8_t[]>
private

Definition at line 196 of file base_dyn_inst.hh.

◆ BufCursor

template<class Impl >
using BaseDynInst< Impl >::Regs::BufCursor = BackingStorePtr::pointer
private

Definition at line 197 of file base_dyn_inst.hh.

Constructor & Destructor Documentation

◆ Regs()

template<class Impl >
BaseDynInst< Impl >::Regs::Regs ( size_t  srcs,
size_t  dests 
)
inline

Member Function Documentation

◆ allocate()

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

Definition at line 237 of file base_dyn_inst.hh.

References RefCounted::count.

Referenced by BaseDynInst< Impl >::Regs::Regs().

◆ bytesForDests()

template<class Impl >
static size_t BaseDynInst< Impl >::Regs::bytesForDests ( size_t  num)
inlinestaticprivate

Definition at line 217 of file base_dyn_inst.hh.

◆ bytesForSources()

template<class Impl >
static size_t BaseDynInst< Impl >::Regs::bytesForSources ( size_t  num)
inlinestaticprivate

Definition at line 229 of file base_dyn_inst.hh.

◆ flattenedDestIdx() [1/2]

template<class Impl >
const RegId& BaseDynInst< Impl >::Regs::flattenedDestIdx ( int  idx) const
inline

Definition at line 269 of file base_dyn_inst.hh.

References BaseDynInst< Impl >::Regs::_flatDestIdx.

◆ flattenedDestIdx() [2/2]

template<class Impl >
void BaseDynInst< Impl >::Regs::flattenedDestIdx ( int  idx,
const RegId reg_id 
)
inline

Definition at line 277 of file base_dyn_inst.hh.

References BaseDynInst< Impl >::Regs::_flatDestIdx.

◆ init()

template<class Impl >
void BaseDynInst< Impl >::Regs::init ( )
inline

◆ numDests()

template<class Impl >
size_t BaseDynInst< Impl >::Regs::numDests ( ) const
inline

Definition at line 245 of file base_dyn_inst.hh.

References BaseDynInst< Impl >::Regs::_numDests.

Referenced by BaseDynInst< Impl >::numDestRegs().

◆ numSrcs()

template<class Impl >
size_t BaseDynInst< Impl >::Regs::numSrcs ( ) const
inline

◆ prevDestIdx() [1/2]

template<class Impl >
PhysRegIdPtr BaseDynInst< Impl >::Regs::prevDestIdx ( int  idx) const
inline

◆ prevDestIdx() [2/2]

template<class Impl >
void BaseDynInst< Impl >::Regs::prevDestIdx ( int  idx,
PhysRegIdPtr  phys_reg_id 
)
inline

Definition at line 307 of file base_dyn_inst.hh.

References BaseDynInst< Impl >::Regs::_prevDestIdx.

◆ readySrcIdx() [1/2]

template<class Impl >
bool BaseDynInst< Impl >::Regs::readySrcIdx ( int  idx) const
inline

Definition at line 326 of file base_dyn_inst.hh.

References BaseDynInst< Impl >::Regs::_readySrcIdx, and bits().

◆ readySrcIdx() [2/2]

template<class Impl >
void BaseDynInst< Impl >::Regs::readySrcIdx ( int  idx,
bool  ready 
)
inline

Definition at line 333 of file base_dyn_inst.hh.

References BaseDynInst< Impl >::Regs::_readySrcIdx, and replaceBits().

◆ renamedDestIdx() [1/2]

template<class Impl >
PhysRegIdPtr BaseDynInst< Impl >::Regs::renamedDestIdx ( int  idx) const
inline

◆ renamedDestIdx() [2/2]

template<class Impl >
void BaseDynInst< Impl >::Regs::renamedDestIdx ( int  idx,
PhysRegIdPtr  phys_reg_id 
)
inline

Definition at line 292 of file base_dyn_inst.hh.

References BaseDynInst< Impl >::Regs::_destIdx.

◆ renamedSrcIdx() [1/2]

template<class Impl >
PhysRegIdPtr BaseDynInst< Impl >::Regs::renamedSrcIdx ( int  idx) const
inline

◆ renamedSrcIdx() [2/2]

template<class Impl >
void BaseDynInst< Impl >::Regs::renamedSrcIdx ( int  idx,
PhysRegIdPtr  phys_reg_id 
)
inline

Definition at line 320 of file base_dyn_inst.hh.

References BaseDynInst< Impl >::Regs::_srcIdx.

Member Data Documentation

◆ _destIdx

template<class Impl >
PhysRegIdPtr* BaseDynInst< Impl >::Regs::_destIdx
private

◆ _flatDestIdx

template<class Impl >
RegId* BaseDynInst< Impl >::Regs::_flatDestIdx
private

◆ _numDests

template<class Impl >
size_t BaseDynInst< Impl >::Regs::_numDests
private

Definition at line 192 of file base_dyn_inst.hh.

Referenced by BaseDynInst< Impl >::Regs::numDests().

◆ _numSrcs

template<class Impl >
size_t BaseDynInst< Impl >::Regs::_numSrcs
private

Definition at line 191 of file base_dyn_inst.hh.

Referenced by BaseDynInst< Impl >::Regs::numSrcs().

◆ _prevDestIdx

template<class Impl >
PhysRegIdPtr* BaseDynInst< Impl >::Regs::_prevDestIdx
private

◆ _readySrcIdx

template<class Impl >
uint8_t* BaseDynInst< Impl >::Regs::_readySrcIdx
private

◆ _srcIdx

template<class Impl >
PhysRegIdPtr* BaseDynInst< Impl >::Regs::_srcIdx
private

◆ buf

template<class Impl >
BackingStorePtr BaseDynInst< Impl >::Regs::buf
private

Definition at line 199 of file base_dyn_inst.hh.

Referenced by BaseDynInst< Impl >::Regs::Regs().

◆ srcsReady

template<class Impl >
size_t BaseDynInst< Impl >::Regs::srcsReady = 0
private

Definition at line 194 of file base_dyn_inst.hh.


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

Generated on Tue Jun 22 2021 15:28:35 for gem5 by doxygen 1.8.17