PandA-2024.02
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
fu_binding Class Reference

Class managing the functional-unit binding. More...

#include <fu_binding.hpp>

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

Public Member Functions

 fu_binding (const HLS_managerConstRef _HLSMgr, const unsigned int function_id, const ParameterConstRef parameters)
 Constructor. More...
 
 fu_binding (const fu_binding &original)
 
fu_bindingoperator= (const fu_binding &)=delete
 
virtual ~fu_binding ()
 Destructor. More...
 
void bind (const vertex &v, unsigned int unit, unsigned int index=std::numeric_limits< unsigned int >::max())
 Binds an operation vertex to a functional unit. More...
 
unsigned int get_assign (const vertex &v) const
 Returns the functional unit assigned to the vertex. More...
 
unsigned int get_assign (const unsigned int statement_index) const
 Returns the functional unit assigned to the operation. More...
 
unsigned int get_index (const vertex &v) const
 Returns the index of functional unit assigned to the vertex. More...
 
std::string get_fu_name (vertex const &v) const
 Returns the name of the functional unit. More...
 
unsigned int get_number (unsigned int unit) const
 Returns number of functional unit allocated. More...
 
const funit_objoperator[] (const vertex &v)
 Redefinition of the [] operator. More...
 
generic_objRef get (const vertex v) const
 Returns reference to funit object associated with this vertex. More...
 
generic_objRef get (unsigned int name, unsigned int index)
 
std::list< unsigned int > get_allocation_list () const
 Returns the set of allocated unit. More...
 
bool is_assigned (const vertex &v) const
 return true in case the vertex has been previously assigned More...
 
bool is_assigned (const unsigned int statement_index) const
 return true in case the operation has been previously assigned More...
 
virtual void add_to_SM (const HLS_managerRef HLSMgr, const hlsRef HLS, structural_objectRef clock_port, structural_objectRef reset_port)
 Instance the functional unit inside the structural representation of the datapath. More...
 
virtual void manage_extern_global_port (const HLS_managerRef HLSMgr, const hlsRef HLS, const structural_managerRef SM, structural_objectRef port_in, unsigned int dir, structural_objectRef circuit, unsigned int num)
 
virtual void manage_memory_ports_parallel_chained (const HLS_managerRef HLSMgr, const structural_managerRef SM, const std::list< structural_objectRef > &memory_modules, const structural_objectRef circuit, const hlsRef HLS, unsigned int &unique_id)
 
OpVertexSet get_operations (unsigned int unit, unsigned int index) const
 Return the operations that are executed by the given functional unit. More...
 
void specialise_fu (const HLS_managerRef HLSMgr, const hlsRef HLS, structural_objectRef fu_obj, unsigned int fu, const OpVertexSet &operations, unsigned int ar)
 Specialize the functional unit based on variables associated with the corresponding operations. More...
 
void specialize_memory_unit (const HLS_managerRef HLSMgr, const hlsRef HLS, structural_objectRef fu_obj, unsigned int ar, const std::string &base_address, unsigned long long rangesize, bool is_memory_splitted, bool is_sparse_memory, bool is_sds)
 Specialize a memory unit. More...
 
virtual bool manage_module_ports (const HLS_managerRef HLSMgr, const hlsRef HLS, const structural_managerRef SM, const structural_objectRef curr_gate, unsigned int num)
 
void set_ports_are_swapped (vertex v, bool condition)
 specify if vertex v have or not its ports swapped More...
 
bool get_ports_are_swapped (vertex v) const
 Check if vertex v has its ports swapped or not. More...
 
bool has_resource_sharing () const
 return true in case at least one resource is shared More...
 

Static Public Member Functions

static fu_bindingRef create_fu_binding (const HLS_managerConstRef _HLSMgr, const unsigned int _function_id, const ParameterConstRef _parameters)
 create_fu_binding: factory method for fu_binding More...
 
static void manage_memory_ports_chained (const structural_managerRef SM, const std::list< structural_objectRef > &memory_modules, const structural_objectRef circuit)
 Manage the connections between memory ports. More...
 
static void join_merge_split (const structural_managerRef SM, const hlsRef HLS, std::map< structural_objectRef, std::list< structural_objectRef >, jms_sorter > &primary_outs, const structural_objectRef circuit, unsigned int &unique_id)
 
