The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::RegisterProxy Class Reference

Represents an interface to a pseudo-"Register" of a fixed size which indirectly references other registers (having the same group num, group idx, and size) depending on simulator state. Essentially, this hides banking and register aliasing (shared data) information from the client of this interface which is useful for presenting debugginer-visible and software-visible registers without regard for the underlying banking or aliasing. More...

#include <RegisterSet.hpp>

Inheritance diagram for sparta::RegisterProxy:
Collaboration diagram for sparta::RegisterProxy:

Public Member Functions

 RegisterProxy ()=delete
 RegisterProxy disabled.
 
 RegisterProxy (RegisterProxy &&)=delete
 Move construction not allowed.
 
 RegisterProxy (const RegisterProxy &)=delete
 Not Copy Constructable.
 
RegisterProxyoperator= (const RegisterProxy &)=delete
 Assignment Operator deleted to assure persistence of any proxy's group information and RegisterSet.
 
 RegisterProxy (RegisterBase &reg)
 Concrete Register Constructor. The "current register" of this proxy never changes.
 
 RegisterProxy (RegisterSet &rs, Register::group_num_type group_num, Register::group_idx_type group_idx, const std::string *managed_name)
 Actual Proxy Contruction. Proxies all registers having a specific group_num and group_idx in a single RegisterSet. The "current register" of this proxy switches between banks based on the result of RegisterSet::getCurrentBank()
 
 ~RegisterProxy ()
 Destructor.
 
std::string stringize () const
 Form a string representing this proxy.
 
RegisterBasegetCurrentRegister () const
 Gets the current register being pointed to by this proxy based on simulation state.
 
RegisterBasetryGetCurrentRegister () const
 Attempt to get the current register being pointed to by this proxy based on simulation state.
 
RegisterSetgetContainingRegisterSet () const
 Gets the RegisterSet which this proxy accesses.
 

Additional Inherited Members

- Static Public Attributes inherited from sparta::RegisterProxyBase
static const Definition DEFINITION_END
 Entry indicating the end of a sparta::Register::Definition array.
 

Detailed Description

Represents an interface to a pseudo-"Register" of a fixed size which indirectly references other registers (having the same group num, group idx, and size) depending on simulator state. Essentially, this hides banking and register aliasing (shared data) information from the client of this interface which is useful for presenting debugginer-visible and software-visible registers without regard for the underlying banking or aliasing.

Todo:
Access a register

Definition at line 141 of file RegisterSet.hpp.

Constructor & Destructor Documentation

◆ RegisterProxy() [1/2]

sparta::RegisterProxy::RegisterProxy ( RegisterBase reg)
inline

Concrete Register Constructor. The "current register" of this proxy never changes.

Parameters
regRegister to refer to in proxy. This will invariably be the result of getCurrentRegister()

Definition at line 171 of file RegisterSet.hpp.

◆ RegisterProxy() [2/2]

sparta::RegisterProxy::RegisterProxy ( RegisterSet rs,
Register::group_num_type  group_num,
Register::group_idx_type  group_idx,
const std::string *  managed_name 
)
inline

Actual Proxy Contruction. Proxies all registers having a specific group_num and group_idx in a single RegisterSet. The "current register" of this proxy switches between banks based on the result of RegisterSet::getCurrentBank()

Parameters
rsRegisterSet in which current register will be looked up with the group number and index specified in this constructor
group_numGroup number. Must not be Register::GROUP_NUM_NONE
group_numGroup number. Must not be Register::GROUP_IDX_NONE
managed_nameRegister name interned in the sparta::StringManager singleton

Definition at line 195 of file RegisterSet.hpp.

Here is the call graph for this function:

◆ ~RegisterProxy()

sparta::RegisterProxy::~RegisterProxy ( )
inline

Destructor.

Definition at line 222 of file RegisterSet.hpp.

Member Function Documentation

◆ getContainingRegisterSet()

RegisterSet & sparta::RegisterProxy::getContainingRegisterSet ( ) const
inline

Gets the RegisterSet which this proxy accesses.

Definition at line 1077 of file RegisterSet.hpp.

◆ getCurrentRegister()

RegisterBase * sparta::RegisterProxy::getCurrentRegister ( ) const
inline

Gets the current register being pointed to by this proxy based on simulation state.

Exceptions
SpartaExceptionif the current register cannot be retrieved because it does not exist in the current context indicated by the simulator

Definition at line 1054 of file RegisterSet.hpp.

Here is the call graph for this function:

◆ stringize()

std::string sparta::RegisterProxy::stringize ( ) const
inline

Form a string representing this proxy.

Definition at line 1040 of file RegisterSet.hpp.

Here is the call graph for this function:

◆ tryGetCurrentRegister()

RegisterBase * sparta::RegisterProxy::tryGetCurrentRegister ( ) const
inline

Attempt to get the current register being pointed to by this proxy based on simulation state.

Returns
The current register being proxied if any. Returns nullptr if no register exists in the current context indicated by the simulator

Definition at line 1064 of file RegisterSet.hpp.

Here is the call graph for this function:

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