PandA-2024.02
|
This class describes a generic channel. More...
#include <structural_objects.hpp>
Public Member Functions | |
channel_o (int debug_level, const structural_objectRef o) | |
Constructor. More... | |
~channel_o () override=default | |
Destructor. More... | |
void | add_interface (unsigned int t, const std::string &_interface) |
Add an interface to the object. More... | |
const std::string & | get_interface (unsigned int t) const |
Return the interface with a given treenode. More... | |
void | add_port (structural_objectRef p) |
Bind the connection object with a port. More... | |
const structural_objectRef | get_port (unsigned int n) const |
Return the ith port bounded to the connection. More... | |
unsigned int | get_connected_objects_size () const |
Return the number of ports associated with the connection. More... | |
void | copy (structural_objectRef dest) const override |
Perform a copy of the channel. 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 channel (for debug purpose) More... | |
Public Member Functions inherited from module | |
module (int debug_level, const structural_objectRef o) | |
Constructor. More... | |
~module () override=default | |
destructor More... | |
unsigned int | get_num_ports () const |
Return the total number of the ports. More... | |
structural_objectRef | get_positional_port (unsigned int index) const |
return a port of the module given its position More... | |
void | add_in_port (structural_objectRef p) |
Add an input port. More... | |
const structural_objectRef | get_in_port (unsigned int n) const |
Return the ith input port. More... | |
unsigned int | get_in_port_size () const |
Return the number of input ports. More... | |
void | add_out_port (structural_objectRef p) |
Add an output port. More... | |
const structural_objectRef | get_out_port (unsigned int n) const |
Return the ith output port. More... | |
unsigned int | get_out_port_size () const |
Return the number of output ports. More... | |
void | add_in_out_port (structural_objectRef p) |
Add an input-output port. More... | |
const structural_objectRef | get_in_out_port (unsigned int n) const |
Return the ith input-output port. More... | |
unsigned int | get_in_out_port_size () const |
Return the number of output ports. More... | |
void | add_gen_port (structural_objectRef p) |
Add a generic port. More... | |
const structural_objectRef | get_gen_port (unsigned int n) const |
Return the ith generic port. More... | |
unsigned int | get_gen_port_size () const |
Return the number of generic ports. More... | |
void | remove_port (const std::string &id) |
remove a port from the module More... | |
void | add_internal_object (structural_objectRef c) |
Add an internal component/channel/signal/bus_connection_o. More... | |
void | remove_internal_object (structural_objectRef s) |
const structural_objectRef | get_internal_object (unsigned int n) const |
Return the ith internal objects. More... | |
unsigned int | get_internal_objects_size () const |
Return the number of internal objects. More... | |
void | add_process (structural_objectRef p) |
Add a process to the module. More... | |
const structural_objectRef | get_process (unsigned int n) const |
Return the ith process. More... | |
unsigned int | get_process_size () const |
Return the number of internal processes. More... | |
void | add_service (structural_objectRef p) |
Add a service to the module. More... | |
const structural_objectRef | get_service (unsigned int n) const |
Return the ith service. More... | |
unsigned int | get_service_size () const |
Return the number of services. More... | |
void | add_event (structural_objectRef e) |
Add an event to the module. More... | |
const structural_objectRef | get_event (unsigned int n) const |
Return the ith event. More... | |
unsigned int | get_event_size () const |
Return the number of events. More... | |
void | add_local_data (structural_objectRef d) |
Add a local data. More... | |
const structural_objectRef | get_local_data (unsigned int n) const |
Return the ith local data. More... | |
unsigned int | get_local_data_size () const |
Return the number of local data. More... | |
void | set_NP_functionality (NP_functionalityRef f) |
Set the alternative module behavior descriptions (Non SystemC based). More... | |
const NP_functionalityRef & | get_NP_functionality () const |
Return the alternative functionalities. More... | |
void | get_NP_library_parameters (structural_objectRef owner, std::vector< std::pair< std::string, structural_objectRef >> ¶meters) const |
Return the list of object that can be parametrized. More... | |
bool | is_var_args () const |
True if one of the ports of the module has the attribute is_var_args=true. More... | |
void | set_critical () |
set the component as critical with respect to the timing path More... | |
bool | get_critical () const |
return if the component is critical or not More... | |
void | set_generated () |
set the component as generated More... | |
bool | get_generated () const |
return if the component has been generated or not More... | |
void | set_multi_unit_multiplicity (unsigned int value) |
set_multi_unit_multiplicity More... | |
unsigned int | get_multi_unit_multiplicity () const |
get_multi_unit_multiplicity More... | |
void | set_keep_hierarchy (bool ky) |
set_keep_hierarchy More... | |
bool | get_keep_hierarchy () const |
get_keep_hierarchy More... | |
void | change_port_direction (structural_objectRef port, port_o::port_direction pdir) |
change the direction of a port More... | |
const std::string | get_description () const |
Return the description associated with the module. More... | |
void | set_description (const std::string &d) |
Set the description associated with the module. More... | |
const std::string | get_copyright () const |
Return the copyright associated with the module. More... | |
void | set_copyright (const std::string &c) |
Set the copyright associated with the module. More... | |
const std::string | get_authors () const |
Return the authors of the functional description of the module. More... | |
void | set_authors (const std::string &a) |
Set the authors associated with the module. More... | |
const std::string | get_license () const |
Return the license of the functional description of the module. More... | |
void | set_license (const std::string &l) |
Set the license associated with the module. More... | |
const std::string | get_specialized () const |
Return a non-empty string when the component has been specialized. More... | |
void | set_specialized (const std::string &s) |
Set the specialization string. More... | |
void | AddParameter (const std::string &name, const std::string &default_value) override |
Add a parameter. 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... | |
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::map< unsigned int, std::string > | impl_interfaces |
List of the interfaces associated with the channel. More... | |
std::vector< Wrefcount< structural_object > > | connected_objects |
List of ports bounded by the channel object. 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 channel.
Definition at line 2332 of file structural_objects.hpp.
channel_o::channel_o | ( | int | debug_level, |
const structural_objectRef | o | ||
) |
Constructor.
o | is the owner of the channel. |
Definition at line 4806 of file structural_objects.cpp.
|
overridedefault |
Destructor.
void channel_o::add_interface | ( | unsigned int | t, |
const std::string & | _interface | ||
) |
Add an interface to the object.
Definition at line 4810 of file structural_objects.cpp.
References impl_interfaces.
Referenced by copy().
void channel_o::add_port | ( | structural_objectRef | p | ) |
Bind the connection object with a port.
p | is the port |
Definition at line 4820 of file structural_objects.cpp.
References connected_objects, and THROW_ASSERT.
|
overridevirtual |
Perform a copy of the channel.
dest | destination object. |
someone has to take care of connected_objects
Reimplemented from module.
Definition at line 4875 of file structural_objects.cpp.
References add_interface(), module::copy(), and impl_interfaces.
|
overridevirtual |
Find key in this object.
key | is the object searched. |
to be completed
Please pay attention to this: connected_objects are not built in this moment!
object at the same level
search key in the owner
search the owner of the key and then the key
Reimplemented from module.
Definition at line 4886 of file structural_objects.cpp.
References action_o_K, bus_connection_o_K, channel_o_K, component_o_K, constant_o_K, data_o_K, event_o_K, module::find_isomorphic(), structural_object::get_kind(), structural_object::get_owner(), port_o_K, port_vector_o_K, signal_o_K, signal_vector_o_K, and 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. |
Reimplemented from module.
Definition at line 4838 of file structural_objects.cpp.
References action_o_K, bus_connection_o_K, channel_o_K, component_o_K, connected_objects, constant_o_K, data_o_K, event_o_K, module::find_member(), lenet_tvm::mod, port_o_K, port_vector_o_K, signal_o_K, and signal_vector_o_K.
unsigned int channel_o::get_connected_objects_size | ( | ) | const |
Return the number of ports associated with the connection.
Definition at line 4833 of file structural_objects.cpp.
References connected_objects.
const std::string & channel_o::get_interface | ( | unsigned int | t | ) | const |
Return the interface with a given treenode.
n | is the treenode of the interface |
Definition at line 4815 of file structural_objects.cpp.
References impl_interfaces.
const structural_objectRef channel_o::get_port | ( | unsigned int | n | ) | const |
Return the ith port bounded to the connection.
n | is the index of the port. |
Definition at line 4827 of file structural_objects.cpp.
References connected_objects, and THROW_ASSERT.
|
overridevirtual |
Print the channel (for debug purpose)
os | is an output stream |
Reimplemented from module.
Definition at line 4979 of file structural_objects.cpp.
References connected_objects, structural_object::convert_so_short(), impl_interfaces, structural_object::PP, and module::print().
|
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. |
Implements module.
Definition at line 4931 of file structural_objects.cpp.
References xml_child::get_children(), impl_interfaces, and module::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. |
Implements module.
Definition at line 4955 of file structural_objects.cpp.
References xml_child::add_child_element(), connected_objects, structural_object::get_kind_text(), structural_object::get_path(), impl_interfaces, test_panda::lock, WRITE_XNVM2, and module::xwrite().
|
private |
List of ports bounded by the channel object.
Definition at line 2338 of file structural_objects.hpp.
Referenced by add_port(), find_member(), get_connected_objects_size(), get_port(), print(), and xwrite().
|
private |
List of the interfaces associated with the channel.
Definition at line 2335 of file structural_objects.hpp.
Referenced by add_interface(), copy(), get_interface(), print(), xload(), and xwrite().