static void fill_array_ref_memory (std::ostream &init_file_a, std::ostream &init_file_b, unsigned int ar, unsigned long long &vec_size, unsigned long long &elts_size, const memoryRef mem, tree_managerConstRef TM, bool is_sds, unsigned long long bitsize_align)
 fill the memory of the array ref More...
 
static void write_init (const tree_managerConstRef TreeM, tree_nodeRef var_node, tree_nodeRef init_node, std::vector< std::string > &init_file, const memoryRef mem, unsigned long long element_precision)
 

Static Public Attributes

static const unsigned int UNKNOWN = std::numeric_limits<unsigned int>::max()
 The value used to identified unknown functional unit. More...
 

Protected Member Functions

void update_allocation (unsigned int unit, unsigned int number)
 Update number of allocated units. More...
 
structural_objectRef add_gate (const HLS_managerRef HLSMgr, const hlsRef HLS, const technology_nodeRef fu, const std::string &name, const OpVertexSet &ops, structural_objectRef clock_port, structural_objectRef reset_port) const
 Add an instance of the current port. More...
 
void check_parametrization (structural_objectRef curr_gate)
 check the module parametrization More...
 
void kill_proxy_memory_units (std::map< unsigned int, unsigned int > &memory_units, structural_objectRef curr_gate, std::map< unsigned int, std::list< structural_objectRef >> &var_call_sites_rel, std::map< unsigned int, unsigned int > &reverse_memory_units)
 fix port properties for proxy memory ports More...
 
void kill_proxy_function_units (std::map< unsigned int, std::string > &wrapped_units, structural_objectRef curr_gate, std::map< std::string, std::list< structural_objectRef >> &fun_call_sites_rel, std::map< std::string, unsigned int > &reverse_wrapped_units)
 
void manage_killing_memory_proxies (std::map< unsigned int, structural_objectRef > &mem_obj, std::map< unsigned int, unsigned int > &reverse_memory_units, std::map< unsigned int, std::list< structural_objectRef >> &var_call_sites_rel, const structural_managerRef SM, const hlsRef HLS, unsigned int &_unique_id)
 connect proxies with storage components More...
 
void manage_killing_function_proxies (std::map< unsigned int, structural_objectRef > &fun_obj, std::map< std::string, unsigned int > &reverse_function_units, std::map< std::string, std::list< structural_objectRef >> &fun_call_sites_rel, const structural_managerRef SM, const hlsRef HLS, unsigned int &_unique_id)
 

Protected Attributes

std::map< unsigned int, unsigned int > allocation_map
 map between functional unit id and number of units allocated More...
 
std::map< std::pair< unsigned int, unsigned int >, generic_objRefunique_table
 map between unit and allocated objects More...
 
std::map< std::pair< unsigned int, unsigned int >, OpVertexSetoperations
 reverse map that associated each functional unit with the set of operations that are executed More...
 
std::map< unsigned int, generic_objRefop_binding
 operation binding More...
 
AllocationInformationRef allocation_information
 allocation manager. Used to retrieve the string name of the functional units. More...
 
const tree_managerConstRef TreeM
 information about the tree data-structure More...
 
const OpGraphConstRef op_graph
 The operation graph. More...
 
CustomOrderedSet< vertexports_are_swapped
 port assignment: ports are swapped predicate More...
 
const ParameterConstRef parameters
 The set of input parameters. More...
 
int debug_level
 The debug level. More...
 
bool has_resource_sharing_p
 useful to know for automatic pipelining More...
 

Detailed Description

Class managing the functional-unit binding.

It stores the functional-unit binding, that is, the mapping of operations in the behavioral description onto the set of allocated functional units.

Definition at line 90 of file fu_binding.hpp.

Constructor & Destructor Documentation

◆ fu_binding() [1/2]

fu_binding::fu_binding ( const HLS_managerConstRef  _HLSMgr,
const unsigned int  function_id,
const ParameterConstRef  parameters 
)

Constructor.

Parameters
HLS_mgris the HLS manager
function_idis the index of the function
parametersis the set of input parameters

Definition at line 109 of file fu_binding.cpp.

Referenced by create_fu_binding().

Here is the caller graph for this function:

◆ fu_binding() [2/2]

fu_binding::fu_binding ( const fu_binding original)

Definition at line 120 of file fu_binding.cpp.

References ~fu_binding().

Here is the call graph for this function:

◆ ~fu_binding()

fu_binding::~fu_binding ( )
virtualdefault

Destructor.

