PandA-2024.02
allocation.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  */
56 #ifndef ALLOCATION_HPP
57 #define ALLOCATION_HPP
58 
59 #include "design_flow_step.hpp" // for DesignFlowManagerConstRef, Design...
60 #include "hls_function_step.hpp" // for HLSFunctionStep
61 #include "hls_manager.hpp" // for HLS_manager, HLS_manager::io_bind...
62 #include "hls_step.hpp" // for HLSFlowStep_Type, HLSFlowStep_Typ...
63 #include "refcount.hpp" // for REF_FORWARD_DECL, CONSTREF_FORWAR...
64 #include <string> // for string
65 
81 struct functional_unit;
82 struct operation;
84 
90 {
91  MIN,
92  MAX
93 };
94 
103 {
104  protected:
108 
110  std::map<std::string, std::string> precomputed_pipeline_unit;
111 
112  std::map<technology_nodeRef, std::map<unsigned long long, std::map<HLS_manager::io_binding_type, unsigned int>>>
114 
117 
120 
125  technology_nodeRef get_fu(const std::string& fu_name);
126 
131  std::string get_compliant_pipelined_unit(double clock, const std::string& pipe_parameter,
132  const technology_nodeRef current_fu, const std::string& curr_op,
133  const std::string& library_name, const std::string& template_suffix,
134  unsigned long long module_prec);
135 
136  technology_nodeRef extract_bambu_provided(const std::string& library_name, operation* curr_op,
137  const std::string& bambu_provided_resource_);
138 
144  void set_number_channels(unsigned int fu_name, unsigned int n_ports);
145 
146  double get_execution_time_dsp_modified(const unsigned int fu_name, const technology_nodeRef& node_op) const;
147 
148  double get_stage_period_dsp_modified(const unsigned int fu_name, const technology_nodeRef& node_op) const;
149 
153  void add_proxy_function_module(const HLS_constraintsRef HLS_C, technology_nodeRef techNode_obj,
154  const std::string& orig_fun_name);
155 
159  void add_proxy_function_wrapper(const std::string& library_name, technology_nodeRef techNode_obj,
160  const std::string& orig_fun_name);
161 
165  void BuildProxyWrapper(functional_unit* current_fu, const std::string& orig_fun_name,
166  const std::string& orig_library_name);
167 
171  void BuildProxyFunctionVerilog(functional_unit* current_fu);
172 
176  void BuildProxyFunctionVHDL(functional_unit* current_fu);
177 
181  void BuildProxyFunction(functional_unit* current_fu);
182 
183  void add_tech_constraint(technology_nodeRef cur_fu, unsigned int tech_constrain_value, unsigned int pos,
184  bool proxy_constrained);
185  void add_resource_to_fu_list(std::string channels_type, const OpGraphConstRef g, technology_nodeRef current_fu,
186  CustomOrderedSet<vertex> vertex_analysed, node_kind_prec_infoRef node_info,
187  unsigned int current_id, CustomOrderedSet<vertex>::const_iterator vert,
188  const std::vector<std::string>& libraries, bool isMemory,
189  std::string bambu_provided_resource, operation* curr_op, std::string specialized_fuName,
190  bool predicate_2, std::string current_op, HLS_manager::io_binding_type constant_id,
191  bool varargs_fu, unsigned int l, std::string memory_ctrl_type,
192  std::map<std::string, technology_nodeRef> new_fu, unsigned int tech_constrain_value);
193  bool check_templated_units(double clock_period, node_kind_prec_infoRef node_info, const library_managerRef library,
194  technology_nodeRef current_fu, operation* curr_op);
195  bool check_for_memory_compliancy(bool Has_extern_allocated_data, technology_nodeRef current_fu,
196  const std::string& memory_ctrl_type, const std::string& channels_type);
197  bool check_type_and_precision(operation* curr_op, node_kind_prec_infoRef node_info);
198  bool check_proxies(const library_managerRef library, const std::string& fu_name_);
199  bool check_generated_bambu_flopoco(bool skip_softfloat_resources, structural_managerRef structManager_obj,
200  std::string& bambu_provided_resource, bool skip_flopoco_resources,
201  technology_nodeRef current_fu);
202  bool is_ram_not_timing_compliant(const HLS_constraintsRef HLS_C, unsigned int var, technology_nodeRef current_fu);
203  std::string get_synch_ram_latency(const std::string& ram_template, const std::string& latency_postfix,
204  const HLS_constraintsRef HLS_C, unsigned int var);
205 
209  virtual void IntegrateTechnologyLibraries();
210 
216  ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override;
217 
218  void ComputeRelationships(DesignFlowStepSet& relationship,
219  const DesignFlowStep::RelationshipType relationship_type) override;
220 
221  public:
230  allocation(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, unsigned int funId,
231  const DesignFlowManagerConstRef design_flow_manager,
233 
237  ~allocation() override;
239 
244  DesignFlowStep_Status InternalExec() override;
245 
249  void Initialize() override;
250 
254  void PrintInitialIR() const override;
255 };
256 #endif
Data structure representing the entire HLS information.
This structure collect the information of input and output precision of nodes and the node kind...
RelationshipType
The relationship type.
This class manages the circuit structures.
CONSTREF_FORWARD_DECL(OpGraph)
Allocation_MinMax
Definition: allocation.hpp:89
This class specifies the characteristic of a particular functional unit.
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...
std::map< std::string, std::string > precomputed_pipeline_unit
store the precomputed pipeline unit: given a functional unit it return the pipeline id compliant ...
Definition: allocation.hpp:110
REF_FORWARD_DECL(AllocationInformation)
Base class for step of design flow.
This class specifies the characteristic of a particular operation working on a given functional unit...
std::map< technology_nodeRef, std::map< unsigned long long, std::map< HLS_manager::io_binding_type, unsigned int > > > fu_list
Definition: allocation.hpp:113
HLSFlowStep_Type
Definition: hls_step.hpp:95
This class manages the technology library structures.
Data structure used to store all the HLS constraints.
General class used to describe a graph in PandA.
Definition: graph.hpp:771
AllocationInformationRef allocation_information
The allocation solution.
Definition: allocation.hpp:106
DesignFlowStep_Status
The status of a step.
This wrapper collects all the methods used by the High-level synthesis classes to retrieve informatio...
Definition: allocation.hpp:102
Template definition of refcount.
This class manages the specific library structure.
technology_managerRef TechM
The technology manager.
Definition: allocation.hpp:119
constraint functor used by get_attribute_of_fu_per_op
Class used to describe a particular graph with operations as nodes.
Definition: op_graph.hpp:783
HLS_deviceRef HLS_D
The HLS target.
Definition: allocation.hpp:116
Superclass include.
Abstract pure class for the technology structure.

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