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

Namespaces

namespace  detail
 
namespace  iface
 

Classes

class  AliasRegister
 
class  Attribute
 Represents a Simics attribute. More...
 
struct  AttributeAccessor
 A container of get and set callbacks for a class member variable. More...
 
class  AttrValue
 
class  Bank
 
struct  BankAccess
 
class  BankInstrumentationSubscribeConnection
 
class  BankInterface
 
class  BankIssueCallbacksInterface
 
class  BankPort
 
class  BankPortInterface
 
class  BankRegister
 
class  BigEndianBank
 
class  ClearOnReadField
 
class  ClearOnReadRegister
 
class  ConfClass
 Represents Simics C type conf_class_t. More...
 
class  ConfObject
 A class inherited by a model class to support Simics configuration. More...
 
class  ConfObjectRef
 Represents Simics C type conf_object_t. More...
 
class  Connect
 A class for connecting with another Simics object. More...
 
class  ConnectBase
 A virtual base class for Simics C++ interface connect class. More...
 
class  ConnectConfig
 By default, all interfaces in the Connect class are required. More...
 
class  ConstantField
 
class  ConstantRegister
 
class  CycleEvent
 Cycle-based event type. More...
 
class  DesignLimitationField
 
class  DesignLimitationRegister
 
class  Event
 
struct  EventInfo
 
class  Field
 
class  FieldInterface
 
class  HierarchicalObject
 
class  HierarchicalObjectInterface
 
class  IgnoreField
 
class  IgnoreRegister
 
class  IgnoreWriteField
 
class  IgnoreWriteRegister
 
class  MallocAllocator
 
class  MapNameToInterface
 
class  MapNameToInterfaceObject
 
class  MapNameToInterfaceObject< RegisterInterface >
 
class  MappableConfObject
 
class  MissPatternBank
 
class  MmAllocator
 
class  nocopy
 Prevent copy of classes inheriting from this class by having private copy-constructor and assignment operator. More...
 
class  ObjectFactory
 An object factory creates class T object. More...
 
class  ObjectFactoryWithArg
 An object factory creates class T object with argument. More...
 
class  OnesField
 
class  OnesRegister
 
class  Port
 Represents a Simics port object base class. More...
 
class  PortBank
 
class  Read0Field
 
class  Read0Register
 
class  ReadConstantField
 
class  ReadConstantRegister
 
class  ReadOnlyClearOnReadField
 
class  ReadOnlyClearOnReadRegister
 
class  ReadOnlyField
 
class  ReadOnlyRegister
 
class  ReadUnimplField
 
class  ReadUnimplRegister
 
class  Register
 
class  RegisterField
 
class  RegisterInterface
 
class  ReservedField
 
class  ReservedRegister
 
class  SharedMemoryBank
 Normally a bank allocates memory from the device object using the name of the bank as the key. More...
 
class  SilentConstantField
 
class  SilentConstantRegister
 
class  SilentUnimplField
 
class  SilentUnimplRegister
 
class  StepEvent
 Not commonly used for device model. Step-based event type. More...
 
class  TimeEvent
 Time-based event type. More...
 
class  UndocumentedField
 
class  UndocumentedRegister
 
class  UnimplField
 
class  UnimplRegister
 
class  UnmappedRegister
 
class  ValueAccessorInterface
 
class  ValueMutatorInterface
 
class  Write0OnlyField
 
class  Write0OnlyRegister
 
class  Write1ClearsField
 
class  Write1ClearsRegister
 
class  Write1OnlyField
 
class  Write1OnlyRegister
 
class  WriteOnceField
 
class  WriteOnceRegister
 
class  WriteOnlyField
 
class  WriteOnlyRegister
 
class  WriteUnimplField
 
class  WriteUnimplRegister
 
class  ZerosField
 
class  ZerosRegister
 

Typedefs

using attr_getter = std::add_pointer_t< attr_value_t(conf_object_t *)>
 
using attr_setter = std::add_pointer_t< set_error_t(conf_object_t *, attr_value_t *)>
 
using ConfClassPtr = std::unique_ptr< ConfClass >
 
