77 bool addedLoad =
false;
78 bool addedStore =
false;
79 bool andStartMemOp_required =
false;
81 for(
unsigned int j = 0; j < GetPointer<module>(circuit)->get_in_port_size(); j++)
84 std::string port_name = GetPointer<port_o>(port_i)->get_id();
86 if(found != std::string::npos)
90 found = port_name.find(
"STORE");
91 if(found != std::string::npos)
96 for(
unsigned int j = 0; j < GetPointer<module>(circuit)->get_internal_objects_size(); j++)
103 THROW_ASSERT(startMemOp !=
nullptr,
"No start port for mem_ctrl_found");
104 andStartMemOp_required =
true;
109 unsigned int num_suspension = 0;
110 unsigned int n_elements = GetPointer<module>(circuit)->get_internal_objects_size();
112 for(i = 0; i < n_elements; i++)
116 curr_gate->
get_id() !=
"scheduler_kernel")
122 if(num_suspension == 0 && !addedLoad && !addedStore && !andStartMemOp_required)
127 GetPointer<module>(circuit)->add_internal_object(constantFalse);
133 HLS->
HLS_D->get_technology_manager());
139 if(GetPointer<port_o>(port_in_or)->get_ports_size() != 0)
141 THROW_ERROR(
"Or start with more than 0 input port");
145 GetPointer<port_o>(port_in_or)->add_n_ports(2, port_in_or);
147 for(
unsigned int j = 0; j < GetPointer<module>(circuit)->get_in_port_size(); j++)
150 std::string port_name = GetPointer<port_o>(port_i)->get_id();
152 if(found != std::string::npos)
156 found = port_name.find(
"STORE");
157 if(found != std::string::npos)
168 HLS->
HLS_D->get_technology_manager());
173 if(GetPointer<port_o>(port_in_and)->get_ports_size() != 0)
175 THROW_ERROR(
"And start with more than 0 input port");
179 GetPointer<port_o>(port_in_and)->add_n_ports(2, port_in_and);
184 for(
unsigned int j = 0; j < GetPointer<module>(circuit)->get_internal_objects_size(); j++)
191 THROW_ASSERT(startMemOp !=
nullptr,
"No start port for mem_ctrl_found");
200 HLS->
HLS_D->get_technology_manager());
205 if(GetPointer<port_o>(port_in_or_glo)->get_ports_size() != 0)
207 THROW_ERROR(
"Or start with more than 0 input port");
211 GetPointer<port_o>(port_in_or_glo)->add_n_ports(1 + num_suspension, port_in_or_glo);
215 if(num_suspension > 0)
217 unsigned int num_signal_or = 0;
218 for(i = 0; i < n_elements; i++)
222 if(port_suspension_module !=
nullptr and curr_gate->
get_id() !=
"scheduler_kernel")
240 auto omp_functions = GetPointer<OmpFunctions>(HLSMgr->Rfuns);
241 if(omp_functions->kernel_functions.find(HLS->
functionId) != omp_functions->kernel_functions.end())
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.
Data structure representing the entire HLS information.
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.
#define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
structural_managerRef datapath
Store the datapath description.
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.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
const structural_objectRef get_circ() const
Get a reference to circ field.
virtual void add_to_SM(const HLS_managerRef HLSMgr, const hlsRef HLS, const structural_managerRef SM)
Add the interconnection to the structural representation of the datapath.
generic_objRef get_port(unsigned int var, direction_type dir)
Returns reference to generic object associated to a given variable, for a specific port direction...
const HLS_deviceRef HLS_D
reference to the information representing the target for the synthesis
void add_to_SM(const HLS_managerRef HLSMgr, const hlsRef HLS, const structural_managerRef SM) override
add_to_SM
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...
Class specification of the manager of the technology library data structures.
~conn_binding_cs() override
Destructor.
#define GET_TYPE_NAME(structural_obj)
Macro returning the string name of a type.
#define STR(s)
Macro which performs a lexical_cast to a string.
void connectOutOr(const HLS_managerRef HLSMgr, const hlsRef HLS, structural_objectRef port_out_or)
connectOutOr depending if module is kernel or another connect out
Class specification of the data structures used to manage technology information. ...
Class managing the interconnection binding.
void instantiate_suspension_component(const HLS_managerRef HLSMgr, const hlsRef HLS)
connect_suspension_component
This file collects some utility functions and macros.
conn_binding_cs(const BehavioralHelperConstRef BH, const ParameterConstRef parameters)
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
structural_objectRef add_module_from_technology_library(const std::string &id, const std::string &fu_name, const std::string &library_name, const structural_objectRef owner, const technology_managerConstRef TM)
Create a new object starting from a library component.
This class describes all classes used to represent a 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.
this class is used to manage the command-line or XML options.
unsigned int functionId
this is the identifier of the function to be implemented
Class implementation of the structural_manager.
This class describes a constant value.
int debug_level
control the verbosity during the debugging
Datastructure to describe functions allocation in high-level synthesis.
Data structure definition for high-level synthesis flow.
HLS specialization of generic_device.
void set_type(const structural_type_descriptorRef &s)
Set the type of the structural_object.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...