PandA-2024.02
|
#include <hls_manager.hpp>
Public Types | |
using | io_binding_type = std::tuple< unsigned int, unsigned int > |
tuple set used to represent the required values or the constant default value associated with the inputs of a node More... | |
Public Member Functions | |
HLS_manager (const ParameterConstRef Param, const HLS_deviceRef HLS_D) | |
Constructor. More... | |
~HLS_manager () override | |
Destructor. More... | |
hlsRef | get_HLS (unsigned int funId) const |
Returns the HLS data-structure associated with a specific function. More... | |
HLS_deviceRef | get_HLS_device () const |
Returns the data-structure associated with the HLS target. More... | |
const BackendFlowRef | get_backend_flow () |
Returns the backend flow. More... | |
std::string | get_constant_string (unsigned int node, unsigned long long precision) |
Return the specified constant in string format. More... | |
void | xwrite (const std::string &filename) |
Writes the current HLS project into an XML file. More... | |
std::vector< io_binding_type > | get_required_values (unsigned int fun_id, const vertex &v) const |
Returns the values required by a vertex. More... | |
bool | is_register_compatible (unsigned int var) const |
helper function that return true in case the variable is register compatible More... | |
bool | is_reading_writing_function (unsigned funID) const |
is_reading_writing_function More... | |
CustomOrderedSet< hlsRef > | GetAllImplementations () const |
Returns all the implementations resulting from the synthesis. More... | |
bool | IsSingleWriteMemory () const |
Return if single write memory is exploited. More... | |
unsigned int | GetMemVersion () const |
Return the version of the memory intermediate representation. More... | |
unsigned int | UpdateMemVersion () |
Update the version of the memory intermediate representation. More... | |
Public Member Functions inherited from application_manager | |
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... | |
Static Public Member Functions | |
static hlsRef | create_HLS (const HLS_managerRef HLSMgr, unsigned int functionId) |
Creates the HLS flow starting from the given specification. More... | |
static void | check_bitwidth (unsigned long long prec) |
check if the maximum bitwidth used for registers, busses, muxes, etc. is compatible with prec More... | |
Data Fields | |
unsigned long long int | base_address |
base address for memory space addressing More... | |
long | HLS_execution_time |
HLS execution time. More... | |
functionsRef | Rfuns |
information about function allocation More... | |
memoryRef | Rmem |
information about memory allocation More... | |
SimulationInformationRef | RSim |
information about the simulation More... | |
CustomMap< std::string, double > | evaluations |
Evaluations. More... | |
std::list< std::string > | aux_files |
The auxiliary files. More... | |
std::list< std::string > | hdl_files |
The HDL files. More... | |
ModuleArchitectureRef | module_arch |
std::map< std::string, std::map< unsigned, std::map< std::string, std::list< unsigned > > > > | design_interface_io |
store the design interface read/write references of parameters: function_name->bb_index->parameter_name->list_of_loads More... | |
std::map< std::pair< std::string, std::string >, std::pair< unsigned, unsigned > > | global_resource_constraints |
global resource constraints More... | |
Data Fields inherited from application_manager | |
std::vector< std::string > | input_files |
The original input file and the actual source code file to be elaborated. More... | |
Private Attributes | |
HLS_deviceRef | HLS_D |
information about the target device/technology for the synthesis More... | |
std::map< unsigned int, hlsRef > | hlsMap |
map between the function id and the corresponding HLS data-structure More... | |
BackendFlowRef | back_flow |
reference to the data-structure implementing the backend flow More... | |
unsigned int | memory_version |
The version of memory representation on which this step was applied. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from application_manager | |
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 inherited from application_manager | |
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 152 of file hls_manager.hpp.
using HLS_manager::io_binding_type = std::tuple<unsigned int, unsigned int> |
tuple set used to represent the required values or the constant default value associated with the inputs of a node
Definition at line 157 of file hls_manager.hpp.
HLS_manager::HLS_manager | ( | const ParameterConstRef | Param, |
const HLS_deviceRef | HLS_D | ||
) |
Constructor.
Definition at line 90 of file hls_manager.cpp.
References application_manager::Param, Rfuns, and ~HLS_manager().
|
overridedefault |
|
static |
check if the maximum bitwidth used for registers, busses, muxes, etc. is compatible with prec
Definition at line 325 of file hls_manager.cpp.
References MAX_BITWIDTH_SIZE, STR, and THROW_ERROR.
Referenced by mux_connection_binding::add_conversion(), mux_connection_binding::create_connections(), memory_allocation::finalize_memory_allocation(), and conn_binding::mux_allocation().
|
static |
Creates the HLS flow starting from the given specification.
creates the new HLS data structure associated with the function
Definition at line 133 of file hls_manager.cpp.
References FunctionBehavior::CFG, INFINITE_UINT, tree_helper::name_function(), and THROW_ASSERT.
Referenced by InitializeHLS::InternalExec().
const BackendFlowRef HLS_manager::get_backend_flow | ( | ) |
Returns the backend flow.
Definition at line 234 of file hls_manager.cpp.
References back_flow, BackendFlow::CreateFlow(), HLS_D, and application_manager::Param.
std::string HLS_manager::get_constant_string | ( | unsigned int | node, |
unsigned long long | precision | ||
) |
Return the specified constant in string format.
Definition at line 161 of file hls_manager.cpp.
References tree_manager::CGetTreeReindex(), tree_helper::CGetType(), convert_fp_to_string(), convert_to_binary(), GET_CONST_NODE, GET_INDEX_NODE, tree_helper::GetConstValue(), tree_helper::IsComplexType(), tree_helper::IsRealType(), tree_helper::IsVectorType(), tree_helper::Size(), THROW_ASSERT, and application_manager::TM.
hlsRef HLS_manager::get_HLS | ( | unsigned int | funId | ) | const |
Returns the HLS data-structure associated with a specific function.
Definition at line 115 of file hls_manager.cpp.
References hlsMap.
HLS_deviceRef HLS_manager::get_HLS_device | ( | ) | const |
Returns the data-structure associated with the HLS target.
Definition at line 128 of file hls_manager.cpp.
References HLS_D.
Referenced by IsSingleWriteMemory().
std::vector< HLS_manager::io_binding_type > HLS_manager::get_required_values | ( | unsigned int | fun_id, |
const vertex & | v | ||
) | const |
Returns the values required by a vertex.
Definition at line 275 of file hls_manager.cpp.
References FunctionBehavior::CFG, application_manager::CGetFunctionBehavior(), FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpNodeInfo(), and tree_helper::get_required_values().
CustomOrderedSet<hlsRef> HLS_manager::GetAllImplementations | ( | ) | const |
Returns all the implementations resulting from the synthesis.
unsigned int HLS_manager::GetMemVersion | ( | ) | const |
Return the version of the memory intermediate representation.
Definition at line 314 of file hls_manager.cpp.
References memory_version.
bool HLS_manager::is_reading_writing_function | ( | unsigned | funID | ) | const |
is_reading_writing_function
funID | is the function identifier |
Definition at line 296 of file hls_manager.cpp.
References tree_manager::get_tree_node_const(), THROW_ASSERT, and application_manager::TM.
bool HLS_manager::is_register_compatible | ( | unsigned int | var | ) | const |
helper function that return true in case the variable is register compatible
var | is the variable |
Definition at line 287 of file hls_manager.cpp.
References memory::has_base_address(), tree_helper::is_parameter(), tree_helper::is_ssa_name(), tree_helper::is_virtual(), Rmem, and application_manager::TM.
bool HLS_manager::IsSingleWriteMemory | ( | ) | const |
Return if single write memory is exploited.
Definition at line 304 of file hls_manager.cpp.
References get_HLS_device(), generic_device::get_parameter(), generic_device::has_parameter(), and application_manager::Param.
unsigned int HLS_manager::UpdateMemVersion | ( | ) |
Update the version of the memory intermediate representation.
Definition at line 319 of file hls_manager.cpp.
References memory_version.
void HLS_manager::xwrite | ( | const std::string & | filename | ) |
Writes the current HLS project into an XML file.
Definition at line 243 of file hls_manager.cpp.
References application_manager::call_graph_manager, application_manager::CGetFunctionBehavior(), xml_document::create_root_node(), FunctionBehavior::FDFG, hlsMap, Rmem, xml_document::write_to_file_formatted(), hls::xwrite(), and memory::xwrite().
std::list<std::string> HLS_manager::aux_files |
The auxiliary files.
Definition at line 192 of file hls_manager.hpp.
|
private |
reference to the data-structure implementing the backend flow
Definition at line 167 of file hls_manager.hpp.
Referenced by get_backend_flow().
unsigned long long int HLS_manager::base_address |
base address for memory space addressing
Definition at line 174 of file hls_manager.hpp.
std::map<std::string, std::map<unsigned, std::map<std::string, std::list<unsigned> > > > HLS_manager::design_interface_io |
store the design interface read/write references of parameters: function_name->bb_index->parameter_name->list_of_loads
Definition at line 206 of file hls_manager.hpp.
CustomMap<std::string, double> HLS_manager::evaluations |
Evaluations.
Definition at line 189 of file hls_manager.hpp.
std::map<std::pair<std::string, std::string>, std::pair<unsigned, unsigned> > HLS_manager::global_resource_constraints |
global resource constraints
Definition at line 209 of file hls_manager.hpp.
std::list<std::string> HLS_manager::hdl_files |
The HDL files.
Definition at line 195 of file hls_manager.hpp.
|
private |
information about the target device/technology for the synthesis
Definition at line 161 of file hls_manager.hpp.
Referenced by get_backend_flow(), and get_HLS_device().
long HLS_manager::HLS_execution_time |
HLS execution time.
Definition at line 177 of file hls_manager.hpp.
map between the function id and the corresponding HLS data-structure
Definition at line 164 of file hls_manager.hpp.
|
private |
The version of memory representation on which this step was applied.
Definition at line 170 of file hls_manager.hpp.
Referenced by GetMemVersion(), and UpdateMemVersion().
ModuleArchitectureRef HLS_manager::module_arch |
Definition at line 202 of file hls_manager.hpp.
functionsRef HLS_manager::Rfuns |
information about function allocation
Definition at line 180 of file hls_manager.hpp.
Referenced by HLS_manager().
memoryRef HLS_manager::Rmem |
information about memory allocation
Definition at line 183 of file hls_manager.hpp.
Referenced by is_register_compatible(), and xwrite().
SimulationInformationRef HLS_manager::RSim |
information about the simulation
Definition at line 186 of file hls_manager.hpp.