PandA-2024.02
functional_unit_step.cpp
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) 2015-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  */
41 #include "functional_unit_step.hpp"
43 #include "area_info.hpp"
44 #include "config_HAVE_FLOPOCO.hpp"
45 #include "custom_map.hpp"
46 #include "custom_set.hpp"
47 #include "dbgPrintHelper.hpp" // for DEBUG_LEVEL_
48 #include "generic_device.hpp"
49 #include "library_manager.hpp"
50 #include "math_function.hpp"
51 #include "schedule.hpp"
52 #include "string_manipulation.hpp"
53 #include "structural_manager.hpp"
54 #include "structural_objects.hpp"
55 #include "technology_manager.hpp"
56 #include "technology_node.hpp"
57 #include "time_info.hpp"
58 #include <boost/algorithm/string/case_conv.hpp>
59 #include <string>
60 #include <vector>
61 
63  const DesignFlowManagerConstRef _design_flow_manager,
64  const ParameterConstRef _parameters)
65  : DesignFlowStep(_design_flow_manager, _parameters),
66  TM(_device->get_technology_manager()),
67  device(_device),
68  has_first_synthesis_id(0)
69 {
70 }
71 
73 
75 {
76  const auto LM = TM->get_library(f_unit->get_name());
77 
78  bool is_commutative = true;
79 
81  std::map<unsigned int, std::vector<std::string>> pipe_parameters;
82  std::map<unsigned int, std::vector<std::string>> portsize_parameters;
83  auto* fu_curr = GetPointer<functional_unit>(f_unit);
84  if(fu_curr && fu_curr->fu_template_name != "")
85  {
86  return;
87  }
88  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "-->Analyzing " + f_unit->get_name());
89  bool isTemplate = false;
90  bool no_constants = false;
91  if(!fu_curr && GetPointer<functional_unit_template>(f_unit))
92  {
93  fu_curr = GetPointer<functional_unit>(GetPointer<functional_unit_template>(f_unit)->FU);
94  isTemplate = true;
95  no_constants = GetPointer<functional_unit_template>(f_unit)->no_constant_characterization;
96  }
97  THROW_ASSERT(fu_curr, "unexpected condition");
98  std::string fu_name = fu_curr->functional_unit_name;
99  std::string fu_base_name = fu_name;
100  const functional_unit::operation_vec& Ops = fu_curr->get_operations();
101  auto ops_end = Ops.end();
102  if(fu_base_name == READ_COND_STD)
103  {
104  precision.insert(1);
105  }
106  else
107  {
108  for(auto ops = Ops.begin(); ops != ops_end; ++ops)
109  {
110  auto* curr_op = GetPointer<operation>(*ops);
111  is_commutative = is_commutative && curr_op->commutative;
112  auto supported_type_it_end = curr_op->supported_types.end();
113  if(curr_op->supported_types.begin() == curr_op->supported_types.end())
114  {
115  if(isTemplate)
116  {
117  precision.insert(1);
118  precision.insert(8);
119  precision.insert(16);
120  precision.insert(64);
121  }
122  precision.insert(32);
123  }
124  else
125  {
126  for(auto supported_type_it = curr_op->supported_types.begin(); supported_type_it != supported_type_it_end;
127  ++supported_type_it)
128  {
129  auto prec_it_end = supported_type_it->second.end();
130  auto prec_it = supported_type_it->second.begin();
131  if(prec_it == prec_it_end)
132  {
133  if(isTemplate)
134  {
135  precision.insert(1);
136  precision.insert(8);
137  precision.insert(16);
138  precision.insert(64);
139  }
140  precision.insert(32);
141  }
142  else
143  {
144  for(; prec_it != prec_it_end; ++prec_it)
145  {
146  precision.insert(*prec_it);
147  }
148  }
149  }
150  }
151  std::string pipe_parameters_str = curr_op->pipe_parameters;
152 
153  if(pipe_parameters_str != "")
154  {
155  std::vector<std::string> parameters_split = SplitString(pipe_parameters_str, "|");
156  const auto pp_it_end = parameters_split.end();
157  for(auto pp_it = parameters_split.begin(); pp_it != pp_it_end; ++pp_it)
158  {
159  std::vector<std::string> precision_pipe_param_pair = SplitString(*pp_it, ":");
160  THROW_ASSERT(precision_pipe_param_pair.size() == 2, "malformed pipe parameter string");
161  std::vector<std::string> pipe_params = SplitString(precision_pipe_param_pair[1], ",");
162  THROW_ASSERT(pipe_params.size() > 0, "malformed pipe parameter string");
163  if(precision_pipe_param_pair[0] == "*")
164  {
165  for(unsigned int prec : precision)
166  {
167  for(const auto& pipe_param : pipe_params)
168  {
169  if(std::find(pipe_parameters[prec].begin(), pipe_parameters[prec].end(), pipe_param) ==
170  pipe_parameters[prec].end())
171  {
172  pipe_parameters[prec].push_back(pipe_param);
173  }
174  }
175  }
176  }
177  else if(precision_pipe_param_pair[0] == "DSPs_y_sizes")
178  {
179  for(const auto& DSP_y : DSP_y_to_DSP_x)
180  {
181  for(const auto& pipe_param : pipe_params)
182  {
183  pipe_parameters[DSP_y.first].push_back(pipe_param);
184  precision.insert(DSP_y.first);
185  }
186  }
187  }
188  else if(precision.find(static_cast<unsigned>(std::stoul(precision_pipe_param_pair[0]))) !=
189  precision.end())
190  {
191  for(const auto& pipe_param : pipe_params)
192  {
193  if(std::find(
194  pipe_parameters[static_cast<unsigned>(std::stoul(precision_pipe_param_pair[0]))].begin(),
195  pipe_parameters[static_cast<unsigned>(std::stoul(precision_pipe_param_pair[0]))].end(),
196  pipe_param) ==
197  pipe_parameters[static_cast<unsigned>(std::stoul(precision_pipe_param_pair[0]))].end())
198  {
199  pipe_parameters[static_cast<unsigned>(std::stoul(precision_pipe_param_pair[0]))].push_back(
200  pipe_param);
201  }
202  }
203  }
204  else
205  {
206  THROW_ERROR("malformed pipe parameter string");
207  }
208  }
209  }
210  std::string portsize_parameters_str = curr_op->portsize_parameters;
211  if(portsize_parameters_str != "")
212  {
213  std::vector<std::string> parameters_split = SplitString(portsize_parameters_str, "|");
214  const auto pp_it_end = parameters_split.end();
215  for(auto pp_it = parameters_split.begin(); pp_it != pp_it_end; ++pp_it)
216  {
217  std::vector<std::string> precision_portsize_param_pair = SplitString(*pp_it, ":");
218  THROW_ASSERT(precision_portsize_param_pair.size() == 2, "malformed portsize parameter string");
219  std::vector<std::string> portsize_params = SplitString(precision_portsize_param_pair[1], ",");
220  THROW_ASSERT(portsize_params.size() > 0, "malformed portsize parameter string");
221  if(precision_portsize_param_pair[0] == "*")
222  {
223  for(unsigned int prec : precision)
224  {
225  for(const auto& portsize_param : portsize_params)
226  {
227  if(std::find(portsize_parameters[prec].begin(), portsize_parameters[prec].end(),
228  portsize_param) == portsize_parameters[prec].end())
229  {
230  portsize_parameters[prec].push_back(portsize_param);
231  }
232  }
233  }
234  }
235  else if(precision.find(static_cast<unsigned>(std::stoul(precision_portsize_param_pair[0]))) !=
236  precision.end())
237  {
238  for(const auto& portsize_param : portsize_params)
239  {
240  if(std::find(
241  portsize_parameters[static_cast<unsigned>(std::stoul(precision_portsize_param_pair[0]))]
242  .begin(),
243  portsize_parameters[static_cast<unsigned>(std::stoul(precision_portsize_param_pair[0]))]
244  .end(),
245  portsize_param) ==
246  portsize_parameters[static_cast<unsigned>(std::stoul(precision_portsize_param_pair[0]))].end())
247  {
248  portsize_parameters[static_cast<unsigned>(std::stoul(precision_portsize_param_pair[0]))]
249  .push_back(portsize_param);
250  }
251  }
252  }
253  else
254  {
255  THROW_ERROR("malformed portsize parameter string");
256  }
257  }
258  }
259  }
260  }
261 
262  if(Ops.begin() == Ops.end())
263  {
264  is_commutative = false;
265  }
266 
267  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Computed parameters");
268 
269  for(unsigned int prec : precision)
270  {
271  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "-->Considering precision " + STR(prec) + " bits");
272  if(fu_curr->CM)
273  {
274  const structural_objectRef obj = fu_curr->CM->get_circ();
275  NP_functionalityRef NPF = GetPointer<module>(obj)->get_NP_functionality();
276  size_t max_lut_size = 0;
277  if(device->has_parameter("max_lut_size"))
278  {
279  max_lut_size = device->get_parameter<size_t>("max_lut_size");
280  }
281 #if HAVE_FLOPOCO
282  std::string vendor;
283  if(device->has_parameter("vendor"))
284  {
285  vendor = device->get_parameter<std::string>("vendor");
286  boost::algorithm::to_lower(vendor);
287  }
288  bool is_xilinx = vendor == "xilinx";
289  bool is_lattice = vendor == "lattice";
290  bool is_altera = vendor == "altera";
291  bool is_nanoxplore = vendor == "nanoxplore";
292 #endif
293 
295 #if HAVE_FLOPOCO
297  (is_xilinx || is_altera || is_lattice || is_nanoxplore))
298 #endif
301  fu_base_name == LUT_GATE_STD || fu_base_name == AND_GATE_STD || fu_base_name == NAND_GATE_STD ||
302  fu_base_name == OR_GATE_STD || fu_base_name == NOR_GATE_STD || fu_base_name == XOR_GATE_STD ||
303  fu_base_name == XNOR_GATE_STD || fu_base_name == "split_signal" || fu_base_name == "FSL_handler" ||
304  fu_base_name == "extract_bit_expr_FU"
305  //|| fu_base_name != "mult_expr_DSP"
306  //|| fu_base_name != "trunc_div_expr_FU"
307  //|| fu_base_name != "fp_fix_trunc_expr_FU"
308  //|| fu_base_name == "fp_log_FU"
309  || fu_base_name.find(CONSTANT_STD) != std::string::npos)
310  {
311  }
312  else
313  {
314  const module* mod = GetPointer<module>(obj);
315  unsigned int n_ports = mod->get_in_port_size();
317  unsigned int n_port_to_be_specialized = 0;
318  for(unsigned int i = 0; i < n_ports; ++i)
319  {
320  structural_objectRef port_c = mod->get_in_port(i);
321  if(port_c && (port_c->get_id() == CLOCK_PORT_NAME || port_c->get_id() == RESET_PORT_NAME ||
322  port_c->get_id() == START_PORT_NAME ||
323  (GetPointer<port_o>(port_c) && GetPointer<port_o>(port_c)->get_is_memory()) ||
324  port_c->get_id().find("sel_") == 0))
325  {
326  continue;
327  }
328  ++n_port_to_be_specialized;
329  }
330  unsigned int constPort;
332  size_t n_pipe_parameters = pipe_parameters[prec].size();
333  size_t n_iterations_pipe = n_pipe_parameters > 1 ? n_pipe_parameters : 1;
334  size_t n_portsize_parameters = portsize_parameters[prec].size();
335  size_t n_iterations_portsize = n_portsize_parameters > 1 ? n_portsize_parameters : 1;
336 
337  for(size_t portsize_index = 0; portsize_index < n_iterations_portsize; ++portsize_index)
338  {
340  "-->Considering portsize_index " + STR(portsize_index));
341  for(size_t stage_index = 0; stage_index < n_iterations_pipe; ++stage_index)
342  {
343  if(n_port_to_be_specialized <= 1 || !isTemplate || fu_base_name == MUX_GATE_STD ||
344  fu_base_name == DEMUX_GATE_STD || no_constants)
345  {
346  constPort =
347  n_ports; // Set constPort to in_port_size to immediately stop the loop after one iteration.
348  }
349  else
350  {
351  constPort = 0;
352  }
353  has_first_synthesis_id = n_ports + 2;
354  for(; constPort < n_ports + 1; ++constPort)
355  {
356  structural_objectRef port_c =
357  n_ports > constPort ? mod->get_in_port(constPort) : structural_objectRef();
358  if(port_c && (port_c->get_id() == CLOCK_PORT_NAME || port_c->get_id() == RESET_PORT_NAME ||
359  port_c->get_id() == START_PORT_NAME ||
360  (GetPointer<port_o>(port_c) && GetPointer<port_o>(port_c)->get_is_memory()) ||
361  port_c->get_id().find("sel_") == 0))
362  {
363  continue;
364  }
365  std::string template_parameters;
366  fu_name = fu_base_name;
367  template_parameters = "";
368  if(isTemplate)
369  {
370  for(unsigned int iport = 0; iport < n_ports; ++iport)
371  {
372  structural_objectRef port = mod->get_in_port(iport);
373  if(port->get_id() == CLOCK_PORT_NAME || port->get_id() == RESET_PORT_NAME ||
374  port->get_id() == START_PORT_NAME ||
375  (GetPointer<port_o>(port) && GetPointer<port_o>(port)->get_is_memory()) ||
376  port->get_id().find("sel_") == 0)
377  {
378  continue;
379  }
380  if(template_parameters != "")
381  {
382  template_parameters += " ";
383  }
384  THROW_ASSERT(port, "expected a port");
386  {
387  fu_name += "_" + STR(1);
388  template_parameters += STR(1);
389  }
390  else if(iport == 1 and
391  (fu_base_name == "widen_mult_expr_FU" or fu_base_name == "ui_widen_mult_expr_FU" or
392  fu_base_name == "mult_expr_FU" or fu_base_name == "ui_mult_expr_FU") and
393  DSP_y_to_DSP_x.find(prec) != DSP_y_to_DSP_x.end())
394  {
395  fu_name += "_" + STR(DSP_y_to_DSP_x.find(prec)->second);
396  template_parameters += STR(DSP_y_to_DSP_x.find(prec)->second);
397  }
398  else if(iport != constPort)
399  {
400  fu_name += "_" + STR(prec);
401  template_parameters += STR(prec);
405  {
406  fu_name += "_" + STR(128 / prec);
407  template_parameters += " " + STR(128 / prec);
408  }
409  }
410  else
411  {
412  fu_name += "_" + STR(0);
413  template_parameters += STR(0);
414  }
415  }
416  // output port
417  for(unsigned int oport = 0; oport < mod->get_out_port_size(); ++oport)
418  {
419  structural_objectRef port = mod->get_out_port(oport);
420  THROW_ASSERT(port, "expected a port");
421  if(port->get_id() == DONE_PORT_NAME || (GetPointer<port_o>(port)->get_is_memory()))
422  {
423  continue;
424  }
425  if((fu_base_name == "widen_mult_expr_FU" or fu_base_name == "ui_widen_mult_expr_FU") and
426  DSP_y_to_DSP_x.find(prec) != DSP_y_to_DSP_x.end())
427  {
428  fu_name += "_" + STR(prec + DSP_y_to_DSP_x.find(prec)->second);
429  template_parameters += " " + STR(prec + DSP_y_to_DSP_x.find(prec)->second);
430  }
431  else if((fu_base_name == "mult_expr_FU" or fu_base_name == "ui_mult_expr_FU") and
432  DSP_y_to_DSP_x.find(prec) != DSP_y_to_DSP_x.end())
433  {
434  fu_name += "_" + STR(resize_1_8_pow2(prec));
435  template_parameters += " " + STR(resize_1_8_pow2(prec));
436  }
437  else if(GetPointer<port_o>(port)->get_is_doubled())
438  {
439  fu_name += "_" + STR(2 * prec);
440  template_parameters += " " + STR(2 * prec);
441  }
442  else if(GetPointer<port_o>(port)->get_is_halved())
443  {
444  fu_name += "_" + STR(prec / 2);
445  template_parameters += " " + STR(prec / 2);
446  }
447  else
448  {
449  fu_name += "_" + STR(prec);
450  template_parameters += " " + STR(prec);
451  }
455  {
456  if(GetPointer<port_o>(port)->get_is_doubled())
457  {
458  fu_name += "_" + STR(128 / (2 * prec));
459  template_parameters += " " + STR(128 / (2 * prec));
460  }
461  else if(GetPointer<port_o>(port)->get_is_halved())
462  {
463  fu_name += "_" + STR(128 / (prec / 2));
464  template_parameters += " " + STR(128 / (prec / 2));
465  }
466  else
467  {
468  fu_name += "_" + STR(128 / prec);
469  template_parameters += " " + STR(128 / prec);
470  }
471  }
472  }
473  }
474  if(n_pipe_parameters > 0)
475  {
476  fu_name += "_" + pipe_parameters[prec][stage_index];
477  template_parameters += " " + pipe_parameters[prec][stage_index];
478  }
479  if(n_portsize_parameters > 0)
480  {
481  fu_name += "_" + portsize_parameters[prec][portsize_index];
482  template_parameters += " " + portsize_parameters[prec][portsize_index];
483  }
484 
485  functional_unit* fu;
486  technology_nodeRef tn = TM->get_fu(fu_name, LM);
487  if(!tn)
488  {
489  // Analyzing a template, specializations of that template won't be found in the library.
490  technology_nodeRef fun_unit;
491  if(GetPointer<functional_unit_template>(f_unit))
492  {
493  fun_unit = GetPointer<functional_unit_template>(f_unit)->FU;
494  }
495  else
496  {
497  fun_unit = f_unit;
498  }
499  tn = create_template_instance(fun_unit, fu_name, prec);
500  fu = GetPointer<functional_unit>(tn);
501  fu->fu_template_parameters = template_parameters;
502  TM->get_library_manager(LM)->add(tn);
503  }
504  else
505  {
506  fu = GetPointer<functional_unit>(tn);
507  }
508  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "-->Analyzing cell " + fu->get_name());
509  AnalyzeCell(fu, prec, portsize_parameters.find(prec)->second, portsize_index,
510  pipe_parameters.find(prec)->second, stage_index, constPort, is_commutative,
511  max_lut_size);
512  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Analyzed cell " + fu->get_name());
513  }
514  }
516  "<--Considered portsize_index " + STR(portsize_index));
517  }
518  }
519  }
520  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Considered precision " + STR(prec) + " bits");
521  }
522  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Analyzed " + f_unit->get_name());
523 }
524 
526 {
527  if(device->has_parameter("DSPs_y_sizes"))
528  {
529  THROW_ASSERT(device->has_parameter("DSPs_x_sizes"), "device description is not complete");
530  auto DSPs_x_sizes = device->get_parameter<std::string>("DSPs_x_sizes");
531  auto DSPs_y_sizes = device->get_parameter<std::string>("DSPs_y_sizes");
532  std::vector<std::string> DSPs_x_sizes_vec = SplitString(DSPs_x_sizes, ",");
533  std::vector<std::string> DSPs_y_sizes_vec = SplitString(DSPs_y_sizes, ",");
534  for(size_t DSP_index = 0; DSP_index < DSPs_y_sizes_vec.size(); DSP_index++)
535  {
536  const auto DSPs_x_value = static_cast<unsigned>(std::stoul(DSPs_x_sizes_vec[DSP_index]));
537  const auto DSPs_y_value = static_cast<unsigned>(std::stoul(DSPs_y_sizes_vec[DSP_index]));
538  DSP_y_to_DSP_x[DSPs_y_value] = DSPs_x_value;
539  }
540  }
541 }
542 
544  const std::string& name, unsigned int prec)
545 {
546  auto* curr_fu = GetPointer<functional_unit>(fu_template);
547  THROW_ASSERT(curr_fu, "Null functional unit template");
548 
549  auto* specialized_fu = new functional_unit;
550  specialized_fu->functional_unit_name = name;
551  specialized_fu->fu_template_name = curr_fu->functional_unit_name;
552  specialized_fu->characterizing_constant_value = curr_fu->characterizing_constant_value;
553  specialized_fu->memory_type = curr_fu->memory_type;
554  specialized_fu->channels_type = curr_fu->channels_type;
555  specialized_fu->memory_ctrl_type = curr_fu->memory_ctrl_type;
556  specialized_fu->CM = curr_fu->CM;
557  specialized_fu->XML_description = curr_fu->XML_description;
558 
559  for(auto itr = curr_fu->get_operations().begin(), end = curr_fu->get_operations().end(); itr < end; ++itr)
560  {
561  auto* const op = GetPointer<operation>(*itr);
562  auto* new_op = new operation;
563  new_op->operation_name = op->operation_name;
564  new_op->bounded = op->bounded;
565 
566  new_op->time_m = time_info::factory(parameters);
567  if(op->time_m)
568  {
569  new_op->time_m->set_execution_time(op->time_m->get_execution_time(), op->time_m->get_cycles());
570  new_op->time_m->set_synthesis_dependent(op->time_m->get_synthesis_dependent());
571  const ControlStep ii(op->time_m->get_initiation_time());
572  new_op->time_m->set_initiation_time(ii);
573  }
574  new_op->commutative = op->commutative;
575  auto supported_type_it_end = op->supported_types.end();
576  if(op->supported_types.begin() != op->supported_types.end())
577  {
578  for(auto supported_type_it = op->supported_types.begin(); supported_type_it != supported_type_it_end;
579  ++supported_type_it)
580  {
581  new_op->supported_types[supported_type_it->first].push_back(prec);
582  }
583  }
584  specialized_fu->add(technology_nodeRef(new_op));
585  }
586 
587  specialized_fu->area_m = area_info::factory(parameters);
588 
589  return technology_nodeRef(specialized_fu);
590 }
#define READ_COND_STD
technology_nodeRef create_template_instance(const technology_nodeRef &fu_template, const std::string &name, unsigned int prec)
Create a template instance to be specialized.
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
#define OR_GATE_STD
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
Collect information about resource area.
File containing functions and utilities to support the printing of debug messagges.
#define START_PORT_NAME
technology_nodeRef get_fu(const std::string &fu_name, const std::string &Library) const
Return the reference to a component given its name.
const std::string & get_id() const
Return the identifier associated with the structural_object.
std::string operation_name
name of the operation mappen on a given functional unit.
std::string fu_template_parameters
Template parameters.
const std::vector< std::string > SplitString(const std::string &input, const std::string &separators)
Function which splits a string into tokens.
#define DEMUX_GATE_STD
#define AND_GATE_STD
#define CONSTANT_STD
T resize_1_8_pow2(T value)
FunctionalUnitStep(const generic_deviceRef _device, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
unsigned int get_out_port_size() const
Return the number of output ports.
mathematical utility function not provided by standard libraries
The base class for design step.
std::string functional_unit_name
name of the functional unit.
Collect information about resource performance.
const structural_objectRef get_in_port(unsigned int n) const
Return the ith input port.
const std::string & get_name() const override
Return the name of the operation.
Class specification of the manager of the technology library data structures.
This class specifies the characteristic of a particular functional unit.
void add(const technology_nodeRef &node)
redefinition of map to manage ordered/unordered structures
refcount< technology_node > technology_nodeRef
refcount definition of the class
Abstract class to iterate over all the cells of a template.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
s_type type
The type of the port or the signal.
#define CLOCK_PORT_NAME
standard name for ports
#define LUT_GATE_STD
FPGA modules.
unsigned int has_first_synthesis_id
The id of the first analyzed cell of a sequence of cells which differ for the position of the constan...
This class specifies the characteristic of a particular operation working on a given functional unit...
Data structure used to store the schedule of the operations.
#define DONE_PORT_NAME
Class specification of the data structures used to manage technology information. ...
const structural_objectRef get_out_port(unsigned int n) const
Return the ith output port.
#define NAND_GATE_STD
redefinition of set to manage ordered/unordered structures
const ParameterConstRef parameters
Set of input parameters.
This package is used by all HLS packages to manage resource constraints and characteristics.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
Definition: exceptions.hpp:263
#define NOR_GATE_STD
#define XOR_GATE_STD
unsigned int get_in_port_size() const
Return the number of input ports.
const technology_managerRef TM
Technology manager.
This class describes all classes used to represent a structural object.
const structural_type_descriptorRef & get_typeRef() const
Return the type descriptor of the structural_object.
static area_infoRef factory(const ParameterConstRef &Param)
Factory method.
Definition: area_info.cpp:52
virtual const std::string & get_name() const =0
Return the name of the technology node.
virtual void AnalyzeCell(functional_unit *fu, const unsigned int prec, const std::vector< std::string > &portsize_parameters, const size_t portsize_index, const std::vector< std::string > &pipe_parameters, const size_t stage_index, const unsigned int constPort, const bool is_commutative, size_t max_lut_size)=0
Analyze the single cell.
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
refcount< structural_object > structural_objectRef
RefCount type definition of the structural_object class structure.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
CustomMap< unsigned int, unsigned int > DSP_y_to_DSP_x
The sizes of available DSPs.
const generic_deviceRef device
device information
#define MUX_GATE_STD
virtual void AnalyzeFu(const technology_nodeRef f_unit)
Analyze all the cells built starting from a template.
#define RESET_PORT_NAME
Class implementation of the structural_manager.
Generic device description.
Class specification of the manager for each library.
int debug_level
The debug level.
std::vector< technology_nodeRef > operation_vec
Type definition of a vector of functional_unit.
bool exist_NP_functionality(NP_functionaly_type type) const
Return true in case there exist a functionaly of the given type.
~FunctionalUnitStep() override
Destructor.
This class describes a generic module.
static time_infoRef factory(const ParameterConstRef Param)
Definition: time_info.cpp:110
library_managerRef get_library_manager(const std::string &Name) const
Return the library data structure corresponding to the given library id.
#define XNOR_GATE_STD
std::string get_library(const std::string &Name) const
Return the higher priority library where the given component is stored.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...
Definition: exceptions.hpp:289

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