94 const DesignFlowManagerConstRef _design_flow_manager,
97 _hls_flow_step_specialization)
107 const auto*
const add_library_specialization =
113 switch(relationship_type)
117 if(add_library_specialization->interfaced)
132 auto omp_functions = GetPointer<OmpFunctions>(
HLSMgr->Rfuns);
133 THROW_ASSERT(omp_functions,
"OMP_functions must not be null");
134 if(omp_functions->omp_for_wrappers.find(
funId) != omp_functions->omp_for_wrappers.end())
143 if(omp_functions->kernel_functions.find(
funId) != omp_functions->kernel_functions.end())
147 if(omp_functions->atomic_functions.find(
funId) != omp_functions->atomic_functions.end())
151 if(omp_functions->parallelized_functions.find(
funId) !=
152 omp_functions->parallelized_functions.end())
166 const auto cg_man =
HLSMgr->CGetCallGraphManager();
168 HLSMgr->hasToBeInterfaced(
funId) && (cg_man->ExistsAddressedFunction() ||
169 parameters->getOption<
bool>(OPT_memory_mapped_top)) ?
196 const auto FB =
HLSMgr->CGetFunctionBehavior(
funId);
197 const auto BH = FB->CGetBehavioralHelper();
200 const auto TechM =
HLS->
HLS_D->get_technology_manager();
202 const auto wrapper_tn = TechM->get_fu(wrapped_fu_name,
PROXY_LIBRARY);
205 TechM->get_library_manager(
PROXY_LIBRARY)->remove_fu(wrapped_fu_name);
208 const auto proxy_tn = TechM->get_fu(proxy_fu_name,
PROXY_LIBRARY);
211 TechM->get_library_manager(
PROXY_LIBRARY)->remove_fu(proxy_fu_name);
217 const auto clock_period_value =
HLS->
HLS_C->get_clock_period();
218 const auto cprf =
HLS->
HLS_C->get_clock_period_resource_fraction();
219 const auto clk = cprf * clock_period_value;
221 const auto fu = GetPointerS<functional_unit>(TechM->get_fu(module_name,
WORK_LIBRARY));
222 fu->set_clock_period(clock_period_value);
223 fu->set_clock_period_resource_fraction(cprf);
225 GetPointerS<module>(
HLS->
top->
get_circ())->get_NP_functionality()) ?
227 ->get_NP_functionality()
230 if(module_parameters.find(
' ') != std::string::npos)
232 module_parameters = module_parameters.substr(module_parameters.find(
' '));
235 if(!add_library_specialization->interfaced)
237 const auto function_name = BH->get_function_name();
238 TechM->add_operation(
WORK_LIBRARY, module_name, function_name);
239 const auto op = GetPointerS<operation>(fu->get_operation(function_name));
242 const auto call_delay =
248 const auto min_cycles =
HLS->
STG->
CGetStg()->CGetStateTransitionGraphInfo()->min_cycles;
249 const auto max_cycles =
HLS->
STG->
CGetStg()->CGetStateTransitionGraphInfo()->max_cycles;
250 const auto exec_time = [&]() {
253 return clk * (min_cycles - 1) + call_delay;
257 op->time_m->set_execution_time(exec_time, min_cycles);
260 if(FB->is_simple_pipeline())
262 op->time_m->set_stage_period(call_delay);
263 const ControlStep jj(1);
264 op->time_m->set_initiation_time(jj);
268 op->time_m->set_stage_period(0.0);
273 op->time_m->set_stage_period(0.0);
275 if(min_cycles <= 1 &&
276 (
HLSMgr->Rmem->get_allocated_space() +
HLSMgr->Rmem->get_allocated_parameters_memory()) == 0)
278 fu->logical_type = functional_unit::COMBINATIONAL;
283 op->time_m->set_execution_time(call_delay, 0);
285 op->time_m->set_synthesis_dependent(
true);
287 "Added " + module_name + (op->bounded ?
"" :
"(unbounded)") +
" to WORK_LIBRARY");
294 fu->area_m->set_area_value(2000);
#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;.
Collect information about resource area.
add_library(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization)
Constructor.
File containing functions and utilities to support the printing of debug messagges.
This step adds the current module to the technology library.
This file contains the structures needed to manage a graph that will represent the state transition g...
#define GET_CLASS(obj)
Macro returning the actual type of an object.
const structural_objectRef get_circ() const
Get a reference to circ field.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
const HLS_deviceRef HLS_D
reference to the information representing the target for the synthesis
exceptions managed by PandA
AllocationInformationRef allocation_information
Store the technology information.
Collect information about resource performance.
Class specification of the manager of the technology library data structures.
~add_library() override
Destructor.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
structural_managerRef top
Store the top description.
bool registered_inputs
true when the module has registered inputs
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Data structure used to store the register binding of variables.
Class specification of the data structures used to manage technology information. ...
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
This file contains the structures needed to manage a graph that will represent the state transition g...
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
Data structure definition for HLS constraints.
#define WRAPPED_PROXY_PREFIX
AddLibrarySpecialization(const bool interfaced)
Constructor.
std::string id_type
Original type id of the structural object.
const structural_type_descriptorRef & get_typeRef() const
Return the type descriptor of the structural_object.
static area_infoRef factory(const ParameterConstRef &Param)
Factory method.
Data structure used to store the functional-unit binding of the vertexes.
#define WORK_LIBRARY
working library.
hlsRef HLS
HLS data structure of the function to be analyzed.
std::string GetSignature() const override
Return the contribution to the signature of a step given by the specialization.
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.
StateTransitionGraphManagerRef STG
Store the refcounted state transition graph.
const HLS_constraintsRef HLS_C
store the HLS constraints
Class specification of the manager for each library.
int debug_level
The debug level.
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
std::string GetKindText() const override
Return the string representation of this.
Datastructure to describe functions allocation in high-level synthesis.
Data structure definition for high-level synthesis flow.
DesignFlowStep_Status InternalExec() override
Execute the step.
const StateTransitionGraphConstRef CGetStg() const
Returns pointer to state transition graph created.
const bool interfaced
True if we are adding module with interface.
static time_infoRef factory(const ParameterConstRef Param)
Datastructure to represent memory information in high-level synthesis.
#define PROXY_LIBRARY
proxy library
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.
const HLSFlowStepSpecializationConstRef hls_flow_step_specialization
The information about specialization.
HLS specialization of generic_device.
#define DEBUG_LEVEL_MINIMUM
minimum debugging print is performed.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...