89 scope = std::stack<std::string>();
91 const auto top_fu_name =
92 Cget_node_info<UnfoldedFunctionInfo>(v, ufcg)->behavior->CGetBehavioralHelper()->get_function_name();
99 const auto f_id = Cget_node_info<UnfoldedFunctionInfo>(v, ufcg)->f_id;
106 const auto BH = Cget_node_info<UnfoldedFunctionInfo>(v, ufcg)->behavior->CGetBehavioralHelper();
107 const auto f_id = Cget_node_info<UnfoldedFunctionInfo>(v, ufcg)->f_id;
108 if(!BH->has_implementation() || !BH->function_has_to_be_printed(f_id))
113 THROW_ASSERT(
HLSMgr->RDiscr->unfolded_v_to_scope.count(v),
"can't find scope for function " +
STR(f_id));
114 scope.push(
HLSMgr->RDiscr->unfolded_v_to_scope.at(v));
122 if(
HLSMgr->Rfuns->has_shared_functions(f_id))
124 for(
const auto& shared_fu_name :
HLSMgr->Rfuns->get_shared_functions(f_id))
141 const auto called_f_id = Cget_node_info<UnfoldedFunctionInfo>(tgt, ufcg)->f_id;
142 const auto BH = Cget_node_info<UnfoldedFunctionInfo>(tgt, ufcg)->behavior->CGetBehavioralHelper();
143 if(!BH->has_implementation() || !BH->function_has_to_be_printed(called_f_id))
148 const auto called_fu_name = [&]() {
152 std::string called_scope;
153 if(
HLSMgr->Rfuns->is_a_proxied_function(called_fu_name))
160 if(Cget_raw_edge_info<UnfoldedCallInfo>(e, ufcg)->is_direct)
162 const auto call_id = Cget_raw_edge_info<UnfoldedCallInfo>(e, ufcg)->call_id;
163 THROW_ASSERT(call_id != 0
U,
"No artificial calls allowed in UnfoldedCallGraph");
164 const auto src = boost::source(e, ufcg);
165 const auto& caller_f_id = Cget_node_info<UnfoldedFunctionInfo>(src, ufcg)->f_id;
166 const auto& caller_behavior = Cget_node_info<UnfoldedFunctionInfo>(src, ufcg)->behavior;
168 const auto call_op_v = op_graph->CGetOpGraphInfo()->tree_node_to_operation.at(call_id);
169 const auto& fu_bind =
HLSMgr->get_HLS(caller_f_id)->Rfu;
170 const auto fu_type_id = fu_bind->get_assign(call_op_v);
171 const auto fu_instance_id = fu_bind->get_index(call_op_v);
172 std::string extra_path;
173 if(
HLSMgr->hasToBeInterfaced(called_f_id))
178 if(fu_bind->get_operations(fu_type_id, fu_instance_id).size() == 1
U)
195 HLSMgr->RDiscr->f_id_to_scope[called_f_id].insert(called_scope);
196 HLSMgr->RDiscr->unfolded_v_to_scope[tgt] = called_scope;
200 const DesignFlowManagerConstRef _design_flow_manager)
212 switch(relationship_type)
245 std::vector<boost::default_color_type> sig_sel_color(boost::num_vertices(
HLSMgr->RDiscr->DiscrepancyCallGraph),
247 boost::depth_first_visit(
248 HLSMgr->RDiscr->DiscrepancyCallGraph,
HLSMgr->RDiscr->unfolded_root_v, sig_sel_v,
249 boost::make_iterator_property_map(sig_sel_color.begin(),
250 boost::get(boost::vertex_index_t(),
HLSMgr->RDiscr->DiscrepancyCallGraph),
251 boost::white_color));
const HLS_managerRef HLSMgr
information about all the HLS synthesis
std::stack< std::string > scope
a stack of scopes used during the traversal of the UnfoldedCallGraph
Data structure representing the entire HLS information.
HWCallPathCalculator(const HLS_managerRef _HLSMgr)
File containing functions and utilities to support the printing of debug messagges.
const int output_level
The output level.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
#define INDENT_OUT_MEX(outLevel, curOutLevel, mex)
#define GET_NAME(data, vertex_index)
Helper macro returning the name associated with a node.
std::string top_fun_scope
The scope of the top function. It depends on different parameters and.
const HLS_managerRef HLSMgr
a refcount to the HLS_manager
#define STR(s)
Macro which performs a lexical_cast to a string.
~HWPathComputation() override
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
bool starts_with(const std::string &str, const std::string &pattern)
HWPathComputation(const ParameterConstRef Param, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager)
Target must be reexecuted.
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.
Datastructure to describe functions allocation in high-level synthesis.
void finish_vertex(const UnfoldedVertexDescriptor &v, const UnfoldedCallGraph &)
static std::string GetFUName(const std::string &fname, const HLS_managerRef HLSMgr)
Return FU used to implement given function.
std::map< std::string, std::string > shared_fun_scope
The key is the name of a shared function, the mapped value is the HW.
DesignFlowStep_Status
The status of a step.
This file collects some utility functions and macros.
boost::graph_traits< UnfoldedCallGraph >::vertex_descriptor UnfoldedVertexDescriptor
#define WRAPPED_PROXY_PREFIX
#define HIERARCHY_SEPARATOR
This class describes all classes used to represent a structural object.
void examine_edge(const EdgeDescriptor &e, const UnfoldedCallGraph &cg)
Data structure used to store the functional-unit binding of the vertexes.
Data structures used in operations graph.
void discover_vertex(const UnfoldedVertexDescriptor &v, const UnfoldedCallGraph &ufcg)
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
#define OUTPUT_LEVEL_VERBOSE
verbose debugging print is performed.
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
void start_vertex(const UnfoldedVertexDescriptor &v, const UnfoldedCallGraph &ufcg)
Data structure definition for high-level synthesis flow.
DesignFlowStep_Status Exec() override
Execute the step.
A brief description of the C++ Header File.
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...