PandA-2024.02
technology_manager.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  */
42 #ifndef TECHNOLOGY_MANAGER_HPP
43 #define TECHNOLOGY_MANAGER_HPP
44 
46 #include "config_HAVE_CIRCUIT_BUILT.hpp"
47 
48 #include "custom_map.hpp"
49 #include "custom_set.hpp"
50 #include "refcount.hpp"
51 #include "strong_typedef.hpp"
52 
53 #include <ostream>
54 #include <string>
55 #include <vector>
56 
58 #define DESIGN std::string("design")
59 #define WORK_LIBRARY std::string("work")
61 #define OPENMP_LIBRARY std::string("OpenMP_library")
63 #define PROXY_LIBRARY std::string("proxy_library")
65 #define INTERFACE_LIBRARY std::string("interface_library")
67 #define LIBRARY_STD std::string("STD")
69 #define LIBRARY_STD_FU std::string("STD_FU")
71 #define CG_LIBRARY std::string("CG")
73 #define LIBRARY_PC std::string("STD_PC")
75 #define LIBRARY_STD_DATAFLOW std::string("STD_DATAFLOW")
77 
95 class xml_element;
96 class allocation;
97 class mixed_hls;
98 struct TimeStamp;
100 class functional_unit;
101 
103 
108 {
109  public:
114  const static unsigned int XML;
116 
119 
120  private:
123 
126 
129 
131  std::vector<std::string> libraries;
132 
135 
138 
143  const functional_unit* CGetSetupHoldFU() const;
144 
145  public:
150  explicit technology_manager(const ParameterConstRef Param);
152 
156 
157  private:
159  friend class allocation;
160 
161  public:
170  void add(const technology_nodeRef curr, const std::string& Library);
171 
172 #if HAVE_CIRCUIT_BUILT
173 
177  void add_resource(const std::string& Library, const std::string& fu_name,
178  const structural_managerRef CM = structural_managerRef(), const bool is_builtin = false);
179 #endif
180 
184  technology_nodeRef add_operation(const std::string& Library, const std::string& fu_name,
185  const std::string& operation_name);
186 
188 
193 
198  const std::vector<std::string>& get_library_list() const
199  {
200  return libraries;
201  }
202 
210  bool can_implement(const std::string& fu_name, const std::string& op_name, const std::string& Library) const;
211 
218  technology_nodeRef get_fu(const std::string& fu_name, const std::string& Library) const;
219 
226  technology_nodeRef get_fu(const std::string& fu_name, std::string* Library = nullptr) const;
227 
233  std::string get_library(const std::string& Name) const;
234 
239  void erase_library(const std::string& Name);
240 
246  bool is_library_manager(const std::string& Name) const;
247 
253  library_managerRef get_library_manager(const std::string& Name) const;
254 
263  ControlStep get_initiation_time(const std::string& fu_name, const std::string& op_name,
264  const std::string& Library) const;
265 
274  double get_execution_time(const std::string& fu_name, const std::string& op_name, const std::string& Library) const;
275 
282  double get_area(const std::string& fu_name, const std::string& Library) const;
283 
289  bool IsBuiltin(const std::string& component_name) const;
290 
292 
301  void xload(const xml_element* node);
302 
308 
313 
317  void print(std::ostream& os) const;
321  friend std::ostream& operator<<(std::ostream& os, const technology_manager& s)
322  {
323  s.print(os);
324  return os;
325  }
329  friend std::ostream& operator<<(std::ostream& os, const technology_managerRef& s)
330  {
331  if(s)
332  {
333  s->print(os);
334  }
335  return os;
336  }
338 
343  double CGetSetupHoldTime() const;
344 
350 
356  technology_nodeRef GetFunctionFU(const std::string& fname) const;
357 };
358 
360 
361 #endif
friend std::ostream & operator<<(std::ostream &os, const technology_managerRef &s)
Friend definition of the << operator.
double CGetSetupHoldTime() const
Return the setup hold time.
CONSTREF_FORWARD_DECL(Parameter)
RefCount type definition of the Parameter class structure.
technology_nodeRef get_fu(const std::string &fu_name, const std::string &Library) const
Return the reference to a component given its name.
void xwrite(xml_element *rootnode, const CustomOrderedSet< std::string > &libraries=CustomOrderedSet< std::string >())
add library elements operation node to an xml tree.
void print(std::ostream &os) const
Function that prints the class technology_manager.
const ParameterConstRef Param
class containing all the parameters
const std::vector< std::string > & get_library_list() const
Return the list of the libraries.
This class manages the circuit structures.
~technology_manager()
Destructor.
CustomUnorderedMap< std::string, library_managerRef > library_map_type
definition of the type for identifying the libraries
This class specifies the characteristic of a particular functional unit.
void xload(const xml_element *node)
Load a technology manager from an xml file.
redefinition of map to manage ordered/unordered structures
technology_nodeRef add_operation(const std::string &Library, const std::string &fu_name, const std::string &operation_name)
Add an operation to the specified functional unit.
technology_manager(const ParameterConstRef Param)
Constructor.
static const unsigned int XML
CustomSet< std::string > builtins
The builtin components.
double get_area(const std::string &fu_name, const std::string &Library) const
Return the area for a given component.
void add(const technology_nodeRef curr, const std::string &Library)
Add the given functional_unit to the specified library.
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Definition: custom_map.hpp:148
This class manages the technology library structures.
int debug_level
The debug level for this class.
ControlStep get_initiation_time(const std::string &fu_name, const std::string &op_name, const std::string &Library) const
Return the initiation time for a given operation type and a given component.
redefinition of set to manage ordered/unordered structures
This class macros for the definition of strong typedef.
bool IsBuiltin(const std::string &component_name) const
Return true if a component is builtin.
This wrapper collects all the methods used by the High-level synthesis classes to retrieve informatio...
Definition: allocation.hpp:102
refcount< structural_manager > structural_managerRef
RefCount type definition of the structural_manager class structure.
UINT_STRONG_TYPEDEF_FORWARD_DECL(ControlStep)
bool is_library_manager(const std::string &Name) const
Check if a library is contained into the data structure.
Template definition of refcount.
library_map_type library_map
map between library name and the corresponding data structure
const functional_unit * CGetSetupHoldFU() const
Return the functional unit used to compute the setup hold time.
Very simple pretty printer functor.
std::vector< std::string > libraries
(reverse) ordered list of libraries; it gives a priority ordering for searching the nodes ...
This class manages the specific library structure.
REF_FORWARD_DECL(library_manager)
RefCount type definition of the library_manager class structure for representing libraries.
CustomUnorderedMap< std::string, technology_nodeRef > function_fu
Map function names to hardware module used for implementation.
void erase_library(const std::string &Name)
Release the given library.
TimeStamp CGetSetupHoldTimeStamp() const
Return the characterization timestamp of the setup hold time.
technology_nodeRef GetFunctionFU(const std::string &fname) const
Return FU used to implement given function if any.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
The type used for timestamp.
Definition: utility.hpp:280
bool can_implement(const std::string &fu_name, const std::string &op_name, const std::string &Library) const
Check if an operation can be implemented by a given component in a given library. ...
Abstract pure class for the technology structure.
double get_execution_time(const std::string &fu_name, const std::string &op_name, const std::string &Library) const
Return the execution time for a given operation type and a given component.
library_managerRef get_library_manager(const std::string &Name) const
Return the library data structure corresponding to the given library id.
std::string get_library(const std::string &Name) const
Return the higher priority library where the given component is stored.
friend std::ostream & operator<<(std::ostream &os, const technology_manager &s)
Friend definition of the << operator.

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