PandA-2024.02
Public Member Functions | Static Public Member Functions | Private Attributes
functions Class Reference

#include <functions.hpp>

Inheritance diagram for functions:
Inheritance graph
[legend]

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

Detailed Description

Definition at line 54 of file functions.hpp.

Constructor & Destructor Documentation

◆ functions()

functions::functions ( )
default

Constructor.

◆ ~functions()

functions::~functions ( )
virtualdefault

Destructor.

Member Function Documentation

◆ add_shared_function_proxy()

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

Parameters
funID_scopeis the function id
funis the proxy function

Definition at line 86 of file functions.cpp.

References shared_function_proxy.

◆ get_proxied_shared_functions()

const CustomOrderedSet< std::string > & functions::get_proxied_shared_functions ( unsigned int  funID_scope) const

return the proxied internal functions associated with the function

Parameters
funID_scopeis the function id
Returns
the set of functions proxied in funID_scope

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

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

◆ get_proxy_mapping()

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

Parameters
funis the proxy function
Returns
the function ID of the function having the instance of proxy function fun

Definition at line 112 of file functions.cpp.

References is_a_proxied_function(), proxied_functions, and THROW_ASSERT.

Here is the call graph for this function:

◆ get_shared_functions()

const CustomOrderedSet< std::string > & functions::get_shared_functions ( unsigned int  funID_scope) const

return the set of shared functions allocated in a given function.

Parameters
funID_scopeis the function where the shared functions have been allocated
Returns
the set of shared functions allocated in funID_scope

Definition at line 70 of file functions.cpp.

References has_shared_functions(), shared_functions, and THROW_ASSERT.

Referenced by is_a_shared_function().

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

◆ GetFUName() [1/2]

std::string functions::GetFUName ( const std::string &  fname,
const HLS_managerRef  HLSMgr 
)
static

Return FU used to implement given function.

Parameters
fnamefunction name
HLSMgrHLS manager reference
Returns
std::string Functional unit with fname in the supported operations' set

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

Here is the caller graph for this function:

◆ GetFUName() [2/2]

static std::string functions::GetFUName ( unsigned  funID,
const HLS_managerRef  HLSMgr 
)
static

◆ has_proxied_shared_functions()

bool functions::has_proxied_shared_functions ( unsigned int  funID_scope) const

check if the function has proxy shared functions

Parameters
funID_scopeis the function id
Returns
true when there are proxy shared functions, false otherwise

Definition at line 97 of file functions.cpp.

References shared_function_proxy.

Referenced by get_proxied_shared_functions(), and is_a_proxied_shared_function().

Here is the caller graph for this function:

◆ has_shared_functions()

bool functions::has_shared_functions ( unsigned int  funID_scope) const

return true in case there are shared functions allocated in a given function.

Parameters
funID_scopeis the function id
Returns
true when there are shared functions in funID_scope

Definition at line 76 of file functions.cpp.

References shared_functions.

Referenced by get_shared_functions(), and is_a_shared_function().

Here is the caller graph for this function:

◆ is_a_proxied_function()

bool functions::is_a_proxied_function ( const std::string &  fun) const

return true if the function is a proxied function

Parameters
funis the id of the function
Returns
true when fun is a proxied functions

Definition at line 107 of file functions.cpp.

References proxied_functions.

Referenced by get_proxy_mapping(), and map_shared_function().

Here is the caller graph for this function:

◆ is_a_proxied_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

Parameters
funID_scopeis the function scope
funis the proxy shared function
Returns
true when fun is a proxied shared in funID_scope, false otherwise

Definition at line 102 of file functions.cpp.

References get_proxied_shared_functions(), and has_proxied_shared_functions().

Here is the call graph for this function:

◆ is_a_shared_function()

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

Parameters
funID_scopeis the function scope
funis the shared function
Returns
true when fun is a shared function in funID_scope, false otherwise

Definition at line 81 of file functions.cpp.

References get_shared_functions(), and has_shared_functions().

Here is the call graph for this function:

◆ map_shared_function()

void functions::map_shared_function ( unsigned int  funID_scope,
const std::string &  fun 
)

allocate a shared function in a specified function.

Parameters
funID_scopeif the function id where the shared function is allocated
funis 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.

Here is the call graph for this function:

Field Documentation

◆ proxied_functions

std::map<std::string, unsigned int> functions::proxied_functions
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().

◆ shared_function_proxy

std::map<unsigned int, CustomOrderedSet<std::string> > functions::shared_function_proxy
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().

◆ shared_functions

std::map<unsigned int, CustomOrderedSet<std::string> > functions::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().


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

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