Referenced by fu_binding().

Here is the caller graph for this function:

Member Function Documentation

◆ add_gate()

structural_objectRef fu_binding::add_gate ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
const technology_nodeRef  fu,
const std::string &  name,
const OpVertexSet ops,
structural_objectRef  clock_port,
structural_objectRef  reset_port 
) const
protected

Add an instance of the current port.

creating structural_manager starting from technology_node

connecting clock and reset ports, if any

Definition at line 267 of file fu_binding.cpp.

References FunctionBehavior::CFG, CLOCK_PORT_NAME, structural_object::copy(), hls::datapath, debug_level, structural_object::find_member(), hls::functionId, structural_manager::get_circ(), GET_NAME, hls::HLS_D, port_o_K, RESET_PORT_NAME, structural_object::set_id(), and THROW_ASSERT.

Referenced by add_to_SM().

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

◆ add_to_SM()

void fu_binding::add_to_SM ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
structural_objectRef  clock_port,
structural_objectRef  reset_port 
)
virtual

Instance the functional unit inside the structural representation of the datapath.

unique id identifier

initialize resource sharing to false

add the MEMCPY_STD component when parameters has to be copied into the local store

component specialization

propagate memory parameters if contained into the module to be instantiated

rename proxy ports

propagate memory parameters if contained into the module to be instantiated

rename back all the memory proxies ports

rename back all the function proxies ports

Reimplemented in ParallelMemoryFuBinding, and fu_binding_cs.

Definition at line 551 of file fu_binding.cpp.

References add_gate(), memory::add_memory_parameter(), allocation_information, BUILTIN_WAIT_CALL, OpGraph::CGetOpNodeInfo(), tree_helper::CGetType(), CHANNELS_TYPE_MEM_ACC_N1, CHANNELS_TYPE_MEM_ACC_NN, check_parametrization(), CLOCK_PORT_NAME, CONSTANT_STD, hls::control_flow_checker, structural_object::copy(), hls::datapath, debug_level, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERY_PEDANTIC, DONE_PORT_NAME, DONE_PORT_NAME_CFC, structural_object::find_member(), flipflop_AR, flipflop_SR, hls::functionId, get_allocation_list(), structural_manager::get_circ(), AllocationInformation::get_fu(), AllocationInformation::get_fu_name(), structural_object::get_id(), structural_object::get_kind(), AllocationInformation::get_memory_units(), get_number(), AllocationInformation::get_number_channels(), get_operations(), generic_obj::get_out_sign(), conn_binding::get_port(), AllocationInformation::get_proxy_function_units(), AllocationInformation::get_proxy_memory_units(), AllocationInformation::get_proxy_memory_var(), AllocationInformation::get_proxy_wrapped_units(), AllocationInformation::get_string_name(), structural_object::get_typeRef(), functions::GetFUName(), has_resource_sharing_p, AllocationInformation::has_to_be_synthetized(), hls::HLS_D, INDENT_DBG_MEX, INDENT_OUT_MEX, reg_binding::is_all_regs_without_enable(), AllocationInformation::is_direct_access_memory_unit(), AllocationInformation::is_direct_proxy_memory_unit(), AllocationInformation::is_dual_port_memory(), AllocationInformation::is_indirect_access_memory_unit(), AllocationInformation::is_memory_unit(), AllocationInformation::is_proxy_memory_unit(), AllocationInformation::is_return(), key, kill_proxy_function_units(), kill_proxy_memory_units(), LIBRARY_STD, LIBRARY_STD_FU, manage_killing_function_proxies(), manage_killing_memory_proxies(), manage_memory_ports_chained(), manage_memory_ports_parallel_chained(), manage_module_ports(), max, MEM_ACC_NN, MEMCPY_STD, MEMORY_TYPE_ASYNCHRONOUS, MEMORY_TYPE_SYNCHRONOUS_SDS, MEMORY_TYPE_SYNCHRONOUS_SDS_BUS, MEMORY_TYPE_SYNCHRONOUS_UNALIGNED, MEMSTORE_STD, MEMSTORE_STDN, tree_helper::name_function(), NEXT_STATE_PORT_NAME, tree_helper::NormalizeTypename(), NumberToBinaryString(), op_graph, operations, hls::output_level, OUTPUT_LEVEL_MINIMUM, hls::Param, parameters, port_o_K, port_vector_o_K, PRESENT_STATE_PORT_NAME, PRINT_DBG_MEX, memory::propagate_memory_parameters(), PROXY_PREFIX, hls::Rconn, hls::registered_inputs, RESET_PORT_NAME, port_o::resize_if_busport(), RETURN_PORT_NAME, hls::Rfu, hls::Rreg, structural_object::set_id(), generic_obj::set_structural_obj(), sign, tree_helper::Size(), specialise_fu(), specialize_memory_unit(), START_PORT_NAME, START_PORT_NAME_CFC, starts_with(), STD_GET_SIZE, STR, THROW_ASSERT, THROW_ERROR, TreeM, U, VHDL, and WORK_LIBRARY.