using ev_callback = std::add_pointer_t< void(conf_object_t *, void *)>
 
using ev_destroy = ev_callback
 
using ev_value_getter = std::add_pointer_t< attr_value_t(conf_object_t *obj, void *data)>
 
using ev_value_setter = std::add_pointer_t< void *(conf_object_t *obj, attr_value_t value)>
 
using ev_describe = std::add_pointer_t< char *(conf_object_t *obj, void *data)>
 
using bits_type = std::vector< std::pair< uint8_t *, uint8_t > >
 
using LogGroups = std::initializer_list< std::string >
 Type used for log group names.
 
using bank_t = std::tuple< Name, Description, std::vector< register_t > >
 
using bank_memory_t = std::unordered_map< Offset, uint8_t >
 
using Name = detail::HierarchicalObjectName
 Type used to name a resource.
 
using Description = std::string_view
 Type used to describe a resource.
 
using Offset = detail::ConstSizeT
 Type used for memory address offset.
 
using BitWidth = detail::ConstSizeT
 Type used for the number/width of bit.
 
using InitValue = detail::ConstSizeT
 Type used for initial value.
 
using ByteSize = detail::ConstSizeT
 Type used for the number/size of byte TODO(xiuliang): add valid value checker?
 
using Stride = detail::ConstSizeT
 Type used for the stride of register/field array.
 
using field_t = std::tuple< Name, Description, Offset, BitWidth >
 
using register_t = std::tuple< Name, Description, Offset, ByteSize, InitValue, std::vector< field_t > >
 
using register_memory_t = std::vector< uint8_t * >
 

Enumerations

enum class  Inquiry : bool { Inquiry = true , NonInquiry = false }
 
enum class  ByteOrder { BE , LE }
 
enum class  CallbackType : int { AR = 1 , AW , BR , BW }
 
enum class  Level { BANK = 0 , REGISTER = 1 , FIELD = 2 }
 

Functions

template<typename T >
std::enable_if< std::is_enum< T >::value, attr_value_t >::type std_to_attr (const T &src)
 Function transforms C++ enum type T to Simics attr_value_t.
 
template<typename T >
std::enable_if< std::is_base_of< ConnectBase, T >::value, attr_value_t >::type std_to_attr (const T &src)
 Function transforms C++ ConnectBase type T to Simics attr_value_t.
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_base_of< ConnectBase, T >::value, attr_value_t >::type std_to_attr (const T &src)
 Function transforms C++ standard type T to Simics attr_value_t.
 
template<typename T >
std::enable_if< std::is_enum< T >::value, T >::type attr_to_std (attr_value_t src)
 Function transforms Simics attr_value_t to C++ enum type.
 
template<typename T >
std::enable_if< std::is_base_of< ConnectBase, T >::value, T >::type attr_to_std (attr_value_t src)
 Function transforms Simics attr_value_t to C++ ConnectBase derived type.
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_base_of< ConnectBase, T >::value, T >::type attr_to_std (attr_value_t src)
 Function transforms Simics attr_value_t to C++ standard type.
 
template<typename T >
std::string attr_type_str ()
 
template<typename TBankPort >
ConfClassPtr make_bank_port (const std::string &name, const std::string &desc)
 
template<typename TBankPort , typename TArg >
ConfClassPtr make_bank_port (const std::string &name, const std::string &desc, TArg *arg)
 
template<typename TParent >
void create_hierarchy_from_register_data (ConfClass *cls, const bank_t &bank)
 
template<typename TParent >
void create_hierarchy_from_register_data (ConfClass *cls, std::initializer_list< bank_t > register_data)
 
std::pair< size_t, size_t > overlap_range (size_t r1_start, size_t r1_end, size_t r2_start, size_t r2_end)
 
int array_index (const std::string &name)
 Return the array index if name is using an array format like array[N].
 
std::vector< std::string > expand_names (const std::string &name, const char delimiter='.')
 If name contains an array indicator, i.e.
 
template<typename T >
void decorate_class (...)
 Overload it with specific implementation by including the other header before this file.
 
