67 unsigned int _funId,
const DesignFlowManagerConstRef _design_flow_manager,
69 :
HLSFunctionStep(_parameters, _HLSMgr, _funId, _design_flow_manager, _hls_flow_step_type)
80 switch(relationship_type)
84 const auto cg_man =
HLSMgr->CGetCallGraphManager();
86 (cg_man->ExistsAddressedFunction() ||
parameters->getOption<
bool>(OPT_memory_mapped_top)))
101 auto omp_functions = GetPointer<OmpFunctions>(
HLSMgr->Rfuns);
102 THROW_ASSERT(omp_functions,
"OMP_functions must not be null");
103 if(omp_functions->kernel_functions.find(
funId) != omp_functions->kernel_functions.end())
107 if(omp_functions->parallelized_functions.find(
funId) != omp_functions->parallelized_functions.end())
111 if(omp_functions->atomic_functions.find(
funId) != omp_functions->atomic_functions.end())
160 THROW_ASSERT(GetPointer<port_o>(sig1)->get_ports_size(),
"");
169 const std::string& port2_name,
const std::string& signal_name)
172 unsigned long long size1;
173 if(port1_name.find(
'[') != std::string::npos)
175 const auto port1_base_name = port1_name.substr(0, port1_name.find(
'['));
176 const auto port1_index =
177 port1_name.substr(port1_name.find(
'[') + 1, port1_name.size() - port1_base_name.size() - 2);
180 port1 = GetPointer<port_o>(port1_vector)->get_port(static_cast<unsigned>(std::stoul(port1_index)));
181 size1 = GetPointer<port_o>(port1_vector)->get_typeRef()->vector_size;
190 unsigned long long size2;
191 if(port2_name.find(
'[') != std::string::npos)
193 const auto port2_base_name = port2_name.substr(0, port2_name.find(
'['));
194 const auto port2_index =
195 port2_name.substr(port2_name.find(
'[') + 1, port2_name.size() - port2_base_name.size() - 2);
198 port2 = GetPointer<port_o>(port2_vector)->get_port(static_cast<unsigned>(std::stoul(port2_index)));
199 size2 = GetPointer<port_o>(port2_vector)->get_typeRef()->vector_size;
208 "---Connecting " + component1->
get_id() +
"::" + port1_name +
" (Size " +
STR(size1) +
") to " +
209 component2->
get_id() +
"::" + port2_name +
" (Size " +
STR(size2) +
")");
212 GetPointer<port_o>(port2)->type_resize(size1);
216 GetPointer<port_o>(port1)->type_resize(size2);
218 const auto bounded_object = GetPointer<port_o>(port1)->find_bounded_object();
233 const std::string& port2_name)
236 unsigned long long size1;
237 if(port1_name.find(
'[') != std::string::npos)
239 const auto port1_base_name = port1_name.substr(0, port1_name.find(
'['));
240 const auto port1_index =
241 port1_name.substr(port1_name.find(
'[') + 1, port1_name.size() - port1_base_name.size() - 2);
244 port1 = GetPointer<port_o>(port1_vector)->get_port(static_cast<unsigned>(std::stoul(port1_index)));
245 size1 = GetPointer<port_o>(port1_vector)->get_typeRef()->vector_size;
254 unsigned long long size2;
255 if(port2_name.find(
'[') != std::string::npos)
257 const auto port2_base_name = port2_name.substr(0, port2_name.find(
'['));
258 const auto port2_index =
259 port2_name.substr(port2_name.find(
'[') + 1, port2_name.size() - port2_base_name.size() - 2);
262 port2 = GetPointer<port_o>(port2_vector)->get_port(static_cast<unsigned>(std::stoul(port2_index)));
263 size2 = GetPointer<port_o>(port2_vector)->get_typeRef()->vector_size;
272 "---Connecting " + component1->
get_id() +
"::" + port1_name +
" (Size " +
STR(size1) +
") to " +
273 component2->
get_id() +
"::" + port2_name +
" (Size " +
STR(size2) +
")");
276 GetPointer<port_o>(port2)->type_resize(size1);
280 GetPointer<port_o>(port1)->type_resize(size2);
286 const std::string& port_name,
const std::string& constant_value,
287 const unsigned long long constant_size)
290 unsigned long long size;
291 if(port_name.find(
'[') != std::string::npos)
293 const auto port_base_name = port_name.substr(0, port_name.find(
'['));
294 const auto port_index = port_name.substr(port_name.find(
'[') + 1, port_name.size() - port_base_name.size() - 2);
297 port = GetPointer<port_o>(port_vector)->get_port(static_cast<unsigned>(std::stoul(port_index)));
298 size = GetPointer<port_o>(port_vector)->get_typeRef()->vector_size;
304 size = GetPointer<port_o>(port)->get_port_size();
305 if(size < constant_size)
307 GetPointer<port_o>(port)->type_resize(constant_size);
311 "---Binding " + constant_value +
" to " + component->
get_id() +
"::" + port_name);
316 constant->set_type(constant_type);
317 GetPointer<module>(SM->
get_circ())->add_internal_object(constant);
void add_connection(structural_objectRef src, structural_objectRef dest)
Create a connection between a source structural object and a destination structural object...
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Data structure representing the entire HLS information.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
module_interface(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type)
Constructor.
refcount< structural_type_descriptor > structural_type_descriptorRef
RefCount type definition of the structural_type_descriptor class structure.
File containing functions and utilities to support the printing of debug messagges.
This step adds the current module to the technology library.
Structure representing the most relevant information about the type of a structural object...
const std::string & get_id() const
Return the identifier associated with the structural_object.
const structural_objectRef get_circ() const
Get a reference to circ field.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
Datastructure to represent a memory symbol in HLS.
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
virtual structural_objectRef find_member(const std::string &id, so_kind type, const structural_objectRef owner) const =0
Return the object named id of a given type which belongs to or it is associated with the object...
Base class to model interfaces for high-level synthesis.
#define STR(s)
Macro which performs a lexical_cast to a string.
~module_interface() override
Destructor.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
const std::string get_path() const
Return a unique identifier of the structural object.
Target must be reexecuted.
redefinition of set to manage ordered/unordered structures
const ParameterConstRef parameters
Set of input parameters.
#define GET_TYPE_SIZE(structural_obj)
Macro returning the size of the type of a structural object.
This class describes all classes used to represent a structural object.
const structural_type_descriptorRef & get_typeRef() const
Return the type descriptor of the structural_object.
static structural_objectRef add_sign(std::string id, structural_objectRef owner, structural_type_descriptorRef sign_type, unsigned int treenode=0)
Create a new signal.
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
void AddSignal(const structural_managerRef SM, const structural_objectRef component1, const std::string &port1, const structural_objectRef component2, const std::string &port2, const std::string &signal_name)
Connects two ports by adding a signal.
void AddConstant(const structural_managerRef SM, const structural_objectRef component, const std::string &port, const std::string &constant, const unsigned long long size)
Connects a constant to a port.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
this class is used to manage the command-line or XML options.
Class implementation of the structural_manager.
int debug_level
The debug level.
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
This class describes a constant value.
Information about speciaization of add_library.
void AddConnection(const structural_managerRef SM, const structural_objectRef component1, const std::string &port1, const structural_objectRef component2, const std::string &port2)
Connects two ports by adding a signal.
Datastructure to describe functions allocation in high-level synthesis.
void add_sign_vector(const structural_managerRef SM, const structural_objectRef sig1, const structural_objectRef sig2, const std::string &sig_name)
Connects two ports by adding a vector signal (i.e., wire)
Data structure definition for high-level synthesis flow.
void add_sign(const structural_managerRef SM, const structural_objectRef sig1, const structural_objectRef sig2, const std::string &sig_name)
Connects two ports by adding a signal (i.e., wire)
Datastructure to represent memory information in high-level synthesis.
A brief description of the C++ Header File.
static structural_objectRef add_sign_vector(std::string id, unsigned int n_signs, structural_objectRef owner, structural_type_descriptorRef sign_type, unsigned int treenode=0)
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...