PandA-2024.02
|
Structure representing the most relevant information about the type of a structural object. More...
#include <structural_objects.hpp>
Public Types | |
enum | s_type { OTHER = 0, BOOL, INT, UINT, REAL, USER, VECTOR_BOOL, VECTOR_INT, VECTOR_UINT, VECTOR_REAL, VECTOR_USER, UNKNOWN } |
Define the possible type of a structural object. More... | |
Public Member Functions | |
structural_type_descriptor () | |
Constructor. More... | |
structural_type_descriptor (const std::string &type_name, unsigned long long vector_size) | |
Object factory. More... | |
structural_type_descriptor (const std::string &module_name) | |
Object factory for module objects. More... | |
structural_type_descriptor (unsigned int index, const BehavioralHelperConstRef helper) | |
Object factory used in HLS. More... | |
~structural_type_descriptor ()=default | |
Destructor. More... | |
void | copy (structural_type_descriptorRef dest) |
Method that copies the contents of the current structural_type_descriptorRef into another structural_type_descriptor. More... | |
const std::string | get_name () const |
Returns the name of the type descriptor. More... | |
void | xload (const xml_element *Enode, structural_type_descriptorRef owner) |
Load a structural_type_descriptor starting from an xml file. More... | |
void | xwrite (xml_element *rootnode) |
Add a structural_type_descriptor to an xml tree. More... | |
void | print (std::ostream &os) const |
function that prints the class. More... | |
std::string | get_kind_text () const |
Definition of get_kind_text() More... | |
Static Public Member Functions | |
static bool | check_type (structural_type_descriptorRef src_type, structural_type_descriptorRef dest_type) |
Check if two type descriptors are consistent. More... | |
Data Fields | |
s_type | type |
The type of the port or the signal. More... | |
unsigned long long | size |
The size of the object (in bit). The objects having a size are: ports, signals, channels, data, and actions. More... | |
unsigned long long | vector_size |
The number of the elements of a vector. More... | |
std::string | id_type |
Original type id of the structural object. More... | |
unsigned int | treenode |
Treenode id of the type. More... | |
Static Private Attributes | |
static const char * | s_typeNames [] |
store the names of the enumerative s_type. More... | |
default values associated with the members of the structural_type_descriptor class. | |
static const s_type | type_DEFAULT = OTHER |
static const unsigned int | treenode_DEFAULT = 0 |
static const unsigned int | size_DEFAULT = 0 |
static const unsigned int | vector_size_DEFAULT = 0 |
Friends | |
std::ostream & | operator<< (std::ostream &os, const structural_type_descriptorRef o) |
Friend definition of the << operator. More... | |
Structure representing the most relevant information about the type of a structural object.
In case the structural object is a signal or a port all member has a real meaning, while when the structural object is a channel, component, event, data or an action the only relevant information stored into the descriptor is the id_type and treenode when available. The size member has also a relevant meaning when a channel, data, and an action? is considered.
Definition at line 130 of file structural_objects.hpp.
Define the possible type of a structural object.
Enumerator | |
---|---|
OTHER | |
BOOL | |
INT | |
UINT | |
REAL | |
USER | |
VECTOR_BOOL | |
VECTOR_INT | |
VECTOR_UINT | |
VECTOR_REAL | |
VECTOR_USER | |
UNKNOWN |
Definition at line 133 of file structural_objects.hpp.
|
inline |
Constructor.
Definition at line 167 of file structural_objects.hpp.
Referenced by structural_type_descriptor().
structural_type_descriptor::structural_type_descriptor | ( | const std::string & | type_name, |
unsigned long long | vector_size | ||
) |
Object factory.
type_name | is the string starting from which the object is built. |
vector_size | is the size of the the vector. In case vector_size is zero the descriptor type represents a scalar object, otherwise an array. |
first set defaults
Definition at line 306 of file structural_objects.cpp.
References BOOL, INT, REAL, size, size_DEFAULT, THROW_ERROR, type, UINT, UNKNOWN, VECTOR_BOOL, VECTOR_INT, VECTOR_REAL, and VECTOR_UINT.
|
inlineexplicit |
Object factory for module objects.
treenode | is the treenode descriptor of the type. |
Definition at line 185 of file structural_objects.hpp.
References check_type(), copy(), get_name(), index, print(), structural_type_descriptor(), xload(), xwrite(), and ~structural_type_descriptor().
structural_type_descriptor::structural_type_descriptor | ( | unsigned int | index, |
const BehavioralHelperConstRef | helper | ||
) |
Object factory used in HLS.
index | is the index descriptor of the type |
helper | is the BehavioralHelper |
first set defaults
Definition at line 398 of file structural_objects.cpp.
References BOOL, BehavioralHelper::get_size(), BehavioralHelper::get_type(), BehavioralHelper::GetElements(), BehavioralHelper::GetUnqualified(), id_type, INT, BehavioralHelper::is_a_complex(), BehavioralHelper::is_a_pointer(), BehavioralHelper::is_a_struct(), BehavioralHelper::is_a_vector(), BehavioralHelper::is_an_array(), BehavioralHelper::is_an_union(), BehavioralHelper::is_bool(), BehavioralHelper::is_int(), BehavioralHelper::is_real(), BehavioralHelper::is_unsigned(), BehavioralHelper::print_type(), REAL, size, size_DEFAULT, STR, THROW_ERROR, treenode, type, UINT, UNKNOWN, USER, VECTOR_BOOL, VECTOR_INT, VECTOR_REAL, vector_size, vector_size_DEFAULT, VECTOR_UINT, and VECTOR_USER.
|
default |
|
static |
Check if two type descriptors are consistent.
src_type | is the first type descriptor. |
dest_type | is the second type descriptor. |
Definition at line 511 of file structural_objects.cpp.
References BOOL, id_type, INT, structural_object::PP, print(), REAL, size, THROW_WARNING, treenode, treenode_DEFAULT, type, UINT, UNKNOWN, USER, VECTOR_BOOL, VECTOR_INT, vector_size, and VECTOR_UINT.
Referenced by WB4_interface::build_WB4_complete_logic(), structural_manager::check_type(), and structural_type_descriptor().
void structural_type_descriptor::copy | ( | structural_type_descriptorRef | dest | ) |
Method that copies the contents of the current structural_type_descriptorRef into another structural_type_descriptor.
dest | is the reference to the structural_type_descriptor where the contents have to be written |
Definition at line 170 of file structural_objects.cpp.
References id_type, size, treenode, type, and vector_size.
Referenced by structural_object::copy(), signal_o::get_lsb(), fu_binding::join_merge_split(), and structural_type_descriptor().
|
inline |
Definition of get_kind_text()
Definition at line 248 of file structural_objects.hpp.
Referenced by xwrite().
const std::string structural_type_descriptor::get_name | ( | ) | const |
Returns the name of the type descriptor.
Definition at line 90 of file structural_objects.cpp.
References s_typeNames, type, and UNKNOWN.
Referenced by structural_manager::add_connection(), conn_binding::add_datapath_connection(), classic_datapath::add_ports(), structural_type_descriptor(), and VHDL_writer::write_port_binding().
void structural_type_descriptor::print | ( | std::ostream & | os | ) | const |
function that prints the class.
os | is the output stream |
Definition at line 179 of file structural_objects.cpp.
References BOOL, id_type, INT, OTHER, REAL, size, STR, THROW_ASSERT, THROW_ERROR, treenode, type, UINT, UNKNOWN, USER, VECTOR_BOOL, VECTOR_INT, VECTOR_REAL, vector_size, VECTOR_UINT, and VECTOR_USER.
Referenced by check_type(), port_o::get_lsb(), signal_o::get_lsb(), verilog_writer::may_slice_string(), VHDL_writer::may_slice_string(), structural_type_descriptor(), and verilog_writer::type_converter_size().
void structural_type_descriptor::xload | ( | const xml_element * | Enode, |
structural_type_descriptorRef | owner | ||
) |
Load a structural_type_descriptor starting from an xml file.
node | is a node of the xml tree. |
owner | is the refcount version of this. |
Definition at line 102 of file structural_objects.cpp.
References BOOL, CE_XVM, id_type, LOAD_XVFM, LOAD_XVM, s_typeNames, size, THROW_ASSERT, treenode, type, type_DEFAULT, UNKNOWN, and vector_size.
Referenced by signal_o::get_lsb(), structural_type_descriptor(), and structural_object::xload().
void structural_type_descriptor::xwrite | ( | xml_element * | rootnode | ) |
Add a structural_type_descriptor to an xml tree.
rootnode | is the root node at which the xml representation of the structural type descriptor is attached. |
Definition at line 145 of file structural_objects.cpp.
References xml_child::add_child_element(), get_kind_text(), id_type, s_typeNames, size, size_DEFAULT, treenode, treenode_DEFAULT, type, type_DEFAULT, vector_size, WRITE_XNVM, and WRITE_XVM.
Referenced by signal_o::get_lsb(), structural_type_descriptor(), and structural_object::xwrite().
|
friend |
Friend definition of the << operator.
Definition at line 256 of file structural_objects.hpp.
std::string structural_type_descriptor::id_type |
Original type id of the structural object.
Definition at line 159 of file structural_objects.hpp.
Referenced by structural_manager::build_graph(), check_type(), computeResources(), copy(), AllocationInformation::estimate_call_delay(), WB4Intercon_interface::exec(), module::get_in_port(), structural_object::GetParameter(), structural_object::GetParameters(), cs_interface::InternalExec(), add_library::InternalExec(), WB4_interface::InternalExec(), ParallelMemoryFuBinding::manage_module_ports(), print(), structural_object::SetParameter(), structural_type_descriptor(), VHDL_writer::type_converter(), verilog_writer::type_converter(), verilog_writer::type_converter_size(), structural_object::type_resize(), TestbenchGeneration::write_verilator_testbench(), xload(), xwrite(), and port_o::xwrite().
|
staticprivate |
store the names of the enumerative s_type.
Definition at line 276 of file structural_objects.hpp.
Referenced by get_name(), legalize(), xload(), and xwrite().
unsigned long long structural_type_descriptor::size |
The size of the object (in bit). The objects having a size are: ports, signals, channels, data, and actions.
Definition at line 153 of file structural_objects.hpp.
Referenced by conn_binding::add_datapath_connection(), ModuleGeneratorManager::add_port_parameters(), minimal_interface::build_wrapper(), check_type(), copy(), port_o::get_port_size(), verilog_writer::may_slice_string(), VHDL_writer::may_slice_string(), conn_binding::mux_allocation(), print(), port_o::set_port_size(), ModuleGeneratorManager::specialize_fu(), structural_type_descriptor(), verilog_writer::type_converter_size(), VHDL_writer::type_converter_size(), structural_object::type_resize(), VHDL_writer::write_module_parametrization(), verilog_writer::write_module_parametrization(), VHDL_writer::write_port_binding(), verilog_writer::write_signal_declaration(), VHDL_writer::write_signal_declaration(), xload(), and xwrite().
|
staticprivate |
Definition at line 272 of file structural_objects.hpp.
Referenced by structural_type_descriptor(), and xwrite().
unsigned int structural_type_descriptor::treenode |
Treenode id of the type.
Definition at line 162 of file structural_objects.hpp.
Referenced by minimal_interface::build_wrapper(), check_type(), copy(), print(), structural_type_descriptor(), xload(), and xwrite().
|
staticprivate |
Definition at line 271 of file structural_objects.hpp.
Referenced by check_type(), and xwrite().
s_type structural_type_descriptor::type |
The type of the port or the signal.
Definition at line 150 of file structural_objects.hpp.
Referenced by conn_binding::add_datapath_connection(), RTLCharacterization::add_input_register(), RTLCharacterization::add_output_register(), FunctionalUnitStep::AnalyzeFu(), minimal_interface::build_wrapper(), allocation::BuildProxyFunctionVHDL(), check_type(), copy(), get_name(), fu_binding::join_merge_split(), verilog_writer::may_slice_string(), VHDL_writer::may_slice_string(), conn_binding::mux_allocation(), print(), RTLCharacterization::resize_port(), fu_binding::specialise_fu(), structural_type_descriptor(), verilog_writer::type_converter(), VHDL_writer::type_converter(), verilog_writer::type_converter_size(), structural_object::type_resize(), VHDL_writer::write_module_parametrization(), verilog_writer::write_module_parametrization(), VHDL_writer::write_module_parametrization_decl(), VHDL_writer::write_port_binding(), verilog_writer::write_signal_declaration(), VHDL_writer::write_signal_declaration(), xload(), and xwrite().
Definition at line 270 of file structural_objects.hpp.
unsigned long long structural_type_descriptor::vector_size |
The number of the elements of a vector.
Definition at line 156 of file structural_objects.hpp.
Referenced by ModuleGeneratorManager::add_port_parameters(), check_type(), copy(), verilog_writer::may_slice_string(), VHDL_writer::may_slice_string(), print(), ModuleGeneratorManager::specialize_fu(), structural_type_descriptor(), verilog_writer::type_converter_size(), VHDL_writer::type_converter_size(), structural_object::type_resize(), VHDL_writer::write_module_parametrization(), verilog_writer::write_module_parametrization(), verilog_writer::write_signal_declaration(), VHDL_writer::write_signal_declaration(), xload(), and xwrite().
|
staticprivate |
Definition at line 273 of file structural_objects.hpp.
Referenced by structural_type_descriptor().