PandA-2024.02
|
This class describes a simple logic/RTL signal. More...
#include <structural_objects.hpp>
Public Member Functions | |
signal_o (int debug_level, const structural_objectRef o, so_kind _signal_type) | |
Constructor. More... | |
~signal_o () override=default | |
Destructor. More... | |
void | add_port (structural_objectRef p) |
Bind the connection object with a port. More... | |
void | remove_port (structural_objectRef s) |
remove the connection of this signal with a port More... | |
bool | is_connected (structural_objectRef s) const |
void | substitute_port (structural_objectRef old_conn, structural_objectRef new_conn) |
void | set_critical () |
set the signal as critical with respect to the timing path More... | |
bool | get_critical () const |
return if the component is critical or not More... | |
const structural_objectRef | get_port (unsigned int n) const |
Return the ith port bounded to the connection. More... | |
structural_objectRef | get_port (unsigned int n) |
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... | |
bool | is_full_connected () const |
Return if signal has both input and output. More... | |
void | add_n_signals (unsigned int n_signals, structural_objectRef owner) |
Specify the number of ports of a generic port_vector object and add its corresponding ports. More... | |
const structural_objectRef | get_signal (unsigned int n) const |
Return the ith port of the vector. More... | |
const structural_objectRef | get_positional_signal (unsigned int n) const |
Return the ith port of the vector with respect to lsb. More... | |
unsigned int | get_signals_size () const |
Return the number of ports. More... | |
unsigned int | get_lsb () const |
return the index of the least significant port More... | |
void | copy (structural_objectRef dest) const override |
Perform a copy of the signal. 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 signal (for debug purpose) More... | |
std::string | get_kind_text () const override |
return the name of the class as a string. More... | |
enum so_kind | get_kind () const override |
return the type of the class 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... | |
Static Public Attributes | |
static const unsigned int | PARAMETRIC_SIGNAL = static_cast<unsigned int>(-1) |
Private Attributes | |
std::vector< Wrefcount< structural_object > > | connected_objects |
List of ports bound to the signal object. More... | |
bool | is_critical |
when true the signal is involved into the critical path of the netlist More... | |
std::vector< structural_objectRef > | signals_ |
The list of signals associated with the vector of signals. More... | |
unsigned int | lsb |
so_kind | signal_type |
port type 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 simple logic/RTL signal.
A signal can be an array of bit but it cannot be sliced or partially accessed. In case of partial access or slicing the bus_connection_o object should be used.
Definition at line 1576 of file structural_objects.hpp.
signal_o::signal_o | ( | int | debug_level, |
const structural_objectRef | o, | ||
so_kind | _signal_type | ||
) |
Constructor.
o | is the owner of the port |
Definition at line 2406 of file structural_objects.cpp.
Referenced by add_n_signals(), copy(), and xload().
|
overridedefault |
Destructor.
void signal_o::add_n_signals | ( | unsigned int | n_signals, |
structural_objectRef | owner | ||
) |
Specify the number of ports of a generic port_vector object and add its corresponding ports.
It can be done only on port_vectors not yet specialized. The type of the port is equal to the type descriptor of the port_vector.
n_signals | is the number of signals. |
owner | is the reference version of "this". |
Definition at line 2822 of file structural_objects.cpp.
References structural_object::debug_level, refcount< T >::get(), structural_object::get_typeRef(), PARAMETRIC_SIGNAL, structural_object::set_id(), structural_object::set_type(), signal_o(), signal_o_K, signal_type, signal_vector_o_K, signals_, and THROW_ASSERT.
void signal_o::add_port | ( | structural_objectRef | p | ) |
Bind the connection object with a port.
p | is the port |
Definition at line 2421 of file structural_objects.cpp.
References connected_objects, and THROW_ASSERT.
Referenced by xload().
|
overridevirtual |
Perform a copy of the signal.
dest | destination object. |
someone has to take care of connected_objects
Reimplemented from structural_object.
Definition at line 2633 of file structural_objects.cpp.
References structural_object::copy(), structural_object::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_object::get_path(), is_critical, lsb, PRINT_DBG_MEX, set_critical(), signal_o(), signal_o_K, and signals_.
|
overridevirtual |
Find key in this object.
key | is the object searched. |
Please pay attention to this: connected_objects are not built in this moment! check first the if key is part of a port vector
port_vector at the same level
primary ports
simple port at the same level
search key in the owner
search the owner of the key and then the key
Implements structural_object.
Definition at line 2652 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, structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), port_o_K, port_vector_o_K, signal_o_K, signal_vector_o_K, signals_, THROW_ASSERT, 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. |
Implements structural_object.
Definition at line 2591 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, structural_object::get_kind_text(), port_o_K, port_vector_o_K, signal_o_K, signal_vector_o_K, signals_, and THROW_ERROR.
unsigned int signal_o::get_connected_objects_size | ( | ) | const |
Return the number of ports associated with the connection.
Definition at line 2524 of file structural_objects.cpp.
References connected_objects.
bool signal_o::get_critical | ( | ) | const |
return if the component is critical or not
Definition at line 2416 of file structural_objects.cpp.
References is_critical.
|
inlineoverridevirtual |
return the type of the class
Implements structural_object.
Definition at line 1731 of file structural_objects.hpp.
|
inlineoverridevirtual |
return the name of the class as a string.
Implements structural_object.
Definition at line 1717 of file structural_objects.hpp.
References signal_vector_o_K.
Referenced by xwrite().
|
inline |
return the index of the least significant port
Definition at line 1668 of file structural_objects.hpp.
References structural_type_descriptor::copy(), key, structural_type_descriptor::print(), structural_type_descriptor::xload(), and structural_type_descriptor::xwrite().
const structural_objectRef signal_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 2435 of file structural_objects.cpp.
References connected_objects, and THROW_ASSERT.
structural_objectRef signal_o::get_port | ( | unsigned int | n | ) |
Return the ith port bounded to the connection.
n | is the index of the port. |
Definition at line 2441 of file structural_objects.cpp.
References connected_objects, structural_object::get_path(), STR, and THROW_ASSERT.
const structural_objectRef signal_o::get_positional_signal | ( | unsigned int | n | ) | const |
Return the ith port of the vector with respect to lsb.
It also checks if the port exists
n | is the index of the port |
Definition at line 2848 of file structural_objects.cpp.
References lsb, signals_, and THROW_ASSERT.
const structural_objectRef signal_o::get_signal | ( | unsigned int | n | ) | const |
Return the ith port of the vector.
It checks that a port exists at position n.
n | is the index of the port |
Definition at line 2840 of file structural_objects.cpp.
References structural_object::get_path(), signals_, STR, and THROW_ASSERT.
unsigned int signal_o::get_signals_size | ( | ) | const |
Return the number of ports.
When the port_vector has not yet specialized 0 is returned.
Definition at line 2854 of file structural_objects.cpp.
References signals_, and THROW_ASSERT.
bool signal_o::is_connected | ( | structural_objectRef | s | ) | const |
Definition at line 2465 of file structural_objects.cpp.
References connected_objects, and THROW_ASSERT.
bool signal_o::is_full_connected | ( | ) | const |
Return if signal has both input and output.
Definition at line 2529 of file structural_objects.cpp.
References connected_objects, and structural_object::get_owner().
|
overridevirtual |
Print the signal (for debug purpose)
os | is an output stream |
Reimplemented from structural_object.
Definition at line 2791 of file structural_objects.cpp.
References connected_objects, structural_object::convert_so_short(), structural_object::PP, structural_object::print(), and signals_.
void signal_o::remove_port | ( | structural_objectRef | s | ) |
remove the connection of this signal with a port
s | is the connection |
Definition at line 2447 of file structural_objects.cpp.
References connected_objects, and THROW_ASSERT.
void signal_o::set_critical | ( | ) |
set the signal as critical with respect to the timing path
Definition at line 2411 of file structural_objects.cpp.
References is_critical.
Referenced by copy().
void signal_o::substitute_port | ( | structural_objectRef | old_conn, |
structural_objectRef | new_conn | ||
) |
Definition at line 2483 of file structural_objects.cpp.
References connected_objects, and THROW_ASSERT.
|
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 the connected_objects
Reimplemented from structural_object.
Definition at line 2714 of file structural_objects.cpp.
References add_port(), component_o_K, structural_object::find_member(), xml_child::get_children(), GET_CLASS_NAME, structural_manager::get_debug_level(), structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), legalize(), lsb, max, min, port_o_K, port_vector_o_K, structural_object::set_id(), signal_o(), signal_o_K, signal_type, signal_vector_o_K, signals_, THROW_ASSERT, 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. |
Reimplemented from structural_object.
Definition at line 2776 of file structural_objects.cpp.
References xml_child::add_child_element(), connected_objects, get_kind_text(), structural_object::get_path(), test_panda::lock, signals_, WRITE_XNVM2, and structural_object::xwrite().
|
private |
List of ports bound to the signal object.
Definition at line 1738 of file structural_objects.hpp.
Referenced by add_port(), find_member(), get_connected_objects_size(), get_port(), is_connected(), is_full_connected(), print(), remove_port(), substitute_port(), and xwrite().
|
private |
when true the signal is involved into the critical path of the netlist
Definition at line 1741 of file structural_objects.hpp.
Referenced by copy(), get_critical(), and set_critical().
|
private |
Definition at line 1746 of file structural_objects.hpp.
Referenced by copy(), get_positional_signal(), and xload().
|
static |
Definition at line 1579 of file structural_objects.hpp.
Referenced by add_n_signals(), and structural_manager::add_sign_vector().
|
private |
port type
Definition at line 1749 of file structural_objects.hpp.
Referenced by add_n_signals(), and xload().
|
private |
The list of signals associated with the vector of signals.
Definition at line 1744 of file structural_objects.hpp.
Referenced by add_n_signals(), copy(), find_isomorphic(), find_member(), get_positional_signal(), get_signal(), get_signals_size(), print(), xload(), and xwrite().