PandA-2024.02
mux_connection_binding.hpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
45 #ifndef MUX_CONNECTION_BINDING_HPP
46 #define MUX_CONNECTION_BINDING_HPP
47 
48 #include "conn_binding_creator.hpp"
50 class array_ref;
51 
52 #include "conn_binding.hpp"
53 
54 #include "hls_manager.hpp"
55 
57 
61 
73 {
74  private:
76  using resource_id_type = std::pair<unsigned int, unsigned int>;
77 
79  std::map<resource_id_type, std::map<unsigned int, CustomOrderedSet<unsigned int>>> regs_in;
81  std::map<resource_id_type, std::map<unsigned int, CustomOrderedSet<unsigned int>>> chained_in;
83  std::map<resource_id_type, std::map<unsigned int, CustomOrderedSet<resource_id_type>>> module_in;
84 
87 
90 
92  unsigned int id;
93 
95  unsigned int cur_phi_tree_var;
96 
97  bool is_PC;
98 
101  {
102  i_assign = 0,
107  };
109  std::map<std::tuple<unsigned int, cacheType, const HLS_manager::io_binding_type>, generic_objRef> connCache;
110 
114  unsigned int mux_interconnection();
115 
125  unsigned int input_logic(const conn_binding::ConnectionSources& src, const generic_objRef tgt, unsigned int op,
126  unsigned int port_index, unsigned int iteration);
127 
131  void determine_connection(const vertex& op, const HLS_manager::io_binding_type& var, generic_objRef fu_obj,
132  unsigned int port_num, unsigned int port_index, const OpGraphConstRef data,
133  unsigned int precision, unsigned int alignment = 0);
134 
138  unsigned long long object_bitsize(const tree_managerRef TreeM, const HLS_manager::io_binding_type& obj) const;
139 
140  private:
144  void create_single_conn(const OpGraphConstRef data, const vertex& op, generic_objRef fu_obj_src,
145  generic_objRef fu_obj, unsigned int port_num, unsigned int port_index, unsigned int tree_var,
146  unsigned int precision, const bool is_not_a_phi);
147 
151  void connect_to_registers(vertex op, const OpGraphConstRef data, generic_objRef fu_obj, unsigned int port_num,
152  unsigned int port_index, unsigned int tree_var, unsigned long long precision,
153  const bool is_not_a_phi);
154 
155  unsigned int extract_parm_decl(unsigned int tree_var, const tree_managerRef TreeM);
156 
157  void add_conversion(unsigned int num, vertex op, unsigned int form_par_type, unsigned long long form_par_bitsize,
158  unsigned int port_index, const generic_objRef fu_obj, const OpGraphConstRef data,
159  const tree_managerRef TreeM, unsigned int tree_var);
160 
161  unsigned int address_precision(unsigned int precision, const vertex& op, const OpGraphConstRef data,
162  const tree_managerRef TreeM);
163 
164  bool isConstantObj(unsigned int tree_index, const tree_managerRef TreeM);
165 
166  public:
171  mux_connection_binding(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, unsigned int funId,
172  const DesignFlowManagerConstRef design_flow_manager);
173 
177  ~mux_connection_binding() override;
178 
184 
188  void Initialize() override;
189 
193  void create_connections();
194 };
195 #endif
Generic class managing interconnection binding algorithms.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
Data structure representing the entire HLS information.
CustomOrderedSet< vertex > noswap_computed_table
store the operations for which a port swapping is not beneficial
std::map< resource_id_type, std::map< unsigned int, CustomOrderedSet< unsigned int > > > regs_in
store the registers for each resource and for each port
unsigned long long object_bitsize(const tree_managerRef TreeM, const HLS_manager::io_binding_type &obj) const
Compute the bitsize given a io_binding type.
unsigned int id
variable used to assign a unique id to sparse logic
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
cacheType
cache connection type
unsigned int extract_parm_decl(unsigned int tree_var, const tree_managerRef TreeM)
DesignFlowStep_Status InternalExec() override
Execute the step.
std::map< std::tuple< unsigned int, cacheType, const HLS_manager::io_binding_type >, generic_objRef > connCache
connection cache
void determine_connection(const vertex &op, const HLS_manager::io_binding_type &var, generic_objRef fu_obj, unsigned int port_num, unsigned int port_index, const OpGraphConstRef data, unsigned int precision, unsigned int alignment=0)
Determine the actual interconnection.
bool isConstantObj(unsigned int tree_index, const tree_managerRef TreeM)
std::tuple< unsigned int, unsigned int > io_binding_type
tuple set used to represent the required values or the constant default value associated with the inp...
Base class for all interconnection binding algorithms.
void create_connections()
Creates the connections inside the architecture.
Class used to describe a state transition graph.
Data structure used to store the interconnection binding of datapath elements.
unsigned int address_precision(unsigned int precision, const vertex &op, const OpGraphConstRef data, const tree_managerRef TreeM)
Class managing the interconnection binding.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
This file contains the structures needed to manage a graph that will represent the state transition g...
General class used to describe a graph in PandA.
Definition: graph.hpp:771
CONSTREF_FORWARD_DECL(OpGraph)
DesignFlowStep_Status
The status of a step.
std::map< resource_id_type, std::map< unsigned int, CustomOrderedSet< unsigned int > > > chained_in
store the chained storage values for each resource and for each port
REF_FORWARD_DECL(graph)
std::map< generic_objRef, CustomOrderedSet< data_transfer >, GenericObjSorter > ConnectionSources
definition of sources of a connection
void create_single_conn(const OpGraphConstRef data, const vertex &op, generic_objRef fu_obj_src, generic_objRef fu_obj, unsigned int port_num, unsigned int port_index, unsigned int tree_var, unsigned int precision, const bool is_not_a_phi)
create the connection object and update the unique table
CustomOrderedSet< vertex > swap_computed_table
store the operations for which a port swapping is beneficial
void add_conversion(unsigned int num, vertex op, unsigned int form_par_type, unsigned long long form_par_bitsize, unsigned int port_index, const generic_objRef fu_obj, const OpGraphConstRef data, const tree_managerRef TreeM, unsigned int tree_var)
std::pair< unsigned int, unsigned int > resource_id_type
type representing a resource identifier
std::map< resource_id_type, std::map< unsigned int, CustomOrderedSet< resource_id_type > > > module_in
store the resource in IN for each resource and for each port
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
Class used to describe a particular graph with operations as nodes.
Definition: op_graph.hpp:783
mux_connection_binding(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager)
Main constructor.
Class managing the connection binding of datapath.
void connect_to_registers(vertex op, const OpGraphConstRef data, generic_objRef fu_obj, unsigned int port_num, unsigned int port_index, unsigned int tree_var, unsigned long long precision, const bool is_not_a_phi)
connect the fu_obj with the associated registers.
unsigned int cur_phi_tree_var
store the current phi use. Used during the analysis of phi nodes
unsigned int input_logic(const conn_binding::ConnectionSources &src, const generic_objRef tgt, unsigned int op, unsigned int port_index, unsigned int iteration)
Computes logic for inputs.
~mux_connection_binding() override
Destructor.
unsigned int mux_interconnection()
Performs specialization of interconnections using mux architecture.

Generated on Mon Feb 12 2024 13:02:53 for PandA-2024.02 by doxygen 1.8.13