Referenced by fu_binding_cs::add_to_SM(), ParallelMemoryFuBinding::add_to_SM(), and classic_datapath::InternalExec().

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

◆ bind()

void fu_binding::bind ( const vertex v,
unsigned int  unit,
unsigned int  index = std::numeric_limits<unsigned int>::max() 
)

Binds an operation vertex to a functional unit.

The functional unit is identified by an id and its index

Parameters
vis operation vertex
idis the identifier of the functional unit
indexis the functional unit index

Definition at line 173 of file fu_binding.cpp.

References allocation_information, OpGraph::CGetOpNodeInfo(), AllocationInformation::get_string_name(), index, INFINITE_UINT, key, op_binding, op_graph, operations, STR, unique_table, and update_allocation().

Referenced by parametric_list_based::exec(), unique_binding::InternalExec(), easy_module_binding::InternalExec(), SDCScheduling::InternalExec(), cdfc_module_binding::InternalExec(), and hls::xload().

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

◆ check_parametrization()

void fu_binding::check_parametrization ( structural_objectRef  curr_gate)
protected

check the module parametrization

Definition at line 1261 of file fu_binding.cpp.

References GET_TYPE_NAME, param, port_o_K, port_vector_o_K, and THROW_ASSERT.

Referenced by add_to_SM().

Here is the caller graph for this function:

◆ create_fu_binding()

fu_bindingRef fu_binding::create_fu_binding ( const HLS_managerConstRef  _HLSMgr,
const unsigned int  _function_id,
const ParameterConstRef  _parameters 
)
static

create_fu_binding: factory method for fu_binding

Parameters
_HLSMgr
_function_id
_parameters
Returns
the correct class of fu_binding

Definition at line 135 of file fu_binding.cpp.

References fu_binding().

Referenced by easy_module_binding::Initialize(), fu_binding_creator::Initialize(), Scheduling::Initialize(), and cdfc_module_binding::InternalExec().

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

◆ fill_array_ref_memory()

void fu_binding::fill_array_ref_memory ( std::ostream &  init_file_a,
std::ostream &  init_file_b,
unsigned int  ar,
unsigned long long &  vec_size,
unsigned long long &  elts_size,
const memoryRef  mem,
tree_managerConstRef  TM,
bool  is_sds,
unsigned long long  bitsize_align 
)
static

fill the memory of the array ref