template<typename T >
ConfClassPtr make_class (const std::string &name, const std::string &short_desc, const std::string &description, const class_kind_t kind=Sim_Class_Kind_Vanilla)
 A factory method to create a ConfClassPtr which associate with the C++ class T.
 
template<typename T , typename A >
ConfClassPtr make_class (const std::string &name, const std::string &short_desc, const std::string &description, A *constructor_arg, const class_kind_t kind=Sim_Class_Kind_Vanilla)
 A factory method to create a ConfClassPtr which associate with the C++ class T with argument A.
 
template<typename T >
T * from_obj (conf_object_t *obj)
 Utility function to convert a conf_object_t* to a pointer to C++ class derived from simics::ConfObject.
 
template<typename IFACE >
IFACE * get_interface (conf_object_t *obj)
 Return the Simics C++ interface class from a configuration object.
 

Typedef Documentation

◆ attr_getter

using simics::attr_getter = typedef std::add_pointer_t<attr_value_t(conf_object_t *)>

◆ attr_setter

using simics::attr_setter = typedef std::add_pointer_t<set_error_t(conf_object_t *, attr_value_t *)>

◆ bank_memory_t

using simics::bank_memory_t = typedef std::unordered_map<Offset, uint8_t>

◆ bank_t

using simics::bank_t = typedef std::tuple<Name, Description, std::vector<register_t> >

◆ bits_type

using simics::bits_type = typedef std::vector<std::pair<uint8_t *, uint8_t> >

◆ BitWidth

Type used for the number/width of bit.

◆ ByteSize

Type used for the number/size of byte TODO(xiuliang): add valid value checker?

◆ ConfClassPtr

using simics::ConfClassPtr = typedef std::unique_ptr<ConfClass>

◆ Description

using simics::Description = typedef std::string_view

Type used to describe a resource.

◆ ev_callback

using simics::ev_callback = typedef std::add_pointer_t<void(conf_object_t *, void *)>

◆ ev_describe

using simics::ev_describe = typedef std::add_pointer_t<char *(conf_object_t *obj, void *data)>

◆ ev_destroy

◆ ev_value_getter

using simics::ev_value_getter = typedef std::add_pointer_t<attr_value_t(conf_object_t *obj, void *data)>

◆ ev_value_setter

using simics::ev_value_setter = typedef std::add_pointer_t<void *(conf_object_t *obj, attr_value_t value)>

◆ field_t

using simics::field_t = typedef std::tuple<Name, Description, Offset, BitWidth>

◆ InitValue

Type used for initial value.

◆ LogGroups

using simics::LogGroups = typedef std::initializer_list<std::string>

Type used for log group names.

◆ Name

Type used to name a resource.

◆ Offset

Type used for memory address offset.

◆ register_memory_t

using simics::register_memory_t = typedef std::vector<uint8_t *>

◆ register_t

using simics::register_t = typedef std::tuple<Name, Description, Offset, ByteSize, InitValue, std::vector<field_t> >

◆ Stride

Type used for the stride of register/field array.

Enumeration Type Documentation

◆ ByteOrder

enum class simics::ByteOrder
strong
Enumerator
BE 
LE 

◆ CallbackType

enum class simics::CallbackType : int
strong
Enumerator
AR 
AW 
BR 
BW 

◆ Inquiry

enum class simics::Inquiry : bool
strong
Enumerator
Inquiry 
NonInquiry 

◆ Level

enum class simics::Level
strong
Enumerator
BANK 
REGISTER 
FIELD 

Function Documentation

◆ array_index()

int simics::array_index ( const std::string &  name)

Return the array index if name is using an array format like array[N].

Otherwise, -1 is returned.

◆ attr_to_std() [1/3]

template<typename T >
std::enable_if< std::is_enum< T >::value, T >::type simics::attr_to_std ( attr_value_t  src)
inline

Function transforms Simics attr_value_t to C++ enum type.

◆ attr_to_std() [2/3]

template<typename T >
std::enable_if< std::is_base_of< ConnectBase, T >::value, T >::type simics::attr_to_std ( attr_value_t  src)
inline

Function transforms Simics attr_value_t to C++ ConnectBase derived type.

◆ attr_to_std() [3/3]

