PandA-2024.02
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
application_manager Class Reference

#include <application_manager.hpp>

Inheritance diagram for application_manager:
Inheritance graph
[legend]
Collaboration diagram for application_manager:
Collaboration graph
[legend]

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 TreeNodeConstSetGetGlobalVariables () 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...
 

Detailed Description

Definition at line 71 of file application_manager.hpp.

Constructor & Destructor Documentation

◆ application_manager()

application_manager::application_manager ( const FunctionExpanderConstRef  function_expander,
const bool  allow_recursive_functions,
const ParameterConstRef  _Param 
)

Constructor.

Parameters
function_expanderis the expander used to determine if a called function has to be examinedi
allow_recursive_functionsspecifies if recursive functions are allowed
_Paramis the reference to the class containing all the parameters

Definition at line 74 of file application_manager.cpp.

References input_files, and ~application_manager().

Here is the call graph for this function:

◆ ~application_manager()

application_manager::~application_manager ( )
virtualdefault

Destructor.

Referenced by application_manager().

Here is the caller graph for this function:

Member Function Documentation

◆ add_written_object()

void application_manager::add_written_object ( unsigned int  node_id)

Add the node_id to the set of object modified by a store.

Parameters
node_idis the object stored in memory

Definition at line 327 of file application_manager.cpp.

References written_objects.

◆ AddGlobalVariable()

void application_manager::AddGlobalVariable ( const tree_nodeConstRef var)

Adds a global variable.

Parameters
varis the global variable to be added

Definition at line 151 of file application_manager.cpp.

References global_variables.

◆ ApplyNewTransformation()

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().

Here is the caller graph for this function:

◆ CGetCallGraphManager()

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().

Here is the caller graph for this function:

◆ CGetFunctionBehavior()

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.

Parameters
indexis the identified of the function to be returned
Returns
the FunctionBehavior associated with the given function

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().

Here is the caller graph for this function:

◆ clean_written_objects()

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.

◆ clearParm2SSA()

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().

Here is the caller graph for this function:

◆ get_address_bitsize()

unsigned int application_manager::get_address_bitsize ( ) const
inline

◆ get_functions_with_body()

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.

◆ get_functions_without_body()

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.

◆ get_parameter()

const ParameterConstRef application_manager::get_parameter ( ) const

Returns the parameter data-structure.

Definition at line 103 of file application_manager.cpp.

References Param.

◆ get_produced_value() [1/2]

unsigned int application_manager::get_produced_value ( const tree_nodeRef tn) const
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().

Here is the call graph for this function:

◆ get_produced_value() [2/2]

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().

Here is the call graph for this function:

◆ get_tree_manager()

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().

Here is the caller graph for this function:

◆ get_written_objects()

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.

◆ getACopyParm2SSA()

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().

Here is the caller graph for this function:

◆ GetCallGraphManager()

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.

◆ GetFunctionBehavior()

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.

Parameters
indexis the identified of the function to be returned
Returns
the FunctionBehavior associated with the given function

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().

Here is the caller graph for this function:

◆ GetGlobalVariables()

const TreeNodeConstSet & application_manager::GetGlobalVariables ( ) const

Returns the set of original global variables.

Returns
a set containing the identified of the global variables

Definition at line 146 of file application_manager.cpp.

References global_variables.

◆ GetProducedValue() [1/2]

tree_nodeConstRef application_manager::GetProducedValue ( const tree_nodeConstRef tn) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetProducedValue() [2/2]

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().

Here is the call graph for this function:

◆ getSSAFromParm()

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

Parameters
functionIDId of the function to search the param in
parm_indexis 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().

Here is the caller graph for this function:

◆ hasToBeInterfaced()

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.

Parameters
funIdtree index of a function.
Returns
true if is a top or is an additional top.

Definition at line 123 of file application_manager.cpp.

References CGetCallGraphManager().

Here is the call graph for this function:

◆ RegisterTransformation()

void application_manager::RegisterTransformation ( const std::string &  step,
const tree_nodeConstRef  new_tn 
)

Register a transformation.

Parameters
stepis the name of the step in which the transformation is applied
new_tnis 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rget_address_bitsize()

unsigned int& application_manager::Rget_address_bitsize ( )
inline

return the address bitsize

Definition at line 257 of file application_manager.hpp.

References address_bitsize.

◆ set_address_bitsize()

void application_manager::set_address_bitsize ( unsigned int  value)
inline

set the value of the address bitsize

Parameters
valueis the new value

Definition at line 249 of file application_manager.hpp.

References symmetry::value.

◆ setSSAFromParm()

void application_manager::setSSAFromParm ( unsigned int  functionID,
unsigned int  parm_index,
unsigned  ssa_index 
)

setSSAFromParm defines the parm_decl versus ssa_name relation

Parameters
parm_indexis the index of the parm_decl
ssa_indexis the index of the ssa_name

Definition at line 398 of file application_manager.cpp.

References Parm2SSA_map, STR, and THROW_ASSERT.

Referenced by get_address_bitsize().

Here is the caller graph for this function:

Field Documentation

◆ address_bitsize

unsigned int application_manager::address_bitsize
protected

Definition at line 86 of file application_manager.hpp.

Referenced by get_address_bitsize(), and Rget_address_bitsize().

◆ call_graph_manager

const CallGraphManagerRef application_manager::call_graph_manager
protected

◆ cfg_transformations

size_t application_manager::cfg_transformations
protected

The number of cfg transformations applied to this function.

Definition at line 97 of file application_manager.hpp.

Referenced by ApplyNewTransformation(), and RegisterTransformation().

◆ debug_level

const int application_manager::debug_level
protected

debugging level of the class

Definition at line 100 of file application_manager.hpp.

◆ global_variables

TreeNodeConstSet application_manager::global_variables
protected

set of global variables

Definition at line 84 of file application_manager.hpp.

Referenced by AddGlobalVariable(), and GetGlobalVariables().

◆ input_files

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().

◆ Param

const ParameterConstRef application_manager::Param
protected

◆ Parm2SSA_map

CustomMap<unsigned, CustomMap<unsigned, unsigned> > application_manager::Parm2SSA_map
protected

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().

◆ TM

const tree_managerRef application_manager::TM
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().

◆ written_objects

CustomOrderedSet<unsigned int> application_manager::written_objects
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().


The documentation for this class was generated from the following files:

Generated on Mon Feb 12 2024 13:03:44 for PandA-2024.02 by doxygen 1.8.13