Parameters
TreeMis the tree_manager
init_file_ais the file where the data is written (all data stored in this file in case is_memory_splitted is false
initi_file_bis the file where the data is written (only the odd elements are store in this file and only if is open)
aris the array ref variable declaration
vec_sizeis the number of the element of the array
elts_sizeis the element size in bits
memis the memory reference
TMis the tree manager reference
is_sdsis true if SDS memory alignment is required
bitsize_alignis the memory alignment bitsize

Definition at line 2424 of file fu_binding.cpp.

References tree_helper::CGetElements(), tree_helper::CGetType(), counter, get_aligned_bitsize(), tree_helper::get_array_dim_and_bitsize(), GET_CONST_NODE, GET_NODE, index, tree_helper::IsArrayEquivType(), tree_helper::IsBooleanType(), tree_helper::IsComplexType(), tree_helper::IsEnumType(), tree_helper::IsPointerType(), tree_helper::IsRealType(), tree_helper::IsStructType(), tree_helper::IsUnionType(), tree_helper::IsVectorType(), tree_helper::Size(), THROW_ASSERT, THROW_ERROR, and write_init().

Referenced by TestbenchGeneration::generate_init_file(), and specialize_memory_unit().

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

◆ get() [1/2]

generic_objRef fu_binding::get ( const vertex  v) const

Returns reference to funit object associated with this vertex.

Parameters
vis the given vertex
Returns
the associated reference

Definition at line 3409 of file fu_binding.cpp.

References OpGraph::CGetOpNodeInfo(), op_binding, and op_graph.

Referenced by conn_binding::add_command_ports(), mux_connection_binding::connect_to_registers(), mux_connection_binding::create_connections(), and fsm_controller::create_state_machine().

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

◆ get() [2/2]

generic_objRef fu_binding::get ( unsigned int  name,
unsigned int  index 
)
inline

Definition at line 279 of file fu_binding.hpp.

References index.

◆ get_allocation_list()

std::list< unsigned int > fu_binding::get_allocation_list ( ) const

Returns the set of allocated unit.

Returns
the set of allocated unit

Definition at line 221 of file fu_binding.cpp.

References allocation_map.

Referenced by ParallelMemoryFuBinding::add_to_SM(), add_to_SM(), and mux_connection_binding::create_connections().

Here is the caller graph for this function:

◆ get_assign() [1/2]

unsigned int fu_binding::get_assign ( const vertex v) const

◆ get_assign() [2/2]

unsigned int fu_binding::get_assign ( const unsigned int  statement_index) const

Returns the functional unit assigned to the operation.

Parameters
statement_indexis the considered operation.
Returns
the functional unit assigned to the operation

Definition at line 248 of file fu_binding.cpp.

References op_binding, THROW_ASSERT, and TreeM.

◆ get_fu_name()

std::string fu_binding::get_fu_name ( vertex const &  v) const

Returns the name of the functional unit.

Parameters
vis the considered vertex.
Returns
the name of the functional unit assigned to the vertex.

Definition at line 256 of file fu_binding.cpp.

References allocation_information, get_assign(), and AllocationInformation::get_string_name().

Referenced by Schedule::print().

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

◆ get_index()

unsigned int fu_binding::get_index ( const vertex v) const

Returns the index of functional unit assigned to the vertex.

Parameters
vis the considered vertex.
Returns
the index of the functional unit assigned to the vertex.

Definition at line 261 of file fu_binding.cpp.

References OpGraph::CGetOpNodeInfo(), op_binding, and op_graph.

Referenced by conn_binding::add_command_ports(), mux_connection_binding::create_connections(), estimate_muxes(), module_binding_check< vertex_type >::initialize_structures(), unique_binding::InternalExec(), easy_module_binding::InternalExec(), port_swapping::InternalExec(), cdfc_module_binding::InternalExec(), and hls::xwrite().

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

◆ get_number()

unsigned int fu_binding::get_number ( unsigned int  unit) const
inline

Returns number of functional unit allocated.

Parameters
unitis the identifier associated to functional unit
Returns
the number of functional units allocated.

Definition at line 249 of file fu_binding.hpp.

Referenced by add_to_SM(), and mux_connection_binding::create_connections().

Here is the caller graph for this function:

◆ get_operations()

OpVertexSet fu_binding::get_operations ( unsigned int  unit,
unsigned int  index 
) const

Return the operations that are executed by the given functional unit.

Definition at line 194 of file fu_binding.cpp.

References op_graph, and operations.

Referenced by add_to_SM().

Here is the caller graph for this function:

◆ get_ports_are_swapped()

bool fu_binding::get_ports_are_swapped ( vertex  v) const
inline

Check if vertex v has its ports swapped or not.

Parameters
vis the vertex
Returns
true when ports of v are swapped, false otherwise

Definition at line 359 of file fu_binding.hpp.

Referenced by mux_connection_binding::create_connections(), and estimate_muxes().

Here is the caller graph for this function:

◆ has_resource_sharing()

bool fu_binding::has_resource_sharing ( ) const
inline

return true in case at least one resource is shared

Definition at line 365 of file fu_binding.hpp.

References map.

◆ is_assigned() [1/2]

bool fu_binding::is_assigned ( const vertex v) const

return true in case the vertex has been previously assigned

Parameters
v
Returns
true in case v has been previously assigned

Definition at line 210 of file fu_binding.cpp.

References OpGraph::CGetOpNodeInfo(), and op_graph.

Referenced by module_binding_check< vertex_type >::initialize_structures().

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

◆ is_assigned() [2/2]

bool fu_binding::is_assigned ( const unsigned int  statement_index) const

return true in case the operation has been previously assigned

Parameters
statement_index
Returns
true in case operation has been previously assigned

Definition at line 216 of file fu_binding.cpp.

References op_binding.

◆ join_merge_split()

void fu_binding::join_merge_split ( const structural_managerRef  SM,
const hlsRef  HLS,
std::map< structural_objectRef, std::list< structural_objectRef >, jms_sorter > &  primary_outs,
const structural_objectRef  circuit,
unsigned int &  unique_id 
)
static

◆ kill_proxy_function_units()

void fu_binding::kill_proxy_function_units ( std::map< unsigned int, std::string > &  wrapped_units,
structural_objectRef  curr_gate,
std::map< std::string, std::list< structural_objectRef >> &  fun_call_sites_rel,
std::map< std::string, unsigned int > &  reverse_wrapped_units 
)
protected

compute the set of killing functions

Definition at line 356 of file fu_binding.cpp.

References structural_object::get_id(), PROXY_PREFIX, and starts_with().

Referenced by add_to_SM().

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

◆ kill_proxy_memory_units()

void fu_binding::kill_proxy_memory_units ( std::map< unsigned int, unsigned int > &  memory_units,
structural_objectRef  curr_gate,
std::map< unsigned int, std::list< structural_objectRef >> &  var_call_sites_rel,
std::map< unsigned int, unsigned int > &  reverse_memory_units 
)
protected

fix port properties for proxy memory ports

Parameters
memory_unitsis the list o memory ports
curr_gateis the current gate
var_call_sites_relput into relation proxied variables and modules referring to such variables

compute the set of killing vars

Definition at line 322 of file fu_binding.cpp.

References structural_object::find_member(), port_o_K, and STR.

Referenced by add_to_SM().

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

◆ manage_extern_global_port()

void fu_binding::manage_extern_global_port ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
const structural_managerRef  SM,
structural_objectRef  port_in,
unsigned int  dir,
structural_objectRef  circuit,
unsigned int  num 
)
virtual

