C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
simics::RegisterInterface Class Referenceabstract

#include <register-interface.h>

Inheritance diagram for simics::RegisterInterface:
simics::ValueAccessorInterface simics::ValueMutatorInterface simics::Register simics::AliasRegister simics::BankRegister< TRegister, Args > simics::ClearOnReadRegister simics::ConstantRegister simics::DesignLimitationRegister simics::IgnoreWriteRegister simics::Read0Register simics::ReadConstantRegister simics::ReadOnlyRegister simics::ReadUnimplRegister simics::ReservedRegister simics::SilentConstantRegister simics::SilentUnimplRegister simics::UndocumentedRegister simics::UnimplRegister simics::UnmappedRegister simics::Write0OnlyRegister simics::Write1ClearsRegister simics::Write1OnlyRegister simics::WriteOnceRegister simics::WriteOnlyRegister simics::WriteUnimplRegister

Public Member Functions

virtual ~RegisterInterface ()=default
 
virtual std::string_view name () const =0
 Get the name of the register without level delimiters.
 
virtual MappableConfObjectdev_obj () const =0
 Get the device object.
 
virtual const std::string & description () const =0
 Get the description of the register.
 
virtual const std::string & hierarchical_name () const =0
 Get the full name of the register including bank name.
 
virtual ConfObjectRef bank_obj_ref () const =0
 Get the bank object.
 
virtual unsigned number_of_bytes () const =0
 
virtual void init (std::string_view desc, unsigned number_of_bytes, uint64_t init_val)=0
 Initialize the register with a description, size in bytes and an initial value.
 
virtual void reset ()=0
 Reset to the initial value.
 
virtual bool is_read_only () const =0
 
virtual bool is_mapped () const =0
 
virtual void parse_field (const field_t &f)=0
 Parse the field information.
 
virtual void add_field (std::string_view field_name, std::string_view desc, Offset offset, BitWidth width)=0
 Add a field to the register.
 
virtual std::vector< field_tfields_info () const =0
 
virtual BankInterfaceparent () const =0
 
virtual void set_byte_pointers (const register_memory_t &byte_pointers)=0
 Set the byte address of the register.
 
- Public Member Functions inherited from simics::ValueAccessorInterface
virtual ~ValueAccessorInterface ()=default
 
virtual uint64_t get () const =0
 
virtual uint64_t read (uint64_t enabled_bits)=0
 
- Public Member Functions inherited from simics::ValueMutatorInterface
virtual ~ValueMutatorInterface ()=default
 
virtual void set (uint64_t value)=0
 
virtual void write (uint64_t value, uint64_t enabled_bits)=0
 

Constructor & Destructor Documentation

◆ ~RegisterInterface()

virtual simics::RegisterInterface::~RegisterInterface ( )
virtualdefault

Member Function Documentation

◆ add_field()

virtual void simics::RegisterInterface::add_field ( std::string_view  field_name,
std::string_view  desc,
Offset  offset,
BitWidth  width 
)
pure virtual

Add a field to the register.

Implemented in simics::Register.

◆ bank_obj_ref()

virtual ConfObjectRef simics::RegisterInterface::bank_obj_ref ( ) const
pure virtual

Get the bank object.

Returns
A ConfObjectRef to the bank object.

Implemented in simics::Register.

◆ description()

virtual const std::string & simics::RegisterInterface::description ( ) const
pure virtual

Get the description of the register.

Returns
A reference to the string containing the register description.

Implemented in simics::Register.

◆ dev_obj()

virtual MappableConfObject * simics::RegisterInterface::dev_obj ( ) const
pure virtual

Get the device object.

Returns
A pointer to the MappableConfObject.

Implemented in simics::Register.

◆ fields_info()

virtual std::vector< field_t > simics::RegisterInterface::fields_info ( ) const
pure virtual
Returns
information of fields in the register

Implemented in simics::AliasRegister, and simics::Register.

◆ hierarchical_name()

virtual const std::string & simics::RegisterInterface::hierarchical_name ( ) const
pure virtual

Get the full name of the register including bank name.

Returns
A string view representing the full register name.

Implemented in simics::Register.

◆ init()

virtual void simics::RegisterInterface::init ( std::string_view  desc,
unsigned  number_of_bytes,
uint64_t  init_val 
)
pure virtual

Initialize the register with a description, size in bytes and an initial value.

Typically called after the register is instantiated.

Implemented in simics::ZerosRegister, simics::OnesRegister, and simics::Register.

◆ is_mapped()

virtual bool simics::RegisterInterface::is_mapped ( ) const
pure virtual
Returns
if the register is mapped with an offset on the bank

Implemented in simics::UnmappedRegister, simics::AliasRegister, and simics::Register.

◆ is_read_only()

virtual bool simics::RegisterInterface::is_read_only ( ) const
pure virtual
Returns
if the register is read-only

Implemented in simics::ReadOnlyRegister, simics::AliasRegister, and simics::Register.

◆ name()

virtual std::string_view simics::RegisterInterface::name ( ) const
pure virtual

Get the name of the register without level delimiters.

Returns
A string view representing the register name only.

Implemented in simics::Register.

◆ number_of_bytes()

virtual unsigned simics::RegisterInterface::number_of_bytes ( ) const
pure virtual
Returns
the register size in bytes

Implemented in simics::Register.

◆ parent()

virtual BankInterface * simics::RegisterInterface::parent ( ) const
pure virtual
Returns
the parent bank interface

Implemented in simics::Register.

◆ parse_field()

virtual void simics::RegisterInterface::parse_field ( const field_t f)
pure virtual

Parse the field information.

Add the field or field array into the resource map. The field reuses the memory allocated for the enclosing register. offset 0 is always the least significant bit regardless of bit order e.g. 2 bytes value 0b10100111 | | offset:7 offset:0 => width = 8

Implemented in simics::Register.

◆ reset()

virtual void simics::RegisterInterface::reset ( )
pure virtual

Reset to the initial value.

Implemented in simics::Register.

◆ set_byte_pointers()

virtual void simics::RegisterInterface::set_byte_pointers ( const register_memory_t byte_pointers)
pure virtual

Set the byte address of the register.

Implemented in simics::Register.


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