template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_base_of< ConnectBase, T >::value, T >::type simics::attr_to_std ( attr_value_t  src)
inline

Function transforms Simics attr_value_t to C++ standard type.

◆ attr_type_str()

template<typename T >
std::string simics::attr_type_str ( )
inline

◆ create_hierarchy_from_register_data() [1/2]

template<typename TParent >
void simics::create_hierarchy_from_register_data ( ConfClass cls,
const bank_t bank 
)

◆ create_hierarchy_from_register_data() [2/2]

template<typename TParent >
void simics::create_hierarchy_from_register_data ( ConfClass cls,
std::initializer_list< bank_t register_data 
)

◆ decorate_class()

template<typename T >
void simics::decorate_class (   ...)

Overload it with specific implementation by including the other header before this file.

◆ expand_names()

std::vector< std::string > simics::expand_names ( const std::string &  name,
const char  delimiter = '.' 
)

If name contains an array indicator, i.e.

port[N], return a list that contains all expanded index names, i.e. port[0], port[1], ... Otherwise a list with only the name is returned. Multi-dimensional arrays are not supported. Multi-level names with level delimiter is supported, i.e. a[N].b[M] is expanded to N * M names.

◆ from_obj()

template<typename T >
T * simics::from_obj ( conf_object_t obj)
inline

Utility function to convert a conf_object_t* to a pointer to C++ class derived from simics::ConfObject.

◆ get_interface()

template<typename IFACE >
IFACE * simics::get_interface ( conf_object_t obj)

Return the Simics C++ interface class from a configuration object.

◆ make_bank_port() [1/2]

template<typename TBankPort >
ConfClassPtr simics::make_bank_port ( const std::string &  name,
const std::string &  desc 
)

◆ make_bank_port() [2/2]

template<typename TBankPort , typename TArg >
ConfClassPtr simics::make_bank_port ( const std::string &  name,
const std::string &  desc,
TArg *  arg 
)

◆ make_class() [1/2]

template<typename T , typename A >
ConfClassPtr simics::make_class ( const std::string &  name,
const std::string &  short_desc,
const std::string &  description,
A *  constructor_arg,
const class_kind_t  kind = Sim_Class_Kind_Vanilla 
)

A factory method to create a ConfClassPtr which associate with the C++ class T with argument A.

It calls init_class if T defines it.

See also
ConfClass::create
Parameters
namethe name of the creating class.
short_desca short class description for the class.
descriptiona description string describes the class.
constructor_argargument passed to the object factory constructor.
kindan enum determine if the configuration object should be saved when a checkpoint is created.
Returns
a ConfClassPtr

◆ make_class() [2/2]

template<typename T >
ConfClassPtr simics::make_class ( const std::string &  name,
const std::string &  short_desc,
const std::string &  description,
const class_kind_t  kind = Sim_Class_Kind_Vanilla 
)

A factory method to create a ConfClassPtr which associate with the C++ class T.

It calls init_class if T defines it.

See also
ConfClass::create
Parameters
namethe name of the creating class.
short_desca short class description for the class.
descriptiona description string describes the class.
kindan enum determine if the configuration object should be saved when a checkpoint is created.
Returns
a ConfClassPtr

◆ overlap_range()

std::pair< size_t, size_t > simics::overlap_range ( size_t  r1_start,
size_t  r1_end,
size_t  r2_start,
size_t  r2_end 
)

◆ std_to_attr() [1/3]

template<typename T >
std::enable_if< std::is_enum< T >::value, attr_value_t >::type simics::std_to_attr ( const T &  src)
inline

Function transforms C++ enum type T to Simics attr_value_t.

◆ std_to_attr() [2/3]

template<typename T >
std::enable_if< std::is_base_of< ConnectBase, T >::value, attr_value_t >::type simics::std_to_attr ( const T &  src)
inline

Function transforms C++ ConnectBase type T to Simics attr_value_t.

◆ std_to_attr() [3/3]

template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_base_of< ConnectBase, T >::value, attr_value_t >::type simics::std_to_attr ( const T &  src)
inline

Function transforms C++ standard type T to Simics attr_value_t.