PandA-2024.02
|
#include <application_manager.hpp>
Public Member Functions | |
application_manager (const FunctionExpanderConstRef function_expander, const bool allow_recursive_functions, const ParameterConstRef _Param) | |
Constructor. More... | |
virtual | ~application_manager () |
Destructor. More... | |
const tree_managerRef | get_tree_manager () const |
Returns the tree manager associated with the application. More... | |
CallGraphManagerRef | GetCallGraphManager () |
Returns the call graph associated with the application. More... | |
const CallGraphManagerConstRef | CGetCallGraphManager () const |
Returns the call graph associated with the application. More... | |
bool | hasToBeInterfaced (unsigned int funId) const |
Check for interface generation. More... | |
FunctionBehaviorRef | GetFunctionBehavior (unsigned int index) |
Returns the data structure associated with the given identifier. More... | |
const FunctionBehaviorConstRef | CGetFunctionBehavior (unsigned int index) const |
Returns the data-structure associated with the given identifier. More... | |
CustomOrderedSet< unsigned int > | get_functions_with_body () const |
Returns the set of functions whose implementation is present in the parsed input specification (i.e. More... | |
CustomOrderedSet< unsigned int > | get_functions_without_body () const |
Returns the set of functions whose implementation is not present in the parsed input specification (i.e. More... | |
void | AddGlobalVariable (const tree_nodeConstRef &var) |
Adds a global variable. More... | |
const TreeNodeConstSet & | GetGlobalVariables () const |
Returns the set of original global variables. More... | |
unsigned int | get_produced_value (unsigned int fun_id, const vertex &v) const |
Returns the value produced by a vertex. More... | |
tree_nodeConstRef | GetProducedValue (unsigned int fun_id, const vertex &v) const |
Returns the value produced by a vertex. More... | |
const ParameterConstRef | get_parameter () const |
Returns the parameter data-structure. More... | |
void | add_written_object (unsigned int node_id) |
Add the node_id to the set of object modified by a store. More... | |
const CustomOrderedSet< unsigned int > & | get_written_objects () const |
Return the set of variables modified by a store. More... | |
void | clean_written_objects () |
clean_written_objects clean the written object data structure More... | |
void | set_address_bitsize (unsigned int value) |
set the value of the address bitsize More... | |
unsigned int & | Rget_address_bitsize () |
return the address bitsize More... | |
unsigned int | get_address_bitsize () const |
bool | ApplyNewTransformation () const |
Return true if a new transformation can be applied. More... | |
void | RegisterTransformation (const std::string &step, const tree_nodeConstRef new_tn) |
Register a transformation. More... | |
unsigned | getSSAFromParm (unsigned int functionID, unsigned parm_index) const |
getSSAFromParm returns the ssa_name index associated with the parm_decl index, 0 in case there is not an associated index More... | |
void | setSSAFromParm (unsigned int functionID, unsigned int parm_index, unsigned ssa_index) |
setSSAFromParm defines the parm_decl versus ssa_name relation More... | |
void | clearParm2SSA (unsigned int functionID) |
clearParm2SSA cleans the map putting into relation parm_decl and ssa_name More... | |
CustomMap< unsigned, unsigned > | getACopyParm2SSA (unsigned int functionID) |
return a copy of parameter to SSA map More... | |
Data Fields | |
std::vector< std::string > | input_files |
The original input file and the actual source code file to be elaborated. More... | |
Protected Member Functions | |
unsigned int | get_produced_value (const tree_nodeRef &tn) const |
Returns the values produced by a vertex (recursive version) More... | |
tree_nodeConstRef | GetProducedValue (const tree_nodeConstRef &tn) const |
Returns the values produced by a vertex (recursive version) More... | |
Protected Attributes | |
const tree_managerRef | TM |
class representing the application information at low level More... | |
const CallGraphManagerRef | call_graph_manager |
class representing the call graph of the application More... | |
const ParameterConstRef | Param |
class containing all the parameters More... | |
TreeNodeConstSet | global_variables |
set of global variables More... | |
unsigned int | address_bitsize |
CustomOrderedSet< unsigned int > | written_objects |
store memory objects which can be written More... | |
size_t | cfg_transformations |
The number of cfg transformations applied to this function. More... | |
const int | debug_level |
debugging level of the class More... | |
CustomMap< unsigned, CustomMap< unsigned, unsigned > > | Parm2SSA_map |
put into relation formal parameters and the associated ssa variables in a given function More... | |
Definition at line 71 of file application_manager.hpp.
application_manager::application_manager | ( | const FunctionExpanderConstRef | function_expander, |
const bool | allow_recursive_functions, | ||
const ParameterConstRef | _Param | ||
) |
Constructor.
function_expander | is the expander used to determine if a called function has to be examinedi |
allow_recursive_functions | specifies if recursive functions are allowed |
_Param | is the reference to the class containing all the parameters |
Definition at line 74 of file application_manager.cpp.
References input_files, and ~application_manager().
|
virtualdefault |
void application_manager::add_written_object | ( | unsigned int | node_id | ) |
Add the node_id to the set of object modified by a store.
node_id | is the object stored in memory |
Definition at line 327 of file application_manager.cpp.
References written_objects.
void application_manager::AddGlobalVariable | ( | const tree_nodeConstRef & | var | ) |
Adds a global variable.
var | is the global variable to be added |
Definition at line 151 of file application_manager.cpp.
References global_variables.
bool application_manager::ApplyNewTransformation | ( | ) | const |
Return true if a new transformation can be applied.
Definition at line 343 of file application_manager.cpp.
References cfg_transformations, and Param.
Referenced by get_address_bitsize().
const CallGraphManagerConstRef application_manager::CGetCallGraphManager | ( | ) | const |
Returns the call graph associated with the application.
Definition at line 118 of file application_manager.cpp.
References call_graph_manager.
Referenced by hasToBeInterfaced().
const FunctionBehaviorConstRef application_manager::CGetFunctionBehavior | ( | unsigned int | index | ) | const |
Returns the data-structure associated with the given identifier.
This method returns an error if the function does not exist.
index | is the identified of the function to be returned |
Definition at line 139 of file application_manager.cpp.
References call_graph_manager, STR, and THROW_ASSERT.
Referenced by pragma_manager::CheckAddOmpFor(), HLS_manager::get_required_values(), GetProducedValue(), and HLS_manager::xwrite().
void application_manager::clean_written_objects | ( | ) |
clean_written_objects clean the written object data structure
Definition at line 338 of file application_manager.cpp.
References written_objects.
void application_manager::clearParm2SSA | ( | unsigned int | functionID | ) |
clearParm2SSA cleans the map putting into relation parm_decl and ssa_name
Definition at line 420 of file application_manager.cpp.
References Parm2SSA_map.
Referenced by get_address_bitsize().
|
inline |
Definition at line 261 of file application_manager.hpp.
References address_bitsize, ApplyNewTransformation(), clearParm2SSA(), getACopyParm2SSA(), getSSAFromParm(), RegisterTransformation(), and setSSAFromParm().
CustomOrderedSet< unsigned int > application_manager::get_functions_with_body | ( | ) | const |
Returns the set of functions whose implementation is present in the parsed input specification (i.e.
which has a non empty graph)
Definition at line 156 of file application_manager.cpp.
References call_graph_manager.
CustomOrderedSet< unsigned int > application_manager::get_functions_without_body | ( | ) | const |
Returns the set of functions whose implementation is not present in the parsed input specification (i.e.
the ones with an empty Control Flow Graph)
Definition at line 161 of file application_manager.cpp.
References call_graph_manager.
const ParameterConstRef application_manager::get_parameter | ( | ) | const |
Returns the parameter data-structure.
Definition at line 103 of file application_manager.cpp.
References Param.
|
protected |
Returns the values produced by a vertex (recursive version)
FIXME: to be remove after substitution with GetProducedValue
Definition at line 186 of file application_manager.cpp.
References GET_INDEX_CONST_NODE, and GetProducedValue().
unsigned int application_manager::get_produced_value | ( | unsigned int | fun_id, |
const vertex & | v | ||
) | const |
Returns the value produced by a vertex.
FIXME: to be remove after substitution with GetProducedValue
Definition at line 173 of file application_manager.cpp.
References GET_INDEX_CONST_NODE, and GetProducedValue().
const tree_managerRef application_manager::get_tree_manager | ( | ) | const |
Returns the tree manager associated with the application.
Definition at line 108 of file application_manager.cpp.
References TM.
Referenced by RegisterTransformation().
const CustomOrderedSet< unsigned int > & application_manager::get_written_objects | ( | ) | const |
Return the set of variables modified by a store.
Definition at line 333 of file application_manager.cpp.
References written_objects.
CustomMap< unsigned, unsigned > application_manager::getACopyParm2SSA | ( | unsigned int | functionID | ) |
return a copy of parameter to SSA map
Definition at line 425 of file application_manager.cpp.
References Parm2SSA_map.
Referenced by get_address_bitsize().
CallGraphManagerRef application_manager::GetCallGraphManager | ( | ) |
Returns the call graph associated with the application.
Definition at line 113 of file application_manager.cpp.
References call_graph_manager.
FunctionBehaviorRef application_manager::GetFunctionBehavior | ( | unsigned int | index | ) |
Returns the data structure associated with the given identifier.
This method returns an error if the function does not exist.
index | is the identified of the function to be returned |
Definition at line 132 of file application_manager.cpp.
References call_graph_manager, STR, and THROW_ASSERT.
Referenced by pragma_manager::CheckAddOmpFor(), and pragma_manager::CheckAddOmpSimd().
const TreeNodeConstSet & application_manager::GetGlobalVariables | ( | ) | const |
Returns the set of original global variables.
Definition at line 146 of file application_manager.cpp.
References global_variables.
|
protected |
Returns the values produced by a vertex (recursive version)
only the first output and so only single output gimple_asm are supported
Definition at line 192 of file application_manager.cpp.
References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_CST_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, GET_CONST_NODE, tree_node::get_kind(), THROW_ERROR, and THROW_UNREACHABLE.
Referenced by get_produced_value(), and GetProducedValue().
tree_nodeConstRef application_manager::GetProducedValue | ( | unsigned int | fun_id, |
const vertex & | v | ||
) | const |
Returns the value produced by a vertex.
Definition at line 179 of file application_manager.cpp.
References FunctionBehavior::CFG, CGetFunctionBehavior(), FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpNodeInfo(), and GetProducedValue().
unsigned application_manager::getSSAFromParm | ( | unsigned int | functionID, |
unsigned | parm_index | ||
) | const |
getSSAFromParm returns the ssa_name index associated with the parm_decl index, 0 in case there is not an associated index
functionID | Id of the function to search the param in |
parm_index | is the parm_decl index for which we look for the associated ssa_name index |
Definition at line 383 of file application_manager.cpp.
References Parm2SSA_map, THROW_ASSERT, and U.
Referenced by get_address_bitsize().
bool application_manager::hasToBeInterfaced | ( | unsigned int | funId | ) | const |
Check for interface generation.
The interface has to be created for the top function and any additional top that is called through the bus.
funId | tree index of a function. |
Definition at line 123 of file application_manager.cpp.
References CGetCallGraphManager().
void application_manager::RegisterTransformation | ( | const std::string & | step, |
const tree_nodeConstRef | new_tn | ||
) |
Register a transformation.
step | is the name of the step in which the transformation is applied |
new_tn | is the tree node to be created |
Definition at line 352 of file application_manager.cpp.
References cfg_transformations, GET_CONST_NODE, get_tree_manager(), INDENT_OUT_MEX, max, Param, tree_helper::print_function_name(), STR, and THROW_ASSERT.
Referenced by get_address_bitsize().
|
inline |
return the address bitsize
Definition at line 257 of file application_manager.hpp.
References address_bitsize.
|
inline |
set the value of the address bitsize
value | is the new value |
Definition at line 249 of file application_manager.hpp.
References symmetry::value.
void application_manager::setSSAFromParm | ( | unsigned int | functionID, |
unsigned int | parm_index, | ||
unsigned | ssa_index | ||
) |
setSSAFromParm defines the parm_decl versus ssa_name relation
Definition at line 398 of file application_manager.cpp.
References Parm2SSA_map, STR, and THROW_ASSERT.
Referenced by get_address_bitsize().
|
protected |
Definition at line 86 of file application_manager.hpp.
Referenced by get_address_bitsize(), and Rget_address_bitsize().
|
protected |
class representing the call graph of the application
Definition at line 78 of file application_manager.hpp.
Referenced by CGetCallGraphManager(), CGetFunctionBehavior(), get_functions_with_body(), get_functions_without_body(), GetCallGraphManager(), GetFunctionBehavior(), and HLS_manager::xwrite().
|
protected |
The number of cfg transformations applied to this function.
Definition at line 97 of file application_manager.hpp.
Referenced by ApplyNewTransformation(), and RegisterTransformation().
|
protected |
debugging level of the class
Definition at line 100 of file application_manager.hpp.
|
protected |
set of global variables
Definition at line 84 of file application_manager.hpp.
Referenced by AddGlobalVariable(), and GetGlobalVariables().
std::vector<std::string> application_manager::input_files |
The original input file and the actual source code file to be elaborated.
Definition at line 123 of file application_manager.hpp.
Referenced by application_manager().
|
protected |
class containing all the parameters
Definition at line 81 of file application_manager.hpp.
Referenced by ApplyNewTransformation(), HLS_manager::get_backend_flow(), get_parameter(), HLS_manager::HLS_manager(), HLS_manager::IsSingleWriteMemory(), and RegisterTransformation().
put into relation formal parameters and the associated ssa variables in a given function
Definition at line 103 of file application_manager.hpp.
Referenced by clearParm2SSA(), getACopyParm2SSA(), getSSAFromParm(), and setSSAFromParm().
|
protected |
class representing the application information at low level
Definition at line 75 of file application_manager.hpp.
Referenced by HLS_manager::get_constant_string(), get_tree_manager(), HLS_manager::is_reading_writing_function(), and HLS_manager::is_register_compatible().
|
protected |
store memory objects which can be written
Definition at line 89 of file application_manager.hpp.
Referenced by add_written_object(), clean_written_objects(), and get_written_objects().