◆ manage_killing_function_proxies()

void fu_binding::manage_killing_function_proxies ( std::map< unsigned int, structural_objectRef > &  fun_obj,
std::map< std::string, unsigned int > &  reverse_function_units,
std::map< std::string, std::list< structural_objectRef >> &  fun_call_sites_rel,
const structural_managerRef  SM,
const hlsRef  HLS,
unsigned int &  _unique_id 
)
protected

◆ manage_killing_memory_proxies()

void fu_binding::manage_killing_memory_proxies ( std::map< unsigned int, structural_objectRef > &  mem_obj,
std::map< unsigned int, unsigned int > &  reverse_memory_units,
std::map< unsigned int, std::list< structural_objectRef >> &  var_call_sites_rel,
const structural_managerRef  SM,
const hlsRef  HLS,
unsigned int &  _unique_id 
)
protected

connect proxies with storage components

Parameters
mem_objis the relation between fu_id and structural objects
reverse_memory_unitsis the relation between var and functional units
var_call_sites_relis the relation between var and call sites having a proxy as module parameter
SMis the structural manager

Definition at line 417 of file fu_binding.cpp.

References structural_manager::add_connection(), structural_manager::add_sign(), structural_manager::add_sign_vector(), structural_manager::get_circ(), join_merge_split(), port_o_K, port_vector_o_K, STR, and THROW_ASSERT.

Referenced by add_to_SM().

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

◆ manage_memory_ports_chained()

void fu_binding::manage_memory_ports_chained ( const structural_managerRef  SM,
const std::list< structural_objectRef > &  memory_modules,
const structural_objectRef  circuit 
)
static

Manage the connections between memory ports.

trimmed away the "?in_"prefix

trimmed away the "?out_"prefix

Definition at line 1316 of file fu_binding.cpp.

References structural_manager::add_connection(), structural_manager::add_port(), structural_manager::add_port_vector(), structural_manager::add_sign(), structural_manager::add_sign_vector(), structural_object::find_member(), port_o::fix_port_properties(), structural_object::get_kind(), structural_object::get_typeRef(), key, port_vector_o_K, sign, and THROW_ASSERT.

Referenced by add_to_SM().

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

◆ manage_memory_ports_parallel_chained()

void fu_binding::manage_memory_ports_parallel_chained ( const HLS_managerRef  HLSMgr,
const structural_managerRef  SM,
const std::list< structural_objectRef > &  memory_modules,
const structural_objectRef  circuit,
const hlsRef  HLS,
unsigned int &  unique_id 
)
virtual

