PandA-2024.02
BackendFlow.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 _BACKEND_FLOW_HPP_
43 #define _BACKEND_FLOW_HPP_
44 
45 #include "config_HAVE_SIMULATION_WRAPPER_BUILT.hpp"
46 #include "config_HAVE_TASTE.hpp"
47 
48 #include <list>
49 
50 #include "refcount.hpp"
56 REF_FORWARD_DECL(Design_manager);
64 class xml_element;
66 
67 #include "custom_set.hpp"
68 #include <string>
69 #include <vector>
70 
72 {
74  std::string name;
75 
77  std::string config_name;
78 
80  std::string script_name;
81 
84 
86  std::string out_dir;
87 };
89 
91 {
92  public:
94  using type_t = enum {
95  UNKNOWN,
96  XILINX_FPGA,
97 #if HAVE_TASTE
98  XILINX_TASTE_FPGA,
99 #endif
100  ALTERA_FPGA,
101  LATTICE_FPGA,
102  NANOXPLORE_FPGA,
103  GENERIC,
104  };
105 
106  protected:
109 
112 
114  unsigned int output_level;
115 
117  std::string flow_name;
118 
120  std::string out_dir;
121 
123  std::map<std::string, std::string> default_data;
124 
127 
130 
133 
136 
138  std::vector<BackendStepRef> steps;
139 
142 
145 
148 
151 
156  void ParseBackendFlow(const std::string& flow_name);
157 
161  void xload(const xml_element* node);
162 
166  virtual void WriteFlowConfiguration(std::ostream& script) = 0;
167 
171  virtual void CheckSynthesisResults() = 0;
172 
173  public:
180  BackendFlow(const ParameterConstRef Param, std::string flow_name, const generic_deviceRef _device);
181 
185  virtual ~BackendFlow();
186 
190  static BackendFlowRef CreateFlow(const ParameterConstRef Param, const std::string& flow_name,
191  const generic_deviceRef _device);
192 
196  static type_t DetermineBackendFlowType(const generic_deviceRef device, const ParameterConstRef parameters);
197 
201  virtual std::string GenerateSynthesisScripts(const std::string& fu_name, const structural_managerRef SM,
202  const std::list<std::string>& hdl_files,
203  const std::list<std::string>& aux_files);
204 
208  virtual void ExecuteSynthesis();
209 
213  void Execute(const std::string& top_id, const std::string& top_normalized, const std::string& filestring,
214  const std::string& filename_bench, const std::string& clock, double clk_period, bool syntax_check);
215 
219  std::string CreateScripts(const DesignParametersRef dp);
220 
224  virtual void InitDesignParameters();
225 
230  void parse_flow(const XMLDomParserRef parser);
231 
235  void create_xml_scripts(const std::string& xml_file);
236 
241  void add_backend_step(const BackendStepRef& step);
242 
246  std::string get_flow_name() const;
247 
251  void set_initial_parameters(const DesignParametersRef& flow_parameters,
252  const CustomOrderedSet<std::string>& undefined_parameters);
253 
257  void set_parameters(const DesignParametersRef& _flow_parameters);
258 
262  area_infoRef get_used_resources() const;
263 
267  time_infoRef get_timing_results() const;
268 };
271 
272 #endif
generic device description
area_infoRef area_m
pointer to the data structure containing information about the resources
DesignParametersRef actual_parameters
set of design parameters with the actual values
This class manages the circuit structures.
CustomOrderedSet< std::string > undefined_parameters
list of undefined parameters
std::string flow_name
string-based identifier of the flow
time_infoRef time_m
pointer to the data structure containing timing information
const generic_deviceRef device
information about the target device
int debug_level
debugging level of the class
std::vector< BackendStepRef > steps
ordered list of synthesis steps
xml_element * root
root node of the configuration device
redefinition of set to manage ordered/unordered structures
std::string config_name
configuration identifier
Definition: BackendFlow.hpp:77
XML DOM parser.
std::string script_name
name of the step
Definition: BackendFlow.hpp:80
const ParameterConstRef Param
class containing all the parameters
std::map< std::string, std::string > default_data
map between the identifiers of the synthesis flows and the corresponding implementations ...
std::string out_dir
name of the output directory
Template definition of refcount.
REF_FORWARD_DECL(SynthesisTool)
unsigned int output_level
verbosity level of the class
std::string generated_synthesis_script
name of the synthesis script
std::string out_dir
output directory
Definition: BackendFlow.hpp:86
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
HDL writer base class used to specify the interface of the different language writers.
DesignParametersRef default_flow_parameters
set of design parameters to be set
enum { UNKNOWN, XILINX_FPGA, ALTERA_FPGA, LATTICE_FPGA, NANOXPLORE_FPGA, GENERIC, } type_t
implemented flow
SynthesisToolRef tool
wrapper to the tool
Definition: BackendFlow.hpp:83
std::string name
name of the step
Definition: BackendFlow.hpp:74
Abstract pure class for the technology structure.
CONSTREF_FORWARD_DECL(Parameter)

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