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

Normally a bank allocates memory from the device object using the name of the bank as the key. More...

#include <bank-templates.h>

Inheritance diagram for simics::SharedMemoryBank:
simics::Bank simics::BankInterface simics::HierarchicalObject simics::HierarchicalObjectInterface

Public Member Functions

 SharedMemoryBank (MappableConfObject *dev_obj, const std::string &name, std::string_view name_of_bank_memory)
 
- Public Member Functions inherited from simics::Bank
 Bank (MappableConfObject *dev_obj, const std::string &name)
 
 Bank (MappableConfObject *dev_obj, const std::string &name, ByteOrder byte_order)
 
 Bank (const Bank &)=delete
 
Bankoperator= (const Bank &)=delete
 
 Bank (Bank &&rhs)
 
Bankoperator= (Bank &&rhs)
 
virtual ~Bank ()=default
 
std::string_view name () const override
 Get the name of the bank without level delimiters.
 
MappableConfObjectdev_obj () const override
 Get the device object.
 
const std::string & description () const override
 Get the description of the bank.
 
void set_description (std::string_view desc) override
 Set the description for the bank.
 
void add_register (const register_t &reg) override
 Parse a register name and add register to the bank.
 
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) override
 Add a register to the bank.
 
unsigned number_of_registers () const override
 Get the number of registers in the bank.
 
std::pair< size_t, RegisterInterface * > register_at_index (unsigned index) const override
 Get the register at a specific index.
 
const std::map< size_t, RegisterInterface * > & mapped_registers () const override
 Get all mapped registers on the bank ordered by offset.
 
void set_callbacks (BankIssueCallbacksInterface *callbacks) override
 Set the callbacks for bank issues.
 
ByteOrder get_byte_order () const override
 Get the byte order of the bank.
 
void set_miss_pattern (uint8_t miss_pattern) override
 Set the miss pattern for the bank.
 
exception_type_t transaction_access (transaction_t *t, uint64_t offset) override
 Entry point for a memory access from the transaction interface.
 
- Public Member Functions inherited from simics::BankInterface
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.
 
- Public Member Functions inherited from simics::HierarchicalObject
 HierarchicalObject (MappableConfObject *dev_obj, const std::string &name)
 Constructor for HierarchicalObject.
 
virtual ~HierarchicalObject ()
 
 HierarchicalObject (const HierarchicalObject &)=delete
 
HierarchicalObjectoperator= (const HierarchicalObject &)=delete
 
 HierarchicalObject (HierarchicalObject &&rhs) noexcept
 
HierarchicalObjectoperator= (HierarchicalObject &&rhs) noexcept
 
template<typename T >
T * dev_ptr ()
 
const std::string & hierarchical_name () const override
 
std::string_view name () const override
 
const std::string & description () const override
 
void set_description (std::string_view desc) override
 
Level hierarchy_level () const override
 
std::string_view bank_name () const override
 
MappableConfObjectdev_obj () const override
 
ConfObjectRef bank_obj_ref () const override
 
std::string_view parent_name () const override
 
FieldInterfacelookup_field (const std::string &name) const override
 
RegisterInterfacelookup_register (const std::string &name) const override
 
BankInterfacelookup_bank (const std::string &name) const override
 
virtual const std::string & hierarchical_name () const =0
 
virtual std::string_view name () const =0
 
virtual const std::string & description () const =0
 
virtual void set_description (std::string_view desc)=0
 
virtual Level hierarchy_level () const =0
 
virtual std::string_view bank_name () const =0
 
virtual MappableConfObjectdev_obj () const =0
 
virtual ConfObjectRef bank_obj_ref () const =0
 
virtual std::string_view parent_name () const =0
 
virtual FieldInterfacelookup_field (const std::string &name) const =0
 
virtual RegisterInterfacelookup_register (const std::string &name) const =0
 
virtual BankInterfacelookup_bank (const std::string &name) const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from simics::HierarchicalObject
static bool is_valid_hierarchical_name (std::string_view name)
 
static std::string_view::size_type level_of_hierarchical_name (std::string_view name)
 
- Static Public Attributes inherited from simics::HierarchicalObject
static const uint64_t Register_Read {1}
 Log group ID for Register_Read and Register_Write is fixed.
 
static const uint64_t Register_Write {2}
 
static const uint64_t Register_Read_Exception {3}
 
static const uint64_t Register_Write_Exception {4}
 
- Protected Member Functions inherited from simics::Bank
virtual std::vector< uint8_t > read (uint64_t offset, size_t size, Inquiry inquiry=Inquiry::NonInquiry) const
 
virtual void write (uint64_t offset, const std::vector< uint8_t > &value, size_t size, Inquiry inquiry=Inquiry::NonInquiry) const
 
virtual void unmapped_read (size_t offset, size_t size) const
 
virtual void unmapped_write (size_t offset, size_t size) const
 
void allocate_bank_memory (std::string_view name)
 Allocate memory for this bank by name.
 

Detailed Description

Normally a bank allocates memory from the device object using the name of the bank as the key.

SharedMemoryBank supports using any string when allocating the bank memory. It can be used when multiple banks are sharing the same bank memory.

Constructor & Destructor Documentation

◆ SharedMemoryBank()

simics::SharedMemoryBank::SharedMemoryBank ( MappableConfObject dev_obj,
const std::string &  name,
std::string_view  name_of_bank_memory 
)
inline
Parameters
name_of_bank_memorythe name of the bank memory

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