64 const DesignFlowManagerConstRef _design_flow_manager)
76 switch(relationship_type)
86 relationships.insert(std::make_pair(CREATE_ADDRESS_TRANSLATION,
WHOLE_APPLICATION));
89 #if HAVE_FROM_PRAGMA_BUILT 103 return relationships;
109 const auto HLSMgr = GetPointer<HLS_manager>(
AppM);
110 const auto TM =
AppM->get_tree_manager();
111 const auto CGM =
AppM->GetCallGraphManager();
117 auto function_symbols =
parameters->getOption<std::vector<std::string>>(OPT_top_functions_names);
118 for(
const auto& [symbol, arch] : *HLSMgr->module_arch)
120 THROW_ASSERT(arch,
"Expected function architecture for function " + symbol);
121 const auto dataflow_attr = arch->attrs.find(FunctionArchitecture::func_dataflow);
122 if(dataflow_attr != arch->attrs.end() && dataflow_attr->second ==
"module")
124 function_symbols.push_back(symbol);
127 for(
const auto& symbol : function_symbols)
129 const auto fnode = TM->GetFunction(symbol);
138 THROW_ERROR(
"Function " + symbol +
" not found in IR");
141 CGM->SetRootFunctions(functions);
144 for(
const auto f_id : functions)
148 "---Adding function " +
STR(f_id) +
" " + fu_name +
" to call graph");
149 if(fu_name ==
"__start_pragma__" || fu_name ==
"__close_pragma__" || fu_name.find(
"__pragma__") == 0)
155 const auto fun = TM->CGetTreeNode(f_id);
156 const auto fd = GetPointerS<const function_decl>(
fun);
157 if(fd->scpe &&
GET_NODE(fd->scpe)->get_kind() == function_decl_K)
163 if(!CGM->IsVertex(f_id))
165 const auto has_body = TM->get_implementation_node(f_id) != 0;
168 CGM->AddFunction(f_id, FB);
171 "---Added function " +
STR(f_id) +
" " + fu_name +
" to call graph");
176 "---Function " +
STR(f_id) +
" " + fu_name +
" was already in call graph");
182 CGM->CGetCallGraph()->WriteDot(
"call_graph.dot");
#define GET_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
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;.
static std::string name_function(const tree_managerConstRef &tm, const unsigned int index)
Return the name of the function.
CustomUnorderedSet< unsigned int > already_visited
Already visited tree node (used to avoid infinite recursion)
Build call_graph data structure starting from the tree_manager.
File containing functions and utilities to support the printing of debug messagges.
#define DEBUG_LEVEL_PEDANTIC
very verbose debugging print is performed.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
Definition of the class representing a generic C application.
refcount< BehavioralHelper > BehavioralHelperRef
RefCount type definition of the tree_to_graph class structure.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
Data structure describing a basic block at tree level.
call_graph_computation(const ParameterConstRef _parameters, const application_managerRef AppM, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Target must be reexecuted.
Classes specification of the tree_node data structures.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
#define DEBUG_LEVEL_NONE
no debugging print is performed.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
This file collects some utility functions.
refcount< FunctionBehavior > FunctionBehaviorRef
DesignFlowStep_Status Exec() override
Computes the call graph data structure.
const application_managerRef AppM
The application manager.
Class specification of the tree_reindex support class.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
#define THROW_ERROR_CODE(code, str_expr)
helper function used to throw an error with a code error
Classes specification of the tree_node data structures not present in the gcc.
this class is used to manage the command-line or XML options.
nested functions are not currently supported
int debug_level
The debug level.
int fun(float *A, float *invA, float *b, float *x, float *I)
#define GET_INDEX_CONST_NODE(t)
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Return the set of analyses in relationship with this design step.
static void expandCallGraphFromFunction(CustomUnorderedSet< unsigned int > &AV, const application_managerRef AM, unsigned int f_id, int DL)
Class specification of the manager of the tree structures extracted from the raw file.
A brief description of the C++ Header File.
~call_graph_computation() override
Destructor.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...