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

An interface implemented by a Simics bank. More...

#include <bank-interface.h>

Inheritance diagram for simics::BankInterface:
simics::Bank simics::PortBank<> simics::BigEndianBank simics::MissPatternBank simics::PortBank< TBank, Args > simics::SharedMemoryBank SampleBank

Public Member Functions

virtual ~BankInterface ()=default
 
virtual std::string_view name () const =0
 Get the name of the bank without level delimiters.
 
virtual MappableConfObjectdev_obj () const =0
 Get the device object.
 
virtual const std::string & description () const =0
 Get the description of the bank.
 
virtual void set_description (std::string_view desc)=0
 Set the description for the bank.
 
virtual void add_register (const register_t &reg)=0
 Parse a register name and add register to the bank.
 
virtual void add_register (std::string_view name, std::string_view desc, Offset offset, ByteSize number_of_bytes, InitValue init_value, const std::vector< field_t > &fields)=0
 Add a register to the bank.
 
virtual unsigned number_of_registers () const =0
 Get the number of registers in the bank.
 
virtual std::pair< size_t, RegisterInterface * > register_at_index (unsigned index) const =0
 Get the register at a specific index.
 
virtual const std::map< size_t, RegisterInterface * > & mapped_registers () const =0
 Get all mapped registers on the bank ordered by offset.
 
virtual void set_callbacks (BankIssueCallbacksInterface *callbacks)=0
 Set the callbacks for bank issues.
 
virtual ByteOrder get_byte_order () const =0
 Get the byte order of the bank.
 
virtual void set_miss_pattern (uint8_t miss_pattern)=0
 Set the miss pattern for the bank.
 
virtual exception_type_t transaction_access (transaction_t *t, uint64_t offset)=0
 Entry point for a memory access from the transaction interface.
 

Detailed Description

An interface implemented by a Simics bank.

This interface defines the operations and properties of a Simics bank, which is a container for registers and associated metadata.

Constructor & Destructor Documentation

◆ ~BankInterface()

virtual simics::BankInterface::~BankInterface ( )
virtualdefault

Member Function Documentation

◆ add_register() [1/2]

virtual void simics::BankInterface::add_register ( const register_t reg)
pure virtual

Parse a register name and add register to the bank.

Parameters
regThe register data to be added to the bank.

Implemented in simics::Bank.

◆ add_register() [2/2]

virtual void simics::BankInterface::add_register ( std::string_view  name,
std::string_view  desc,
Offset  offset,
ByteSize  number_of_bytes,
InitValue  init_value,
const std::vector< field_t > &  fields 
)
pure virtual

Add a register to the bank.

Parameters
nameThe name of the register.
descThe description of the register.
offsetThe offset of the register within the bank.
number_of_bytesThe size of the register in bytes.
init_valueThe initial value of the register.
fieldsA vector of fields associated with the register.

Implemented in simics::Bank.

◆ description()

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

Get the description of the bank.

Returns
A reference to the string containing the bank description.

Implemented in simics::Bank.

◆ dev_obj()

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

Get the device object.

Returns
A pointer to the MappableConfObject.

Implemented in simics::Bank.

◆ get_byte_order()

virtual ByteOrder simics::BankInterface::get_byte_order ( ) const
pure virtual

Get the byte order of the bank.

Implemented in simics::Bank.

◆ mapped_registers()

virtual const std::map< size_t, RegisterInterface * > & simics::BankInterface::mapped_registers ( ) const
pure virtual

Get all mapped registers on the bank ordered by offset.

Implemented in simics::Bank.

◆ name()

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

Get the name of the bank without level delimiters.

Returns
A string view representing the bank name.

Implemented in simics::Bank.

◆ number_of_registers()

virtual unsigned simics::BankInterface::number_of_registers ( ) const
pure virtual

Get the number of registers in the bank.

Implemented in simics::Bank.

◆ register_at_index()

virtual std::pair< size_t, RegisterInterface * > simics::BankInterface::register_at_index ( unsigned  index) const
pure virtual

Get the register at a specific index.

Parameters
indexThe index of the register.
Returns
register offset and interface with an index into a sorted registers by their offsets on the bank. {0, nullptr} is returned for an outbound access.

Implemented in simics::Bank.

◆ set_callbacks()

virtual void simics::BankInterface::set_callbacks ( BankIssueCallbacksInterface callbacks)
pure virtual

Set the callbacks for bank issues.

Implemented in simics::Bank.

◆ set_description()

virtual void simics::BankInterface::set_description ( std::string_view  desc)
pure virtual

Set the description for the bank.

Parameters
descA string view containing the new description for the bank.

Implemented in simics::Bank.

◆ set_miss_pattern()

virtual void simics::BankInterface::set_miss_pattern ( uint8_t  miss_pattern)
pure virtual

Set the miss pattern for the bank.

Implemented in simics::Bank.

◆ transaction_access()

virtual exception_type_t simics::BankInterface::transaction_access ( transaction_t *  t,
uint64_t  offset 
)
pure virtual

Entry point for a memory access from the transaction interface.

This function handles memory access requests by extracting the necessary information from the transaction object, invoking the appropriate access methods (read or write), and updating the transaction object accordingly.

Parameters
offsetThe memory offset relative to the bank.
Returns
Sim_PE_No_Exception if the access succeeded, or SIM_PE_IO_Not_Taken if the access was not handled.

Implemented in simics::Bank.


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