PandA-2024.02
Public Member Functions | Protected Member Functions
fu_binding_cs Class Reference

#include <fu_binding_cs.hpp>

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

Public Member Functions

 fu_binding_cs (const HLS_managerConstRef _HLSMgr, const unsigned int function_id, const ParameterConstRef parameters)
 
 ~fu_binding_cs () override
 Destructor. More...
 
void add_to_SM (const HLS_managerRef HLSMgr, const hlsRef HLS, structural_objectRef clock_port, structural_objectRef reset_port) override
 Call different method that instantiate the new component for each function_type. More...
 
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) override
 decide based on function what function to call in order to connect appropriately the datapath memory_signal with the component More...
 
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) override
 manage_extern_global_port based on function attach the input of memory modules More...
 
- Public Member Functions inherited from fu_binding
 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...
 
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...
 

Protected Member Functions

void instantiate_component_kernel (const HLS_managerRef HLSMgr, const hlsRef HLS, structural_objectRef clock_port, structural_objectRef reset_port)
 instantiate_component_kernel More...
 
void connectOutOr (const HLS_managerRef HLSMgr, const hlsRef HLS, structural_objectRef port_out_or)
 connectOutOr connect or with datapath or scheduler depending on function More...
 
void connect_scheduler_Datapath (const structural_managerRef SM, const std::list< structural_objectRef > &memory_modules, const structural_objectRef circuit, const hlsRef HLS, unsigned int &_unique_id)
 connect scheduler with datapath and other memory modules More...
 
void resize_scheduler_ports (const HLS_managerRef HLSMgr, structural_objectRef scheduler_mod)
 for each port decide its vector size More...
 
void resize_dimension_bus_port (const HLS_managerRef HLSMgr, structural_objectRef port)
 for each port resize it using vector size More...
 
void manage_memory_port_kernel (const structural_managerRef SM, const std::list< structural_objectRef > &memory_modules, const structural_objectRef circuit, const hlsRef HLS, unsigned int &_unique_id)
 manage_memory_port_kernel connect correctly memory port when in kernel function More...
 
void manage_memory_port_hierarchical (const structural_managerRef SM, const std::list< structural_objectRef > &memory_modules, const structural_objectRef circuit, const hlsRef HLS, unsigned int &_unique_id)
 manage_memory_port_hierarchical connect correctly memory port when in hierarchical function More...
 
void connect_selector (const hlsRef HLS)
 connect_selector in function not kernel connect selector with all the module that have the right port More...
 
void connect_selector_kernel (const hlsRef HLS)
 connect_selector_kernel, kernel take selector from scheduler More...
 
void set_atomic_memory_parameter (const hlsRef HLS)
 set_atomic_memory_parameter need to set in order to have memory operation defined as atomic More...
 
- Protected Member Functions inherited from fu_binding
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)
 

Additional Inherited Members

- Static Public Member Functions inherited from fu_binding
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 inherited from fu_binding
static const unsigned int UNKNOWN = std::numeric_limits<unsigned int>::max()
 The value used to identified unknown functional unit. More...
 
- Protected Attributes inherited from fu_binding
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

Definition at line 45 of file fu_binding_cs.hpp.

Constructor & Destructor Documentation

◆ fu_binding_cs()

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

Definition at line 61 of file fu_binding_cs.cpp.

References fu_binding::debug_level, GET_CLASS, and ~fu_binding_cs().

Here is the call graph for this function:

◆ ~fu_binding_cs()

fu_binding_cs::~fu_binding_cs ( )
overridedefault

Destructor.

Referenced by fu_binding_cs().

Here is the caller graph for this function:

Member Function Documentation

◆ add_to_SM()

void fu_binding_cs::add_to_SM ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
structural_objectRef  clock_port,
structural_objectRef  reset_port 
)
overridevirtual

Call different method that instantiate the new component for each function_type.

Reimplemented from fu_binding.

Definition at line 70 of file fu_binding_cs.cpp.

References fu_binding::add_to_SM(), connect_selector(), connect_selector_kernel(), hls::functionId, instantiate_component_kernel(), and set_atomic_memory_parameter().

Here is the call graph for this function:

◆ connect_scheduler_Datapath()

void fu_binding_cs::connect_scheduler_Datapath ( const structural_managerRef  SM,
const std::list< structural_objectRef > &  memory_modules,
const structural_objectRef  circuit,
const hlsRef  HLS,
unsigned int &  _unique_id 
)
protected

connect scheduler with datapath and other memory modules

Parameters
SM
memory_modules
circuit
HLS
_unique_id

◆ connect_selector()

void fu_binding_cs::connect_selector ( const hlsRef  HLS)
protected

connect_selector in function not kernel connect selector with all the module that have the right port

Parameters
HLS

Definition at line 194 of file fu_binding_cs.cpp.

References structural_manager::add_connection(), hls::datapath, structural_object::find_member(), structural_manager::get_circ(), port_o_K, SELECTOR_REGISTER_FILE, and STR.

Referenced by add_to_SM().

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

◆ connect_selector_kernel()

void fu_binding_cs::connect_selector_kernel ( const hlsRef  HLS)
protected

connect_selector_kernel, kernel take selector from scheduler

