46 #ifndef STRUCTURAL_OBJECTS_HPP 47 #define STRUCTURAL_OBJECTS_HPP 50 #include "config_HAVE_TECHNOLOGY_BUILT.hpp" 58 #include <boost/preprocessor/seq/for_each.hpp> 83 #define HIERARCHY_SEPARATOR "/" 85 #define MEMORY_PARAMETER "MEMORY_PARAMETER" 86 #define PIPE_PARAMETER "PIPE_PARAMETER" 87 #define VALUE_PARAMETER "VALUE_PARAMETER" 90 #define CLOCK_PORT_NAME "clock" 91 #define WENABLE_PORT_NAME "wenable" 92 #define START_PORT_NAME "start_port" 93 #define RESET_PORT_NAME "reset" 94 #define DONE_PORT_NAME "done_port" 95 #define RETURN_PORT_NAME "return_port" 96 #define START_PORT_NAME_CFC "start_port_CFC" 97 #define DONE_PORT_NAME_CFC "done_port_CFC" 98 #define MOUT_OE_PORT_NAME "Mout_oe_ram" 99 #define MOUT_BACK_PRESSURE_PORT_NAME "Mout_back_pressure" 100 #define PRESENT_STATE_PORT_NAME "present_state" 101 #define NEXT_STATE_PORT_NAME "next_state" 102 #define NOTIFIER_PORT_MISMATCH "out_mismatch" 103 #define NOTIFIER_PORT_MISMATCH_ID "out_mismatch_id" 104 #define NOTIFIER_PORT_MISMATCH_OFFSET "out_mismatch_trace_offset" 105 #define SELECTOR_REGISTER_FILE "selector_register_file" 106 #define SUSPENSION "suspension" 107 #define REQUEST_ACCEPTED "request_accepted" 108 #define TASKS_POOL_END "task_pool_end" 109 #define DONE_SCHEDULER "done_scheduler" 110 #define DONE_REQUEST "done_request" 111 #define PROXY_PREFIX "PROXY_PREF_" 112 #define WRAPPED_PROXY_PREFIX "WRAPPED_PROXY_PREF_" 117 #define GET_SO_KIND_TEXT(meth) \ 118 std::string get_kind_text() const override \ 120 return std::string(#meth); \ 189 id_type(module_name),
243 void print(std::ostream& os)
const;
250 return std::string(
"structural_type_descriptor");
282 #define GET_TYPE_NAME(structural_obj) ((structural_obj)->get_typeRef()->id_type) 287 #define GET_TYPE_SIZE(structural_obj) \ 288 ((structural_obj)->get_typeRef()->vector_size ? \ 289 ((structural_obj)->get_typeRef()->vector_size * (structural_obj)->get_typeRef()->size) : \ 290 (structural_obj)->get_typeRef()->size) 295 #define STD_GET_SIZE(structural_obj) \ 296 ((structural_obj)->vector_size ? ((structural_obj)->vector_size * (structural_obj)->size) : (structural_obj)->size) 325 #define GET_SO_KIND(meth) \ 326 enum so_kind get_kind() const override \ 367 std::string convert_so_short(
so_kind in)
const;
371 #if HAVE_TECHNOLOGY_BUILT 372 std::vector<std::string> attribute_list;
374 std::map<std::string, attributeRef> attributes;
402 void set_treenode(
unsigned int n);
407 unsigned int get_treenode()
const;
413 void set_id(
const std::string& s);
418 const std::string& get_id()
const;
434 void type_resize(
unsigned long long new_bit_size);
439 void type_resize(
unsigned long long new_bit_size,
unsigned long long new_vec_size);
445 void set_black_box(
bool bb);
450 bool get_black_box()
const;
457 void SetParameter(
const std::string& name,
const std::string&
value);
463 bool ExistsParameter(std::string name)
const;
470 std::string GetParameter(std::string name)
const;
478 std::string GetDefaultParameter(std::string name)
const;
491 virtual void AddParameter(
const std::string& name,
const std::string& default_value);
499 const std::string get_path()
const;
536 #if HAVE_TECHNOLOGY_BUILT 548 virtual void print(std::ostream& os)
const;
573 virtual enum so_kind get_kind()
const = 0;
575 #if HAVE_TECHNOLOGY_BUILT 578 attributeRef get_attribute(
const std::string& name)
const;
580 const std::vector<std::string>& get_attribute_list()
const;
589 static const bool black_box_DEFAULT =
true;
598 #define ENUM_ID(r, data, elem) elem, 599 #define PORT_INTERFACE_ENUM \ 600 (PI_RNONE)(PI_WNONE)(PI_RACK)(PI_WACK)(PI_RVALID)(PI_WVALID)(PI_EMPTY_N)(PI_READ)(PI_FULL_N)(PI_WRITE)(PI_FDIN)( \ 601 PI_FDOUT)(PI_ADDRESS)(PI_CHIPENABLE)(PI_WRITEENABLE)(PI_DIN)(PI_DOUT)(PI_M_AXI_OFF)(PI_M_AXI_DIRECT)( \ 602 M_AXI_AWVALID)(M_AXI_AWREADY)(M_AXI_AWADDR)(M_AXI_AWID)(M_AXI_AWLEN)(M_AXI_AWSIZE)(M_AXI_AWBURST)( \ 603 M_AXI_AWLOCK)(M_AXI_AWCACHE)(M_AXI_AWPROT)(M_AXI_AWQOS)(M_AXI_AWREGION)(M_AXI_AWUSER)(M_AXI_WVALID)( \ 604 M_AXI_WREADY)(M_AXI_WDATA)(M_AXI_WSTRB)(M_AXI_WLAST)(M_AXI_WID)(M_AXI_WUSER)(M_AXI_ARVALID)(M_AXI_ARREADY)( \ 605 M_AXI_ARADDR)(M_AXI_ARID)(M_AXI_ARLEN)(M_AXI_ARSIZE)(M_AXI_ARBURST)(M_AXI_ARLOCK)(M_AXI_ARCACHE)(M_AXI_ARPROT)( \ 606 M_AXI_ARQOS)(M_AXI_ARREGION)(M_AXI_ARUSER)(M_AXI_RVALID)(M_AXI_RREADY)(M_AXI_RDATA)(M_AXI_RLAST)(M_AXI_RID)( \ 607 M_AXI_RUSER)(M_AXI_RRESP)(M_AXI_BVALID)(M_AXI_BREADY)(M_AXI_BRESP)(M_AXI_BID)(M_AXI_BUSER)(S_AXIL_AWVALID)( \ 608 S_AXIL_AWREADY)(S_AXIL_AWADDR)(S_AXIL_WVALID)(S_AXIL_WREADY)(S_AXIL_WDATA)(S_AXIL_WSTRB)(S_AXIL_ARVALID)( \ 609 S_AXIL_ARREADY)(S_AXIL_ARADDR)(S_AXIL_RVALID)(S_AXIL_RREADY)(S_AXIL_RDATA)(S_AXIL_RRESP)(S_AXIL_BVALID)( \ 610 S_AXIL_BREADY)(S_AXIL_BRESP)(PI_S_AXIS_TVALID)(PI_S_AXIS_TREADY)(PI_S_AXIS_TDATA)(PI_M_AXIS_TVALID)( \ 611 PI_M_AXIS_TREADY)(PI_M_AXIS_TDATA)(PI_DEFAULT) 613 #define PORT_DIRECTION_ENUM (IN)(OUT)(IO)(GEN)(UNKNOWN)(TLM_IN)(TLM_OUT)(TLM_INOUT) 649 static const unsigned int PARAMETRIC_PORT =
static_cast<unsigned int>(-1);
671 ~
port_o()
override =
default;
701 unsigned int get_connections_size()
const;
736 unsigned int get_port_alignment()
const;
741 void set_port_alignment(
unsigned int algn);
752 void set_port_size(
unsigned int dim);
758 unsigned long long get_port_size()
const;
764 void set_is_var_args(
bool c);
768 bool get_is_var_args()
const;
774 void set_is_clock(
bool c);
778 bool get_is_clock()
const;
784 void set_is_extern(
bool c);
788 bool get_is_extern()
const;
793 void set_bus_bundle(
const std::string& name);
798 std::string get_bus_bundle()
const;
804 void set_is_global(
bool c);
808 bool get_is_global()
const;
814 void set_is_memory(
bool c);
818 bool get_is_memory()
const;
824 void set_is_slave(
bool c);
828 bool get_is_slave()
const;
834 void set_is_master(
bool c);
838 bool get_is_master()
const;
844 void set_is_data_bus(
bool c);
849 bool get_is_data_bus()
const;
855 void set_is_addr_bus(
bool c);
860 bool get_is_addr_bus()
const;
866 void set_is_size_bus(
bool c);
871 bool get_is_size_bus()
const;
877 void set_is_tag_bus(
bool c);
882 bool get_is_tag_bus()
const;
888 void set_is_doubled(
bool c);
893 bool get_is_doubled()
const;
899 void set_is_halved(
bool c);
904 bool get_is_halved()
const;
911 find_bounded_object(
const structural_objectConstRef f_owner = structural_objectConstRef())
const;
921 bool get_critical()
const;
931 bool get_reverse()
const;
968 #if HAVE_TECHNOLOGY_BUILT 994 unsigned int get_ports_size()
const;
1013 static bool resize_if_busport(
unsigned long long bus_size_bitsize,
unsigned long long bus_addr_bitsize,
1014 unsigned long long bus_data_bitsize,
unsigned long long bus_tag_bitsize,
1024 static void resize_std_port(
unsigned long long bitsize_variable,
unsigned long long n_elements,
int debug_level,
1038 void print(std::ostream& os)
const override;
1047 return "port_vector_o";
1129 std::vector<structural_objectRef>
ports;
1138 static const bool is_clock_DEFAULT =
false;
1139 static const bool is_extern_DEFAULT =
false;
1140 static const bool is_global_DEFAULT =
false;
1141 static const bool is_memory_DEFAULT =
false;
1142 static const bool is_slave_DEFAULT =
false;
1143 static const bool is_master_DEFAULT =
false;
1144 static const bool is_data_bus_DEFAULT =
false;
1145 static const bool is_addr_bus_DEFAULT =
false;
1146 static const bool is_tag_bus_DEFAULT =
false;
1147 static const bool is_size_bus_DEFAULT =
false;
1148 static const bool is_doubled_DEFAULT =
false;
1149 static const bool is_halved_DEFAULT =
false;
1150 static const bool is_critical_DEFAULT =
false;
1151 static const bool is_reverse_DEFAULT =
false;
1152 static const bool is_var_args_DEFAULT =
false;
1153 static const unsigned port_interface_alignment_DEFAULT = 0;
1170 ~
event_o()
override =
default;
1212 void print(std::ostream& os)
const override;
1237 ~
data_o()
override =
default;
1279 void print(std::ostream& os)
const override;
1351 unsigned int get_parameters_size()
const;
1357 void set_fun_id(
unsigned int id);
1363 unsigned int get_fun_id()
const;
1385 unsigned int get_sensitivity_size()
const;
1397 void set_scope(
const std::string& sc);
1402 const std::string& get_scope()
const;
1407 bool get_process_nservice()
const;
1448 void print(std::ostream& os)
const override;
1461 static const char* process_typeNames[];
1508 unsigned int get_connected_objects_size()
const;
1513 unsigned long long get_size()
const;
1518 std::string get_value()
const;
1559 void print(std::ostream& os)
const override;
1579 static const unsigned int PARAMETRIC_SIGNAL =
static_cast<unsigned int>(-1);
1609 void set_critical();
1614 bool get_critical()
const;
1631 unsigned int get_connected_objects_size()
const;
1637 bool is_full_connected()
const;
1663 unsigned int get_signals_size()
const;
1712 void print(std::ostream& os)
const override;
1721 return "signal_vector_o";
1850 ~
module()
override =
default;
1855 unsigned int get_num_ports()
const;
1878 unsigned int get_in_port_size()
const;
1895 unsigned int get_out_port_size()
const;
1912 unsigned int get_in_out_port_size()
const;
1929 unsigned int get_gen_port_size()
const;
1935 void remove_port(
const std::string&
id);
1954 unsigned int get_internal_objects_size()
const;
1971 unsigned int get_process_size()
const;
1988 unsigned int get_service_size()
const;
2005 unsigned int get_event_size()
const;
2022 unsigned int get_local_data_size()
const;
2041 std::vector<std::pair<std::string, structural_objectRef>>& parameters)
const;
2072 #if HAVE_TECHNOLOGY_BUILT 2089 bool is_var_args()
const;
2095 void print(std::ostream& os)
const override;
2100 void set_critical();
2105 bool get_critical()
const;
2110 void set_generated();
2115 bool get_generated()
const;
2121 void set_multi_unit_multiplicity(
unsigned int value);
2127 unsigned int get_multi_unit_multiplicity()
const;
2133 void set_keep_hierarchy(
bool ky);
2139 bool get_keep_hierarchy()
const;
2229 #if HAVE_TECHNOLOGY_BUILT 2237 const std::string& name)
const;
2252 void AddParameter(
const std::string& name,
const std::string& default_value)
override;
2305 #if HAVE_TECHNOLOGY_BUILT 2317 void print(std::ostream& os)
const override;
2353 void add_interface(
unsigned int t,
const std::string& _interface);
2359 const std::string& get_interface(
unsigned int t)
const;
2376 unsigned int get_connected_objects_size()
const;
2413 #if HAVE_TECHNOLOGY_BUILT 2425 void print(std::ostream& os)
const override;
2471 unsigned int get_connections_size()
const;
2512 void print(std::ostream& os)
const override;
bool is_reverse
when true the port is dumped as [0:msb-1] instead of [msb-1:0]
std::vector< structural_objectRef > list_of_event
List of event associated with the module.
unsigned int get_lsb() const
return the index of the least significant port
std::vector< structural_objectRef > local_data
List of local data associated with the module.
void set_description(const std::string &d)
Set the description associated with the module.
static const char * s_typeNames[]
store the names of the enumerative s_type.
This class describes a generic data declaration object.
Structure representing the most relevant information about the type of a structural object...
friend std::ostream & operator<<(std::ostream &os, const structural_type_descriptorRef o)
Friend definition of the << operator.
const std::string get_copyright() const
Return the copyright associated with the module.
std::vector< structural_objectRef > signals_
The list of signals associated with the vector of signals.
std::map< std::string, structural_objectRef > index_channels
index for channels this table is used to quickly search internal channels used by find_member and fin...
Simple pretty print functor.
so_kind
Enumerative type for structural object classes, it is used with get_kind() function to know the actua...
std::string description
Store the module description.
This class describes a port associated with a component or a channel.
std::string get_kind_text() const override
return the name of the class as a string.
void set_specialized(const std::string &s)
Set the specialization string.
This class describes a generic channel.
bool is_critical
when true the signal is involved into the critical path of the netlist
bool is_data_bus
when true the port is a data bus
void set_license(const std::string &l)
Set the license associated with the module.
std::string specialized
when non empty it defines with respect what module has been specialized
std::vector< structural_objectRef > list_of_service
List of services associated with the module.
std::map< std::string, structural_objectRef > index_bus_connections
index for bus_connections this table is used to quickly search internal bus_connections used by find_...
This class manages the circuit structures.
CustomOrderedMap< T, U > CustomMap
#define ENUM_ID(r, data, elem)
exceptions managed by PandA
port_direction dir
direction of a port
unsigned int get_lsb() const
return the index of the least significant port
bool is_critical
when true the port is involved into the critical path of the netlist
std::vector< structural_objectRef > in_out_ports
Input-output ports of this module.
This class describes a generic systemC action.
structural_type_descriptorRef type
The description of the type.
std::vector< structural_objectRef > gen_ports
generic ports of this module
const std::string get_description() const
Return the description associated with the module.
bool is_size_bus
when true the port is a size bus
std::map< std::string, structural_objectRef > index_constants
index for constants this table is used to quickly search internal constants used by find_member and f...
#define PORT_DIRECTION_ENUM
friend std::ostream & operator<<(std::ostream &os, const structural_objectRef o)
Friend definition of the << operator.
redefinition of map to manage ordered/unordered structures
bool is_halved
when true the port has a halfed size
CONSTREF_FORWARD_DECL(BehavioralHelper)
so_kind port_type
port type
refcount< technology_node > technology_nodeRef
refcount definition of the class
structural_type_descriptor(const std::string &module_name)
Object factory for module objects.
s_type type
The type of the port or the signal.
port_direction
Enumerative type describing the direction of a port.
bool is_extern
when true the port is an extern port
unsigned long long size
The size of the object (in bit). The objects having a size are: ports, signals, channels, data, and actions.
std::map< unsigned int, std::string > impl_interfaces
List of the interfaces associated with the channel.
unsigned int function_id
The index of the function which represents the behavior.
std::string copyright
Store the copyright description.
static bool check_type(structural_type_descriptorRef src_type, structural_type_descriptorRef dest_type)
Check if two type descriptors are consistent.
std::string id
Identifier for this component.
std::vector< structural_objectRef > parameters
The method procedure parameter.
bool is_addr_bus
when true the port is an address bus
#define PORT_INTERFACE_ENUM
bool is_generated
when true the component has been internally generated
s_type
Define the possible type of a structural object.
static const unsigned int vector_size_DEFAULT
std::vector< Wrefcount< structural_object > > connected_objects
List of ports bound to the signal object.
port_endianess
Enumerative type describing the endianess of a port; NONE means that it has not been specified yet...
This class manages the technology library structures.
port_interface
Enum type describing if the port is associated with a specific interface type.
std::vector< Wrefcount< structural_object > > connected_objects
List of ports bounded by the channel object.
unsigned int treenode
Treenode id of the type.
std::vector< structural_objectRef > action_sensitivity
Sensitivity list.
process_type
Define the possible types of a process.
bool is_memory
when true the port is a memory port
bool is_master
when true the port is a master port
std::vector< structural_objectRef > in_ports
input port of this module
std::string get_kind_text() const
Definition of get_kind_text()
std::map< std::string, structural_objectRef > index_signals
index for signals this table is used to quickly search internal signals used by find_member and find_...
unsigned int treenode
index of the treenode in the tree_manager associated with the structural object.
static simple_indent PP
pretty print functor object used by all print members to indent the output of the print function...
This class describes a generic bus connection.
std::string get_kind_text() const override
return the name of the class as a string.
port_interface pi
port interface type of a port
process_type action_type
The type of the action.
void xload(const xml_element *Enode, structural_type_descriptorRef owner)
Load a structural_type_descriptor starting from an xml file.
void xwrite(xml_element *rootnode)
Add a structural_type_descriptor to an xml tree.
static const unsigned int size_DEFAULT
unsigned int last_position_port
store the last index of the positional binding
Template definition of refcount.
std::string value
Value of this element.
This class describes a simple logic/RTL signal.
Very simple pretty printer functor.
NP_functionalityRef NP_descriptions
Alternative descriptions of the behavior of the module.
const std::string get_specialized() const
Return a non-empty string when the component has been specialized.
unsigned int lsb
least significant bit
bool is_critical
when true the component is involved into the critical path of the netlist
std::string id_type
Original type id of the structural object.
std::string scope
Used to identify the scope of the action (public, private or protected)
std::map< unsigned int, structural_objectRef > positional_map
positional map, given the index return the port in that position
bool black_box
True if the structural object is a black box (e.g., a library component).
bool is_clock
when true the port is a clock port and has to be attached to a clock object
#define GET_SO_KIND_TEXT(meth)
Macro which defines the get_kind_text function that returns the parameter as a string.
bool is_tag_bus
when true the port is a tag bus
std::vector< structural_objectRef > ports
The list of ports associated with the port.
std::string license
Store some tags concerning the license type associated with the functional unit.
int debug_level
debug level for the object
std::vector< Wrefcount< structural_object > > connected_objects
The list of connections associated with the port.
Wrefcount< structural_object > owner
The owner of the object.
structural_type_descriptor()
Constructor.
friend structural_manager
std::string size_parameter
custom size parameter
std::vector< Wrefcount< structural_object > > connected_objects
List of ports bounded by the constant object.
This class describes a generic event.
static const s_type type_DEFAULT
void set_copyright(const std::string &c)
Set the copyright associated with the module.
const std::string get_license() const
Return the license of the functional description of the module.
std::vector< structural_objectRef > out_ports
output ports of this module
Not parsed functionality manager.
so_kind signal_type
port type
std::string bus_bundle
bus bundle
std::vector< structural_objectRef > internal_objects
internal components/channels/signals/bus_connection_os (for structural modules)
This class describes a generic component.
bool is_slave
when true the port is a slave port
~structural_type_descriptor()=default
Destructor.
static const unsigned int treenode_DEFAULT
CustomMap< std::string, std::string > parameters
Map between parameter string and related values of an instance.
bool is_var_args
when true the port must be specialized at runtime depending on the number of input ...
const std::string get_authors() const
Return the authors of the functional description of the module.
void print(std::ostream &os) const
function that prints the class.
This class describes a constant value.
CustomMap< std::string, std::string > default_parameters
Map between parameter string and its default value.
std::map< std::string, structural_objectRef > index_components
index for components this table is used to quickly search internal components used by find_member and...
void set_authors(const std::string &a)
Set the authors associated with the module.
Not parsed functionality descriptor of a module.
This class describes a generic module.
#define GET_SO_KIND(meth)
Macro used to implement get_kind() function in structural_object hyerarchy classes.
const std::string get_name() const
Returns the name of the type descriptor.
bool keep_hierarchy
when true the module has the keep_hierarchy attribute active
Abstract pure class for the technology structure.
std::string authors
Store the list of authors.
bool is_doubled
when true the port has a doubled size
Base object for all the structural objects.
port_endianess end
endianess of a port
REF_FORWARD_DECL(structural_manager)
bool is_global
when true the port is a global port
std::vector< Wrefcount< structural_object > > connections
List of connections associated with the bus.
unsigned long long vector_size
The number of the elements of a vector.
void copy(structural_type_descriptorRef dest)
Method that copies the contents of the current structural_type_descriptorRef into another structural_...
std::vector< structural_objectRef > list_of_process
List of processes associated with the module.
unsigned int multi_unit_multiplicity
multi-unit multiplicity is the number of units implemented by this module all doing the same thing ...