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

class which houses all four rule containers, only allocated if utilized. More...

#include <callback_overlay.h>

Inheritance diagram for sme::callback_overlay:

Public Member Functions

 callback_overlay ()
 Construct a new callback overlay object.
 
 ~callback_overlay ()
 Destroy the callback overlay object.
 
pattern_rule_containerget_rule_container (stage::E _stage)
 Get the rule container object.
 
void deactivate_rule (stage::E _stage, std::string _name)
 deactivates rule by name at stage.
 
void activate_rule (stage::E _stage, std::string _name)
 activates rule by name at stage.
 
void process_pre_read_rules (uint64_t _old_value, uint64_t _new_value)
 processes pre_read_rules.
 
void process_post_read_rules (uint64_t _old_value, uint64_t _new_value)
 processes post_read_rules.
 
void process_pre_write_rules (uint64_t _old_value, uint64_t _new_value)
 processes pre_write_rules.
 
void process_post_write_rules (uint64_t _old_value, uint64_t _new_value)
 processes post_write_rules.
 
I_pattern_ruleadd_rule (std::function< void()> _func, stage::E _stage, type::E _type, std::string _name,...)
 add a rule to this entity.
 
I_pattern_ruleadd_user_rule (std::function< void(uint64_t, uint64_t)> _func, stage::E _stage, std::string _name,...)
 

Protected Member Functions

_keep_hot I_pattern_rule__add_rule (std::function< void()> _func, stage::E _stage, type::E _type, std::string _name, std::vector< uint64_t > &_ordered_args)
 real implementation of add a rule to this entity (decompressed va_list).
 
_keep_hot I_pattern_rule__add_rule (std::function< void(uint64_t, uint64_t)> _func, stage::E _stage, type::E _type, std::string _name, va_list &args)
 real implementation of add a rule to this entity (decompressed va_list).
 
void delete_rules_from_container (pattern_rule_container *_rule_container)
 Free the memory from the rules within the rule container.
 

Protected Attributes

pattern_rule_containerm_pre_read
 pre_read rule container (ptr).
 
pattern_rule_containerm_post_read
 post_read rule container (ptr).
 
pattern_rule_containerm_pre_write
 pre_write rule container (ptr).
 
pattern_rule_containerm_post_write
 post_write rule container (ptr).
 

Detailed Description

class which houses all four rule containers, only allocated if utilized.

Constructor & Destructor Documentation

◆ callback_overlay()

sme::callback_overlay::callback_overlay ( )
inline

Construct a new callback overlay object.

◆ ~callback_overlay()

sme::callback_overlay::~callback_overlay ( )
inline

Destroy the callback overlay object.

Member Function Documentation

◆ __add_rule() [1/2]

_keep_hot I_pattern_rule * sme::callback_overlay::__add_rule ( std::function< void()>  _func,
stage::E  _stage,
type::E  _type,
std::string  _name,
std::vector< uint64_t > &  _ordered_args 
)
inlineprotected

real implementation of add a rule to this entity (decompressed va_list).

For pre-defined rules.

Parameters
_funcis a lambda definition of what should occur.
_stageof processing
_typeof rule
_nameof rule
argsva_list of args for rule creation
Returns
I_pattern_rule* new rule or nullptr if failed to allocate

◆ __add_rule() [2/2]

_keep_hot I_pattern_rule * sme::callback_overlay::__add_rule ( std::function< void(uint64_t, uint64_t)>  _func,
stage::E  _stage,
type::E  _type,
std::string  _name,
va_list &  args 
)
inlineprotected

real implementation of add a rule to this entity (decompressed va_list).

For user defined rules.

Parameters
_funcis a lambda definition of what should occur.
_stageof processing
_typeof rule
_nameof rule
argsva_list of args for rule creation
Returns
I_pattern_rule* new rule or nullptr if failed to allocate

◆ activate_rule()

void sme::callback_overlay::activate_rule ( stage::E  _stage,
std::string  _name 
)
inline

activates rule by name at stage.

Parameters
_stageof processing
_nameof rule

◆ add_rule()

I_pattern_rule * sme::callback_overlay::add_rule ( std::function< void()>  _func,
stage::E  _stage,
type::E  _type,
std::string  _name,
  ... 
)
inline

add a rule to this entity.

Parameters
_funcis a lambda definition of what should occur. For scoping reasons the lambda is typically declared as: [this]() -> void { do_something_interesting(); });
_stageof processing
_typeof rule
_nameof rule
...:: variadic parameters for rule creation, please see notify.h, masked.h, pattern.h, rising_bit.h, falling_bit.h
Returns
I_pattern_rule* new rule or nullptr if failed to allocate

◆ add_user_rule()

I_pattern_rule * sme::callback_overlay::add_user_rule ( std::function< void(uint64_t, uint64_t)>  _func,
stage::E  _stage,
std::string  _name,
  ... 
)
inline

◆ deactivate_rule()

void sme::callback_overlay::deactivate_rule ( stage::E  _stage,
std::string  _name 
)
inline

deactivates rule by name at stage.

Parameters
_stageof processing
_nameof rule

◆ delete_rules_from_container()

void sme::callback_overlay::delete_rules_from_container ( pattern_rule_container _rule_container)
inlineprotected

Free the memory from the rules within the rule container.

Parameters
_rule_containeris a container to clean the rule memory from.

◆ get_rule_container()

pattern_rule_container * sme::callback_overlay::get_rule_container ( stage::E  _stage)
inline

Get the rule container object.

Parameters
_stagedetermines which rule container
Returns
pattern_rule_container*

◆ process_post_read_rules()

void sme::callback_overlay::process_post_read_rules ( uint64_t  _old_value,
uint64_t  _new_value 
)
inline

processes post_read_rules.

Parameters
_old_valuevalue of the register/field
_new_valuecould be a modified new value, usually same as old

◆ process_post_write_rules()

void sme::callback_overlay::process_post_write_rules ( uint64_t  _old_value,
uint64_t  _new_value 
)
inline

processes post_write_rules.

Parameters
_old_valuevalue of the register/field
_new_valuenew value of the register/field (from bus)

◆ process_pre_read_rules()

void sme::callback_overlay::process_pre_read_rules ( uint64_t  _old_value,
uint64_t  _new_value 
)
inline

processes pre_read_rules.

Parameters
_old_valuevalue of the register/field
_new_valuealways the same as the old value

◆ process_pre_write_rules()

void sme::callback_overlay::process_pre_write_rules ( uint64_t  _old_value,
uint64_t  _new_value 
)
inline

processes pre_write_rules.

Parameters
_old_valuevalue of the register/field
_new_valuenew value of the register/field (from bus)

Member Data Documentation

◆ m_post_read

pattern_rule_container* sme::callback_overlay::m_post_read
protected

post_read rule container (ptr).

◆ m_post_write

pattern_rule_container* sme::callback_overlay::m_post_write
protected

post_write rule container (ptr).

◆ m_pre_read

pattern_rule_container* sme::callback_overlay::m_pre_read
protected

pre_read rule container (ptr).

◆ m_pre_write

pattern_rule_container* sme::callback_overlay::m_pre_write
protected

pre_write rule container (ptr).


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