Parameters
HLS

Definition at line 211 of file fu_binding_cs.cpp.

References structural_manager::add_connection(), structural_manager::add_sign(), ceil_log2(), component_o_K, hls::datapath, fu_binding::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_object::find_member(), structural_manager::get_circ(), structural_object::get_id(), fu_binding::parameters, port_o_K, PRINT_DBG_MEX, SELECTOR_REGISTER_FILE, STR, and structural_object::type_resize().

Referenced by add_to_SM().

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

◆ connectOutOr()

void fu_binding_cs::connectOutOr ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
structural_objectRef  port_out_or 
)
protected

connectOutOr connect or with datapath or scheduler depending on function

Parameters
HLSMgr
HLS
suspensionOr

◆ instantiate_component_kernel()

void fu_binding_cs::instantiate_component_kernel ( const HLS_managerRef  HLSMgr,
const hlsRef  HLS,
structural_objectRef  clock_port,
structural_objectRef  reset_port 
)
protected

◆ manage_extern_global_port()

void fu_binding_cs::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 
)
overridevirtual

manage_extern_global_port based on function attach the input of memory modules

Parameters
HLSMgr
HLS
SM
port_in
dir
circuit
num

Reimplemented from fu_binding.

Definition at line 517 of file fu_binding_cs.cpp.

References hls::functionId, fu_binding::manage_extern_global_port(), and THROW_ERROR.

Here is the call graph for this function:

◆ manage_memory_port_hierarchical()

void fu_binding_cs::manage_memory_port_hierarchical ( const structural_managerRef  SM,
const std::list< structural_objectRef > &  memory_modules,
const structural_objectRef  circuit,
const hlsRef  HLS,
unsigned int &  _unique_id 
)
protected

manage_memory_port_hierarchical connect correctly memory port when in hierarchical function

Parameters
SM
memory_modules
circuit
HLS
_unique_id

Definition at line 419 of file fu_binding_cs.cpp.

References structural_manager::add_connection(), structural_manager::add_port_vector(), fu_binding::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_object::find_member(), port_o::fix_port_properties(), structural_object::get_kind(), structural_object::get_typeRef(), fu_binding::join_merge_split(), fu_binding::parameters, port_vector_o_K, PRINT_DBG_MEX, and THROW_ASSERT.

Referenced by manage_memory_ports_parallel_chained().

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

◆ manage_memory_port_kernel()

void fu_binding_cs::manage_memory_port_kernel ( const structural_managerRef  SM,
const std::list< structural_objectRef > &  memory_modules,
const structural_objectRef  circuit,
const hlsRef  HLS,
unsigned int &  _unique_id 
)
protected

manage_memory_port_kernel connect correctly memory port when in kernel function

Parameters
SM
memory_modules
circuit
HLS
_unique_id

Definition at line 305 of file fu_binding_cs.cpp.

References structural_manager::add_connection(), structural_manager::add_port(), structural_manager::add_port_vector(), structural_manager::add_sign(), component_o_K, fu_binding::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_object::find_member(), port_o::fix_port_properties(), structural_object::get_kind(), structural_object::get_typeRef(), fu_binding::join_merge_split(), port_vector_o_K, PRINT_DBG_MEX, and THROW_ASSERT.

Referenced by manage_memory_ports_parallel_chained().

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

◆ manage_memory_ports_parallel_chained()

void fu_binding_cs::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 
)
overridevirtual

decide based on function what function to call in order to connect appropriately the datapath memory_signal with the component

Parameters
HLSMgr
SM
memory_modules
circuit
HLS
_unique_id

Reimplemented from fu_binding.

Definition at line 285 of file fu_binding_cs.cpp.

References hls::functionId, manage_memory_port_hierarchical(), manage_memory_port_kernel(), and fu_binding::manage_memory_ports_parallel_chained().

Here is the call graph for this function:

◆ resize_dimension_bus_port()

void fu_binding_cs::resize_dimension_bus_port ( const HLS_managerRef  HLSMgr,
structural_objectRef  port 
)
protected

for each port resize it using vector size

Parameters
HLSMgr
port

Definition at line 169 of file fu_binding_cs.cpp.

References structural_object::type_resize().

Referenced by resize_scheduler_ports().

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

◆ resize_scheduler_ports()

void fu_binding_cs::resize_scheduler_ports ( const HLS_managerRef  HLSMgr,
structural_objectRef  scheduler_mod 
)
protected

for each port decide its vector size

Parameters
HLSMgr
scheduler_mod

Definition at line 149 of file fu_binding_cs.cpp.

References resize_dimension_bus_port().

Referenced by instantiate_component_kernel().

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

◆ set_atomic_memory_parameter()

void fu_binding_cs::set_atomic_memory_parameter ( const hlsRef  HLS)
protected

set_atomic_memory_parameter need to set in order to have memory operation defined as atomic

Parameters
HLS

Definition at line 254 of file fu_binding_cs.cpp.

References ceil_log2(), hls::datapath, structural_object::ExistsParameter(), structural_manager::get_circ(), fu_binding::parameters, structural_object::SetParameter(), STR, and THROW_ERROR.

Referenced by add_to_SM().

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

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