PandA-2024.02
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Private Attributes
HLS_manager Class Reference

#include <hls_manager.hpp>

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

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

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

Detailed Description

Definition at line 152 of file hls_manager.hpp.

Member Typedef Documentation

◆ io_binding_type

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.

Constructor & Destructor Documentation

◆ HLS_manager()

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

Here is the call graph for this function:

◆ ~HLS_manager()

HLS_manager::~HLS_manager ( )
overridedefault

Destructor.

Referenced by HLS_manager().

Here is the caller graph for this function:

Member Function Documentation

◆ check_bitwidth()

void HLS_manager::check_bitwidth ( unsigned long long  prec)
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().

Here is the caller graph for this function:

◆ create_HLS()

hlsRef HLS_manager::create_HLS ( const HLS_managerRef  HLSMgr,
unsigned int  functionId 
)
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().

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

◆ get_backend_flow()

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.

Here is the call graph for this function:

◆ get_constant_string()

std::string HLS_manager::get_constant_string ( unsigned int  node,
unsigned long long  precision 
)

◆ get_HLS()

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.

◆ get_HLS_device()

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

Here is the caller graph for this function:

◆ get_required_values()

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

Here is the call graph for this function:

◆ GetAllImplementations()

CustomOrderedSet<hlsRef> HLS_manager::GetAllImplementations ( ) const

Returns all the implementations resulting from the synthesis.

◆ GetMemVersion()

unsigned int HLS_manager::GetMemVersion ( ) const

Return the version of the memory intermediate representation.

Returns
bb_version

Definition at line 314 of file hls_manager.cpp.

References memory_version.

◆ is_reading_writing_function()

bool HLS_manager::is_reading_writing_function ( unsigned  funID) const

is_reading_writing_function

Parameters
funIDis the function identifier
Returns
true in case the function performs at least a load or a store

Definition at line 296 of file hls_manager.cpp.

References tree_manager::get_tree_node_const(), THROW_ASSERT, and application_manager::TM.

Here is the call graph for this function:

◆ is_register_compatible()

bool HLS_manager::is_register_compatible ( unsigned int  var) const

helper function that return true in case the variable is register compatible

Parameters
varis the variable
Returns
true in case var is register compatible

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.

Here is the call graph for this function:

◆ IsSingleWriteMemory()

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.

Here is the call graph for this function:

◆ UpdateMemVersion()

unsigned int HLS_manager::UpdateMemVersion ( )

Update the version of the memory intermediate representation.

Returns
the new version

Definition at line 319 of file hls_manager.cpp.

References memory_version.

◆ xwrite()

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

Here is the call graph for this function:

Field Documentation

◆ aux_files

std::list<std::string> HLS_manager::aux_files

The auxiliary files.

Definition at line 192 of file hls_manager.hpp.

◆ back_flow

BackendFlowRef HLS_manager::back_flow
private

reference to the data-structure implementing the backend flow

Definition at line 167 of file hls_manager.hpp.

Referenced by get_backend_flow().

◆ base_address

unsigned long long int HLS_manager::base_address

base address for memory space addressing

Definition at line 174 of file hls_manager.hpp.

◆ design_interface_io

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.

◆ evaluations

CustomMap<std::string, double> HLS_manager::evaluations

Evaluations.

Definition at line 189 of file hls_manager.hpp.

◆ global_resource_constraints

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.

◆ hdl_files

std::list<std::string> HLS_manager::hdl_files

The HDL files.

Definition at line 195 of file hls_manager.hpp.

◆ HLS_D

HLS_deviceRef HLS_manager::HLS_D
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().

◆ HLS_execution_time

long HLS_manager::HLS_execution_time

HLS execution time.

Definition at line 177 of file hls_manager.hpp.

◆ hlsMap

std::map<unsigned int, hlsRef> HLS_manager::hlsMap
private

map between the function id and the corresponding HLS data-structure

Definition at line 164 of file hls_manager.hpp.

Referenced by get_HLS(), and xwrite().

◆ memory_version

unsigned int HLS_manager::memory_version
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().

◆ module_arch

ModuleArchitectureRef HLS_manager::module_arch

Definition at line 202 of file hls_manager.hpp.

◆ Rfuns

functionsRef HLS_manager::Rfuns

information about function allocation

Definition at line 180 of file hls_manager.hpp.

Referenced by HLS_manager().

◆ Rmem

memoryRef HLS_manager::Rmem

information about memory allocation

Definition at line 183 of file hls_manager.hpp.

Referenced by is_register_compatible(), and xwrite().

◆ RSim

SimulationInformationRef HLS_manager::RSim

information about the simulation

Definition at line 186 of file hls_manager.hpp.


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

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