PandA-2024.02
|
#include <functions.hpp>
Public Member Functions | |
functions () | |
Constructor. More... | |
virtual | ~functions () |
Destructor. More... | |
void | map_shared_function (unsigned int funID_scope, const std::string &fun) |
allocate a shared function in a specified function. More... | |
const CustomOrderedSet< std::string > & | get_shared_functions (unsigned int funID_scope) const |
return the set of shared functions allocated in a given function. More... | |
bool | has_shared_functions (unsigned int funID_scope) const |
return true in case there are shared functions allocated in a given function. More... | |
bool | is_a_shared_function (unsigned int funID_scope, const std::string &fun) const |
return true if a given function is a shared function allocated in a given function scope More... | |
void | add_shared_function_proxy (unsigned int funID_scope, const std::string &fun) |
allocate a proxy for the function referred within a given function More... | |
const CustomOrderedSet< std::string > & | get_proxied_shared_functions (unsigned int funID_scope) const |
return the proxied internal functions associated with the function More... | |
bool | has_proxied_shared_functions (unsigned int funID_scope) const |
check if the function has proxy shared functions More... | |
bool | is_a_proxied_shared_function (unsigned int funID_scope, const std::string &fun) const |
return true if a given function is a shared function allocated in a given function scope More... | |
bool | is_a_proxied_function (const std::string &fun) const |
return true if the function is a proxied function More... | |
unsigned int | get_proxy_mapping (const std::string &fun) const |
in case the function is a proxy function, it returns where the function is actually instantiated More... | |
Static Public Member Functions | |
static std::string | GetFUName (const std::string &fname, const HLS_managerRef HLSMgr) |
Return FU used to implement given function. More... | |
static std::string | GetFUName (unsigned funID, const HLS_managerRef HLSMgr) |
Private Attributes | |
std::map< unsigned int, CustomOrderedSet< std::string > > | shared_function_proxy |
set of function proxies called by a function More... | |
std::map< std::string, unsigned int > | proxied_functions |
define where the proxied functions are mapped More... | |
std::map< unsigned int, CustomOrderedSet< std::string > > | shared_functions |
reverse map of proxied_functions More... | |
Definition at line 54 of file functions.hpp.
|
default |
Constructor.
|
virtualdefault |
Destructor.
void functions::add_shared_function_proxy | ( | unsigned int | funID_scope, |
const std::string & | fun | ||
) |
allocate a proxy for the function referred within a given function
funID_scope | is the function id |
fun | is the proxy function |
Definition at line 86 of file functions.cpp.
References shared_function_proxy.
const CustomOrderedSet< std::string > & functions::get_proxied_shared_functions | ( | unsigned int | funID_scope | ) | const |
return the proxied internal functions associated with the function
funID_scope | is the function id |
Definition at line 91 of file functions.cpp.
References has_proxied_shared_functions(), shared_function_proxy, STR, and THROW_ASSERT.
Referenced by is_a_proxied_shared_function().
unsigned int functions::get_proxy_mapping | ( | const std::string & | fun | ) | const |
in case the function is a proxy function, it returns where the function is actually instantiated
fun | is the proxy function |
Definition at line 112 of file functions.cpp.
References is_a_proxied_function(), proxied_functions, and THROW_ASSERT.
const CustomOrderedSet< std::string > & functions::get_shared_functions | ( | unsigned int | funID_scope | ) | const |
return the set of shared functions allocated in a given function.
funID_scope | is the function where the shared functions have been allocated |
Definition at line 70 of file functions.cpp.
References has_shared_functions(), shared_functions, and THROW_ASSERT.
Referenced by is_a_shared_function().
|
static |
Return FU used to implement given function.
fname | function name |
HLSMgr | HLS manager reference |
Definition at line 118 of file functions.cpp.
Referenced by fu_binding::add_to_SM(), HWCallPathCalculator::examine_edge(), fun_dominator_allocation::Exec(), allocation::extract_bambu_provided(), get_remapped_vertex(), BB_based_stg::InternalExec(), mem_dominator_allocation::InternalExec(), and allocation::InternalExec().
|
static |
bool functions::has_proxied_shared_functions | ( | unsigned int | funID_scope | ) | const |
check if the function has proxy shared functions
funID_scope | is the function id |
Definition at line 97 of file functions.cpp.
References shared_function_proxy.
Referenced by get_proxied_shared_functions(), and is_a_proxied_shared_function().
bool functions::has_shared_functions | ( | unsigned int | funID_scope | ) | const |
return true in case there are shared functions allocated in a given function.
funID_scope | is the function id |
Definition at line 76 of file functions.cpp.
References shared_functions.
Referenced by get_shared_functions(), and is_a_shared_function().
bool functions::is_a_proxied_function | ( | const std::string & | fun | ) | const |
return true if the function is a proxied function
fun | is the id of the function |
Definition at line 107 of file functions.cpp.
References proxied_functions.
Referenced by get_proxy_mapping(), and map_shared_function().
bool functions::is_a_proxied_shared_function | ( | unsigned int | funID_scope, |
const std::string & | fun | ||
) | const |
return true if a given function is a shared function allocated in a given function scope
funID_scope | is the function scope |
fun | is the proxy shared function |
Definition at line 102 of file functions.cpp.
References get_proxied_shared_functions(), and has_proxied_shared_functions().
bool functions::is_a_shared_function | ( | unsigned int | funID_scope, |
const std::string & | fun | ||
) | const |
return true if a given function is a shared function allocated in a given function scope
funID_scope | is the function scope |
fun | is the shared function |
Definition at line 81 of file functions.cpp.
References get_shared_functions(), and has_shared_functions().
void functions::map_shared_function | ( | unsigned int | funID_scope, |
const std::string & | fun | ||
) |
allocate a shared function in a specified function.
funID_scope | if the function id where the shared function is allocated |
fun | is the shared function |
Definition at line 62 of file functions.cpp.
References fun(), is_a_proxied_function(), proxied_functions, shared_functions, STR, and THROW_ASSERT.
|
private |
define where the proxied functions are mapped
Definition at line 60 of file functions.hpp.
Referenced by get_proxy_mapping(), is_a_proxied_function(), and map_shared_function().
|
private |
set of function proxies called by a function
Definition at line 57 of file functions.hpp.
Referenced by add_shared_function_proxy(), get_proxied_shared_functions(), and has_proxied_shared_functions().
|
private |
reverse map of proxied_functions
Definition at line 63 of file functions.hpp.
Referenced by get_shared_functions(), has_shared_functions(), and map_shared_function().