◆ manage_module_ports()

bool fu_binding::manage_module_ports ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
const structural_managerRef  SM,
const structural_objectRef  curr_gate,
unsigned int  num 
)
virtual

creating extern IN port on datapath starting from extern ports on module

creating extern OUT port on datapath starting from extern ports on module

creating extern IO port on datapath starting from extern ports on module

Reimplemented in ParallelMemoryFuBinding.

Definition at line 1284 of file fu_binding.cpp.

References debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_manager::get_circ(), INDENT_DBG_MEX, and manage_extern_global_port().

Referenced by add_to_SM(), TopEntityMemoryMapped::insertMemoryMappedRegister(), TopEntityMemoryMapped::insertStartDoneLogic(), TopEntityMemoryMapped::insertStatusRegister(), TopEntityMemoryMapped::InternalExec(), and ParallelMemoryFuBinding::manage_module_ports().

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

◆ operator=()

fu_binding& fu_binding::operator= ( const fu_binding )
delete

◆ operator[]()

const funit_obj & fu_binding::operator[] ( const vertex v)

Redefinition of the [] operator.

It is necessary because segfaults happen when the vertex is not into the map and so the object has not been created yet. This operator can be used only to read information since it returns a constant object. It's necessary because a direct manipulation of the object can create non-consistent data objects.

Parameters
vis the vertex you want to get the object
Returns
the constant object related to vertex

Definition at line 203 of file fu_binding.cpp.

References OpGraph::CGetOpNodeInfo(), op_binding, op_graph, and THROW_ASSERT.

Here is the call graph for this function:

◆ set_ports_are_swapped()

void fu_binding::set_ports_are_swapped ( vertex  v,
bool  condition 
)

specify if vertex v have or not its ports swapped

Parameters
vis the vertex
conditionis true when ports are swapped, false otherwise

Definition at line 3397 of file fu_binding.cpp.

References ports_are_swapped.

Referenced by port_swapping::InternalExec().

Here is the caller graph for this function:

◆ specialise_fu()

void fu_binding::specialise_fu ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
structural_objectRef  fu_obj,
unsigned int  fu,
const OpVertexSet operations,
unsigned int  ar 
)

Specialize the functional unit based on variables associated with the corresponding operations.

specializing MEMORY_STD ports

check for precision parameter

Definition at line 1836 of file fu_binding.cpp.

References tree_helper::AccessedMaximumBitsize(), ALL_BRAM, allocation_information, test_panda::args, structural_type_descriptor::BOOL, BUILTIN_WAIT_CALL, FunctionBehavior::CFG, tree_helper::CGetElements(), tree_helper::CGetType(), CLOCK_PORT_NAME, convert_to_binary(), debug_level, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERY_PEDANTIC, DONE_PORT_NAME, EXT_PIPELINED_BRAM, FLOAT_EXPR, NP_functionality::FLOPOCO_PROVIDED, hls::functionId, GET_CONST_NODE, AllocationInformation::get_fu(), AllocationInformation::get_fu_name(), structural_object::get_id(), GET_INDEX_CONST_NODE, tree_helper::get_integer_cst_value(), structural_object::get_kind(), GET_NAME, GET_NODE, AllocationInformation::get_number_channels(), structural_object::get_path(), GET_TYPE, GET_TYPE_NAME, structural_object::get_typeRef(), tree_helper::GetBaseVariable(), tree_helper::GetConstValue(), getFunctionType(), GetPath(), hls::HLS_D, INDENT_DBG_MEX, index, tree_helper::is_a_misaligned_vector(), AllocationInformation::is_direct_access_memory_unit(), AllocationInformation::is_dual_port_memory(), tree_helper::IsVectorType(), max, min, MULTI_READ_COND_STD, offset, param, hls::Param, PIPE_PARAMETER, port_vector_o_K, PRINT_DBG_MEX, PROXY_LIBRARY, RESET_PORT_NAME, port_o::resize_if_busport(), port_o::resize_std_port(), tree_helper::Size(), START_PORT_NAME, STR, THROW_ASSERT, THROW_ERROR, ToString(), TreeM, structural_type_descriptor::type, test_panda::type, TYPE_LOAD, TYPE_STORE, U, and WORK_LIBRARY.

Referenced by add_to_SM().

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

◆ specialize_memory_unit()

