PandA-2024.02
hls_step.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  */
43 #ifndef HLS_STEP_HPP
44 #define HLS_STEP_HPP
45 
47 #include "config_HAVE_FROM_PRAGMA_BUILT.hpp"
48 #include "config_HAVE_ILP_BUILT.hpp"
49 #include "config_HAVE_LIBRARY_CHARACTERIZATION_BUILT.hpp"
50 #include "config_HAVE_SIMULATION_WRAPPER_BUILT.hpp"
51 #include "config_HAVE_TASTE.hpp"
52 #include "config_HAVE_VCD_BUILT.hpp"
53 
55 #include "design_flow_step.hpp"
56 
58 #include <string>
59 
61 #include "custom_map.hpp"
62 
64 #include "refcount.hpp"
65 
70 class xml_element;
71 
76 {
77  public:
79 
81 
85  virtual std::string GetKindText() const = 0;
86 
90  virtual std::string GetSignature() const = 0;
91 };
94 
95 enum class HLSFlowStep_Type
96 {
97  UNKNOWN = 0,
99  ALLOCATION,
117  EVALUATION,
121  GENERATE_HDL,
124 #if HAVE_TASTE
125  GENERATE_TASTE_HDL_ARCHITECTURE,
126  GENERATE_TASTE_SYNTHESIS_SCRIPT,
127 #endif
138 #if HAVE_FROM_PRAGMA_BUILT
139  OMP_ALLOCATION,
140 #endif
141 #if HAVE_FROM_PRAGMA_BUILT
142 #endif
144 #if HAVE_FROM_PRAGMA_BUILT
145  OMP_FOR_WRAPPER_CS_SYNTHESIS_FLOW,
146 #endif
147 #if HAVE_FROM_PRAGMA_BUILT
148  OMP_FUNCTION_ALLOCATION,
149 #endif
150 #if HAVE_FROM_PRAGMA_BUILT
151  OMP_FUNCTION_ALLOCATION_CS,
152 #endif
156 #if HAVE_ILP_BUILT
157  SDC_SCHEDULING,
158 #endif
159 #if HAVE_SIMULATION_WRAPPER_BUILT
160  SIMULATION_EVALUATION,
161 #endif
163 #if HAVE_LIBRARY_CHARACTERIZATION_BUILT
164  SYNTHESIS_EVALUATION,
165 #endif
166 #if HAVE_TASTE
167  TASTE_INTERFACE_GENERATION,
168 #endif
178 #if HAVE_VCD_BUILT
179  VCD_SIGNAL_SELECTION,
180  VCD_UTILITY,
181 #endif
187 };
188 
190 {
194  TOP_FUNCTION,
196 };
197 
198 class HLS_step : public DesignFlowStep
199 {
200  protected:
203 
206 
209 
212 
217  virtual const CustomUnorderedSet<
218  std::tuple<HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship>>
219  ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const;
220 
221  public:
229  HLS_step(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr,
230  const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type,
231  const HLSFlowStepSpecializationConstRef hls_flow_step_specialization = HLSFlowStepSpecializationConstRef());
232 
236  ~HLS_step() override;
237 
242  std::string GetSignature() const override;
243 
248  std::string GetName() const override;
249 
253  virtual std::string GetKindText() const;
254 
260  static std::string EnumToName(const HLSFlowStep_Type hls_flow_step_type);
261 
265  DesignFlowStepFactoryConstRef CGetDesignFlowStepFactory() const final;
266 
272  void ComputeRelationships(DesignFlowStepSet& design_flow_step_set,
273  const DesignFlowStep::RelationshipType relationship_type) override;
274 
281  static const std::string ComputeSignature(const HLSFlowStep_Type hls_flow_step_type,
282  const HLSFlowStepSpecializationConstRef hls_flow_step_specialization);
283 };
286 
290 namespace std
291 {
292  template <>
293  struct hash<HLSFlowStep_Type> : public unary_function<HLSFlowStep_Type, size_t>
294  {
295  size_t operator()(HLSFlowStep_Type step) const
296  {
297  hash<int> hasher;
298  return hasher(static_cast<int>(step));
299  }
300  };
301 } // namespace std
302 
307 namespace std
308 {
309  template <>
310  struct hash<std::tuple<HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship>>
311  : public unary_function<
312  std::tuple<HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship>, size_t>
313  {
314  size_t
315  operator()(std::tuple<HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship> step) const
316  {
317  std::size_t ret = 0;
318  hash<int> hasher;
319  boost::hash_combine(ret, hasher(static_cast<int>(std::get<0>(step))));
320  boost::hash_combine(ret, std::get<1>(step));
321  boost::hash_combine(ret, hasher(static_cast<int>(std::get<2>(step))));
322  return ret;
323  }
324  };
325 } // namespace std
326 
330 namespace std
331 {
332  template <>
333  struct hash<std::pair<HLSFlowStep_Type, HLSFlowStepSpecializationConstRef>>
334  : public unary_function<std::tuple<HLSFlowStep_Type, HLSFlowStepSpecializationConstRef>, size_t>
335  {
336  size_t operator()(std::pair<HLSFlowStep_Type, HLSFlowStepSpecializationConstRef> step) const
337  {
338  std::size_t ret = 0;
339  hash<int> hasher;
340  boost::hash_combine(ret, hasher(static_cast<int>(step.first)));
341  boost::hash_combine(ret, step.second);
342  return ret;
343  }
344  };
345 } // namespace std
346 
347 #endif
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
virtual std::string GetKindText() const =0
Return the string representation of this.
RelationshipType
The relationship type.
The base class for design step.
size_t operator()(std::pair< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef > step) const
Definition: hls_step.hpp:336
HLSFlowStep_Relationship
Definition: hls_step.hpp:189
Definition of hash function for EdgeDescriptor.
Definition: graph.hpp:1321
const HLSFlowStep_Type hls_flow_step_type
The type of this step.
Definition: hls_step.hpp:208
redefinition of map to manage ordered/unordered structures
virtual std::string GetSignature() const =0
Return the contribution to the signature of a step given by the specialization.
Abstract class containing information about specialization of the single steps.
Definition: hls_step.hpp:75
Base class for step of design flow.
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Definition: custom_map.hpp:148
HLSFlowStep_Type
Definition: hls_step.hpp:95
CONSTREF_FORWARD_DECL(Parameter)
Autoheader include.
HLSFlowStepSpecialization()
header include
Template definition of refcount.
size_t operator()(HLSFlowStep_Type step) const
Definition: hls_step.hpp:295
REF_FORWARD_DECL(hls)
unsigned int size_t
Definition: test.c:1
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
Data structure that contains all information about high level synthesis process.
Definition: hls.hpp:83
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
Definition: hls_step.hpp:93
virtual ~HLSFlowStepSpecialization()
size_t operator()(std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > step) const
Definition: hls_step.hpp:315
static CustomUnorderedMap< std::string, HLSFlowStep_Type > command_line_name_to_enum
Map hls step name to enum.
Definition: hls_step.hpp:202
const HLSFlowStepSpecializationConstRef hls_flow_step_specialization
The information about specialization.
Definition: hls_step.hpp:211

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