PandA-2024.02
|
This class describes a generic systemC action. More...
#include <structural_objects.hpp>
Public Types | |
enum | process_type { THREAD = 0, CTHREAD, METHOD, SERVICE, UNKNOWN } |
Define the possible types of a process. More... | |
Public Member Functions | |
action_o (int debug_level, const structural_objectRef o) | |
Constructor. More... | |
~action_o () override=default | |
destructor More... | |
void | add_parameter (structural_objectRef d) |
Add a procedure paramenter. More... | |
const structural_objectRef | get_parameter (unsigned int n) const |
Return the ith input parameter. More... | |
unsigned int | get_parameters_size () const |
Return the number of the parameters. More... | |
void | set_fun_id (unsigned int id) |
Function that set the function with the action. More... | |
unsigned int | get_fun_id () const |
Return the function id. More... | |
void | set_action_type (process_type at) |
Set the type of the action. More... | |
process_type | get_action_type () const |
Return the type of the action. More... | |
void | add_event_to_sensitivity (structural_objectRef e) |
Add an event to the sensitivity list of the action. More... | |
unsigned int | get_sensitivity_size () const |
Return tha size of the sensitivity list. More... | |
const structural_objectRef | get_sensitivity (unsigned int n) const |
Return a specific event of the sensitivity list. More... | |
void | set_scope (const std::string &sc) |
Set the scope of the action. More... | |
const std::string & | get_scope () const |
Return the scope of the action. More... | |
bool | get_process_nservice () const |
Return the type of the action: process (true) or services (false). More... | |
void | copy (structural_objectRef dest) const override |
Perform a copy of the action. More... | |
structural_objectRef | find_member (const std::string &id, so_kind type, const structural_objectRef owner) const override |
Return the object named id of a given type which belongs to or it is associated with the object. More... | |
structural_objectRef | find_isomorphic (const structural_objectRef key) const override |
Find key in this object. More... | |
void | xload (const xml_element *Enode, structural_objectRef owner, structural_managerRef const &CM) override |
Load a structural_object starting from an xml file. More... | |
void | xwrite (xml_element *rootnode) override |
Add a structural_object to an xml tree. More... | |
void | print (std::ostream &os) const override |
Print the action (for debug purpose) More... | |
Public Member Functions inherited from structural_object | |
structural_object (int debug_level, const structural_objectRef o) | |
Constructor for the structural_object. More... | |
virtual | ~structural_object ()=default |
virtual destructor More... | |
const structural_objectRef | get_owner () const |
Return the owner. More... | |
void | set_owner (const structural_objectRef new_owner) |
set the owner of the structural object More... | |
void | set_treenode (unsigned int n) |
Set the treenode id associated with the structural_object. More... | |
unsigned int | get_treenode () const |
Return the treenode id associated with the structural_object. More... | |
void | set_id (const std::string &s) |
Set the identifier associated with the structural_object. More... | |
const std::string & | get_id () const |
Return the identifier associated with the structural_object. More... | |
void | set_type (const structural_type_descriptorRef &s) |
Set the type of the structural_object. More... | |
const structural_type_descriptorRef & | get_typeRef () const |
Return the type descriptor of the structural_object. More... | |
void | type_resize (unsigned long long new_bit_size) |
Just resize the size of the bits of the object. More... | |
void | type_resize (unsigned long long new_bit_size, unsigned long long new_vec_size) |
resizing of vector objects More... | |
void | set_black_box (bool bb) |
Set the black box property associated with the structural_object. More... | |
bool | get_black_box () const |
Return the black box property. More... | |
void | SetParameter (const std::string &name, const std::string &value) |
Set a parameter value. More... | |
bool | ExistsParameter (std::string name) const |
Check if a parameter has been specified. More... | |
std::string | GetParameter (std::string name) const |
Get the value associated to parameter if it has been associated; if it has not specified returns the default. More... | |
std::string | GetDefaultParameter (std::string name) const |
Get the value associated to parameter if it has been associate; It throws an exception if it has not been associated. More... | |
CustomMap< std::string, std::string > | GetParameters () const |
return the whole set of parameters More... | |
virtual void | AddParameter (const std::string &name, const std::string &default_value) |
Add a parameter. More... | |
const std::string | get_path () const |
Return a unique identifier of the structural object. More... | |
virtual std::string | get_kind_text () const =0 |
Virtual function used to get the string name of a structural_object instance. More... | |
virtual enum so_kind | get_kind () const =0 |
Virtual function used to find the real type of a structural_object instance. More... | |
Private Attributes | |
std::vector< structural_objectRef > | parameters |
The method procedure parameter. More... | |
unsigned int | function_id |
The index of the function which represents the behavior. More... | |
process_type | action_type |
The type of the action. More... | |
std::vector< structural_objectRef > | action_sensitivity |
Sensitivity list. More... | |
std::string | scope |
Used to identify the scope of the action (public, private or protected) More... | |
Static Private Attributes | |
static const char * | process_typeNames [] = {"THREAD", "CTHREAD", "METHOD", "SERVICE", "UNKNOWN"} |
Redefinition of get_kind_text() More... | |
Additional Inherited Members | |
Protected Member Functions inherited from structural_object | |
std::string | convert_so_short (so_kind in) const |
Convert a so_kind in a short string. More... | |
Protected Attributes inherited from structural_object | |
friend | structural_manager |
int | debug_level |
debug level for the object More... | |
Static Protected Attributes inherited from structural_object | |
static simple_indent | PP |
pretty print functor object used by all print members to indent the output of the print function. More... | |
This class describes a generic systemC action.
An action can be a SystemC process or a standard service (aka a member function of a class).
Definition at line 1295 of file structural_objects.hpp.
Define the possible types of a process.
Enumerator | |
---|---|
THREAD | |
CTHREAD | |
METHOD | |
SERVICE | |
UNKNOWN |
Definition at line 1301 of file structural_objects.hpp.
action_o::action_o | ( | int | debug_level, |
const structural_objectRef | o | ||
) |
Constructor.
o | is the owner of the action. |
Definition at line 1989 of file structural_objects.cpp.
|
overridedefault |
destructor
void action_o::add_event_to_sensitivity | ( | structural_objectRef | e | ) |
Add an event to the sensitivity list of the action.
e | is an event. |
Definition at line 2031 of file structural_objects.cpp.
References action_sensitivity, and THROW_ASSERT.
Referenced by copy(), and xload().
void action_o::add_parameter | ( | structural_objectRef | d | ) |
Add a procedure paramenter.
d | is the paramenter. |
Definition at line 1994 of file structural_objects.cpp.
References parameters, and THROW_ASSERT.
Referenced by copy(), and xload().
|
overridevirtual |
Perform a copy of the action.
dest | destination object. |
Reimplemented from structural_object.
Definition at line 2063 of file structural_objects.cpp.
References action_sensitivity, action_type, add_event_to_sensitivity(), add_parameter(), structural_object::copy(), structural_object::debug_level, function_id, parameters, and scope.
|
overridevirtual |
Find key in this object.
key | is the object searched. |
Implements structural_object.
Definition at line 2084 of file structural_objects.cpp.
References THROW_ERROR.
|
overridevirtual |
Return the object named id of a given type which belongs to or it is associated with the object.
id | is the identifier of the object we are looking for. |
type | is the type of the object we are looking for. |
owner | is the owner of the object named id. |
Implements structural_object.
Definition at line 2090 of file structural_objects.cpp.
References action_o_K, action_sensitivity, bus_connection_o_K, channel_o_K, component_o_K, constant_o_K, data_o_K, event_o_K, parameters, port_o_K, port_vector_o_K, process_typeNames, signal_o_K, signal_vector_o_K, and THROW_ERROR.
action_o::process_type action_o::get_action_type | ( | ) | const |
Return the type of the action.
Definition at line 2026 of file structural_objects.cpp.
References action_type.
unsigned int action_o::get_fun_id | ( | ) | const |
Return the function id.
Definition at line 2016 of file structural_objects.cpp.
References function_id.
const structural_objectRef action_o::get_parameter | ( | unsigned int | n | ) | const |
Return the ith input parameter.
n | is the index of the input parameter. |
Definition at line 2000 of file structural_objects.cpp.
References parameters, and THROW_ASSERT.
unsigned int action_o::get_parameters_size | ( | ) | const |
Return the number of the parameters.
Definition at line 2006 of file structural_objects.cpp.
References parameters.
bool action_o::get_process_nservice | ( | ) | const |
Return the type of the action: process (true) or services (false).
Definition at line 2058 of file structural_objects.cpp.
References action_type, and SERVICE.
const std::string & action_o::get_scope | ( | ) | const |
Return the scope of the action.
Definition at line 2053 of file structural_objects.cpp.
References scope.
const structural_objectRef action_o::get_sensitivity | ( | unsigned int | n | ) | const |
Return a specific event of the sensitivity list.
n | is the index of the event. |
Definition at line 2042 of file structural_objects.cpp.
References action_sensitivity, and THROW_ASSERT.
unsigned int action_o::get_sensitivity_size | ( | ) | const |
Return tha size of the sensitivity list.
Definition at line 2037 of file structural_objects.cpp.
References action_sensitivity.
|
overridevirtual |
Print the action (for debug purpose)
os | is an output stream |
Reimplemented from structural_object.
Definition at line 2200 of file structural_objects.cpp.
References action_sensitivity, action_type, parameters, structural_object::PP, structural_object::print(), process_typeNames, scope, and SERVICE.
void action_o::set_action_type | ( | process_type | at | ) |
Set the type of the action.
at | is the type of the action. |
Definition at line 2021 of file structural_objects.cpp.
References action_type.
void action_o::set_fun_id | ( | unsigned int | id | ) |
Function that set the function with the action.
id | is the index of the function |
Definition at line 2011 of file structural_objects.cpp.
References function_id.
void action_o::set_scope | ( | const std::string & | sc | ) |
Set the scope of the action.
sc | is the actual scope. |
Definition at line 2048 of file structural_objects.cpp.
References scope.
|
overridevirtual |
Load a structural_object starting from an xml file.
node | is a node of the xml tree. |
owner | is the refcount version of this. |
CM | is the circuit manager. |
someone has to take care of GM
Reimplemented from structural_object.
Definition at line 2133 of file structural_objects.cpp.
References action_type, add_event_to_sensitivity(), add_parameter(), CE_XVM, xml_child::get_children(), GET_CLASS_NAME, structural_manager::get_debug_level(), LOAD_XVFM, LOAD_XVM, process_typeNames, scope, UNKNOWN, and structural_object::xload().
|
overridevirtual |
Add a structural_object to an xml tree.
rootnode | is the root node at which the xml representation of the structural object is attached. |
someone has to take care of GM
Reimplemented from structural_object.
Definition at line 2177 of file structural_objects.cpp.
References action_sensitivity, action_type, xml_child::add_child_element(), structural_object::get_kind_text(), parameters, process_typeNames, scope, WRITE_XNVM, WRITE_XVM, and structural_object::xwrite().
|
private |
Sensitivity list.
Definition at line 1321 of file structural_objects.hpp.
Referenced by add_event_to_sensitivity(), copy(), find_member(), get_sensitivity(), get_sensitivity_size(), print(), and xwrite().
|
private |
The type of the action.
Definition at line 1318 of file structural_objects.hpp.
Referenced by copy(), get_action_type(), get_process_nservice(), print(), set_action_type(), xload(), and xwrite().
|
private |
The index of the function which represents the behavior.
Definition at line 1315 of file structural_objects.hpp.
Referenced by copy(), get_fun_id(), and set_fun_id().
|
private |
The method procedure parameter.
Definition at line 1312 of file structural_objects.hpp.
Referenced by add_parameter(), copy(), find_member(), get_parameter(), get_parameters_size(), print(), and xwrite().
|
staticprivate |
Redefinition of get_kind_text()
Redefinition of get_kind()store the names of the enumerative process_type.
Definition at line 1461 of file structural_objects.hpp.
Referenced by find_member(), print(), xload(), and xwrite().
|
private |
Used to identify the scope of the action (public, private or protected)
Definition at line 1324 of file structural_objects.hpp.
Referenced by copy(), get_scope(), print(), set_scope(), xload(), and xwrite().