void fu_binding::specialize_memory_unit ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
structural_objectRef  fu_obj,
unsigned int  ar,
const std::string &  base_address,
unsigned long long  rangesize,
bool  is_memory_splitted,
bool  is_sparse_memory,
bool  is_sds 
)

Specialize a memory unit.

base address specialization

array ref initialization

specialize the number of elements in the array

Definition at line 2377 of file fu_binding.cpp.

References memory::add_memory_parameter(), hls::datapath, debug_level, DEBUG_LEVEL_VERY_PEDANTIC, fill_array_ref_memory(), hls::functionId, GetPath(), INDENT_DBG_MEX, STR, THROW_ASSERT, and TreeM.

Referenced by add_to_SM().

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

◆ update_allocation()

void fu_binding::update_allocation ( unsigned int  unit,
unsigned int  number 
)
protected

Update number of allocated units.

It takes effect only if new number is greather than stored one

Parameters
unitis the identifier associated to functional unit
numberis the new number of allocated units

Definition at line 234 of file fu_binding.cpp.

References allocation_map.

Referenced by bind().

Here is the caller graph for this function:

◆ write_init()

void fu_binding::write_init ( const tree_managerConstRef  TreeM,
tree_nodeRef  var_node,
tree_nodeRef  init_node,
std::vector< std::string > &  init_file,
const memoryRef  mem,
unsigned long long  element_precision 
)
static

check if designated initializers are really used

check if padding is needed

add padding

check if padding is needed

add padding

check if padding is needed

add padding

Definition at line 2722 of file fu_binding.cpp.

References CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, tree_helper::CGetType(), convert_fp_to_string(), tree_helper::get_array_dim_and_bitsize(), memory::get_base_address(), GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_helper::GetConstValue(), memory::has_base_address(), index, max, min, offset, tree_helper::Size(), STR, THROW_ASSERT, THROW_ERROR, U, and symmetry::value.

Referenced by fill_array_ref_memory(), and TestbenchGeneration::print_var_init().

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

Field Documentation

◆ allocation_information

AllocationInformationRef fu_binding::allocation_information
protected

allocation manager. Used to retrieve the string name of the functional units.

Definition at line 106 of file fu_binding.hpp.

Referenced by ParallelMemoryFuBinding::add_to_SM(), add_to_SM(), bind(), get_fu_name(), and specialise_fu().

◆ allocation_map

std::map<unsigned int, unsigned int> fu_binding::allocation_map
protected

map between functional unit id and number of units allocated

Definition at line 94 of file fu_binding.hpp.

Referenced by get_allocation_list(), and update_allocation().

◆ debug_level

int fu_binding::debug_level
protected

◆ has_resource_sharing_p

bool fu_binding::has_resource_sharing_p
protected

useful to know for automatic pipelining

Definition at line 124 of file fu_binding.hpp.

Referenced by add_to_SM().

◆ op_binding

std::map<unsigned int, generic_objRef> fu_binding::op_binding
protected

operation binding

Definition at line 103 of file fu_binding.hpp.

Referenced by bind(), get(), get_assign(), get_index(), is_assigned(), and operator[]().

◆ op_graph

const OpGraphConstRef fu_binding::op_graph
protected

◆ operations

std::map<std::pair<unsigned int, unsigned int>, OpVertexSet> fu_binding::operations
protected

reverse map that associated each functional unit with the set of operations that are executed

Definition at line 100 of file fu_binding.hpp.

Referenced by add_to_SM(), bind(), and get_operations().

◆ parameters

const ParameterConstRef fu_binding::parameters
protected

◆ ports_are_swapped

CustomOrderedSet<vertex> fu_binding::ports_are_swapped
protected

port assignment: ports are swapped predicate

Definition at line 115 of file fu_binding.hpp.

Referenced by set_ports_are_swapped().

◆ TreeM

const tree_managerConstRef fu_binding::TreeM
protected

information about the tree data-structure

Definition at line 109 of file fu_binding.hpp.

Referenced by add_to_SM(), get_assign(), specialise_fu(), and specialize_memory_unit().

◆ unique_table

std::map<std::pair<unsigned int, unsigned int>, generic_objRef> fu_binding::unique_table
protected

map between unit and allocated objects

Definition at line 97 of file fu_binding.hpp.

Referenced by bind().

◆ UNKNOWN

const unsigned int fu_binding::UNKNOWN = std::numeric_limits<unsigned int>::max()
static

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

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