PandA-2024.02
ModuleGeneratorManager.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) 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  */
46 
47 #include "ModuleGenerator.hpp"
48 #include "Parameter.hpp"
49 #include "area_info.hpp"
50 #include "behavioral_helper.hpp"
51 #include "call_graph_manager.hpp"
52 #include "constant_strings.hpp"
53 #include "fileIO.hpp"
54 #include "function_behavior.hpp"
55 #include "hls_device.hpp"
56 #include "hls_manager.hpp"
57 #include "language_writer.hpp"
58 #include "library_manager.hpp"
59 #include "math_function.hpp"
60 #include "memory.hpp"
61 #include "memory_cs.hpp"
62 #include "op_graph.hpp"
63 #include "string_manipulation.hpp"
64 #include "structural_manager.hpp"
65 #include "structural_objects.hpp"
66 #include "technology_manager.hpp"
67 #include "technology_node.hpp"
68 #include "tree_helper.hpp"
69 #include "tree_manager.hpp"
70 #include "tree_node.hpp"
71 #include "tree_reindex.hpp"
72 
73 #include "config_BOOST_INCLUDE_DIR.hpp"
74 
75 #include <filesystem>
76 #include <iosfwd>
77 #include <string>
78 #include <tuple>
79 #include <utility>
80 #include <vector>
81 
83  : HLSMgr(_HLSMgr), parameters(_parameters), debug_level(_parameters->get_class_debug_level(GET_CLASS(*this)))
84 {
85 }
86 
88 
89 #define NAMESEPARATOR "_"
90 
92 ModuleGeneratorManager::getDataType(unsigned int variable, const FunctionBehaviorConstRef function_behavior) const
93 {
95  new structural_type_descriptor(variable, function_behavior->CGetBehavioralHelper()));
96 }
97 
98 static unsigned long long resize_to_8_or_greater(unsigned long long value)
99 {
100  return std::max(8ULL, ceil_pow2(value));
101 }
102 
104  unsigned int firstIndexToSpecialize, const std::vector<std::tuple<unsigned int, unsigned int>>& required_variables,
105  const FunctionBehaviorConstRef FB) const
106 {
107  std::string fu_name = "";
108  auto index = 0U;
109  for(const auto& required_variable : required_variables)
110  {
111  if(index >= firstIndexToSpecialize)
112  {
113  const auto typeRef = getDataType(std::get<0>(required_variable), FB);
114  const auto dataSize = typeRef->vector_size != 0U ? typeRef->vector_size : typeRef->size;
115  fu_name += NAMESEPARATOR + typeRef->get_name() + STR(resize_to_8_or_greater(dataSize));
116  }
117  ++index;
118  }
119  return fu_name;
120 }
121 
123  const std::string& hdl_template, structural_objectRef mod, unsigned int function_id, vertex op_v,
124  const std::vector<std::tuple<unsigned int, unsigned int>>& required_variables, HDLWriter_Language language)
125 {
127  "ModuleGeneratorManager @ Loading generator class '" << hdl_template << "'...");
128 
129  const auto module_generator = ModuleGenerator::Create(hdl_template, HLSMgr);
130  THROW_ASSERT(module_generator, "Unknown module generator required: " + hdl_template);
131 
132  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "ModuleGeneratorManager @ Starting dynamic HDL generation...");
133 
134  std::vector<ModuleGenerator::parameter> _p;
135  if(required_variables.size())
136  {
137  auto portNum = 0U;
138  const auto FB = HLSMgr->CGetFunctionBehavior(function_id);
139  for(const auto& required_variable : required_variables)
140  {
141  const auto typeRef = getDataType(std::get<0>(required_variable), FB);
142  struct ModuleGenerator::parameter param;
143  param.name = "in" + STR(portNum + 1U);
144  param.type = typeRef->get_name();
145  const auto dataSize = typeRef->vector_size != 0U ? typeRef->vector_size : typeRef->size;
146  param.type_size = resize_to_8_or_greater(dataSize);
147  param.alignment = 0U;
148  _p.push_back(std::move(param));
149  portNum++;
150  }
151  }
152 
153  std::stringstream HDLOutput;
154  module_generator->Exec(HDLOutput, mod, function_id, op_v, _p, language);
155 
156  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "ModuleGeneratorManager @ HDL code generated successfully!");
157  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "ModuleGeneratorManager @ The generated Dynamic-HDL is:");
158  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, HDLOutput.str());
159 
160  return HDLOutput.str();
161 }
162 
164 {
165  original_port->copy(gen_port);
166  gen_port->get_typeRef()->size = original_port->get_typeRef()->size;
167  gen_port->get_typeRef()->vector_size = original_port->get_typeRef()->vector_size;
168 }
169 
170 void ModuleGeneratorManager::specialize_fu(const std::string& fu_name, vertex ve, const FunctionBehaviorConstRef FB,
171  const std::string& libraryId, const std::string& new_fu_name,
172  std::map<std::string, technology_nodeRef>& new_fu)
173 {
174  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Specializing: " + fu_name + " as " + new_fu_name);
175 
176  if(new_fu.count(new_fu_name))
177  {
178  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, new_fu_name + " already in the library");
179  }
180  else
181  {
182  const auto HLS_D = HLSMgr->get_HLS_device();
183 
184  const auto libraryManager = HLS_D->get_technology_manager()->get_library_manager(libraryId);
185  const auto techNode_obj = libraryManager->get_fu(fu_name);
186  THROW_ASSERT(techNode_obj->get_kind() == functional_unit_K, "");
187  const auto structManager_obj = GetPointerS<const functional_unit>(techNode_obj)->CM;
188  const auto fu_obj = structManager_obj->get_circ();
189  const auto fu_module = GetPointer<const module>(fu_obj);
190  THROW_ASSERT(fu_module, "");
191  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Found variable component: " + fu_name);
192  const auto required_variables =
193  FB ? HLSMgr->get_required_values(FB->CGetBehavioralHelper()->get_function_index(), ve) :
194  std::vector<HLS_manager::io_binding_type>();
195  auto param_list = fu_module->get_NP_functionality()->get_NP_functionality(NP_functionality::LIBRARY);
196  const auto multiplicitiy = fu_module->get_multi_unit_multiplicity();
197  const auto n_ports = FB ? FB->GetChannelsNumber() : 1U;
198 
200  const structural_type_descriptorRef module_type(new structural_type_descriptor(new_fu_name));
201  CM->set_top_info(new_fu_name, module_type);
202  const auto top = CM->get_circ();
203  const auto top_module = GetPointerS<module>(top);
204  top_module->set_generated();
206  top_module->set_description(fu_module->get_description());
207  top_module->set_copyright(fu_module->get_copyright());
208  top_module->set_authors(fu_module->get_authors());
209  top_module->set_license(fu_module->get_license());
210  for(const auto& module_parameter : fu_module->GetParameters())
211  {
212  top_module->AddParameter(module_parameter.first, fu_module->GetDefaultParameter(module_parameter.first));
213  top_module->SetParameter(module_parameter.first, module_parameter.second);
214  }
215  top_module->set_multi_unit_multiplicity(multiplicitiy);
216  if(fu_module->get_NP_functionality()->exist_NP_functionality(NP_functionality::IP_COMPONENT))
217  {
220  fu_module->get_NP_functionality()->get_NP_functionality(NP_functionality::IP_COMPONENT));
221  }
222 
223  auto toSkip = 0U;
224  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Adding input ports");
225  for(auto i = 0U; i < fu_module->get_in_port_size(); i++)
226  {
227  const auto curr_port = fu_module->get_in_port(i);
228  const auto port_name = curr_port->get_id();
229  if(port_name == CLOCK_PORT_NAME || port_name == RESET_PORT_NAME || port_name == START_PORT_NAME)
230  {
231  ++toSkip;
232  }
233  if(GetPointerS<port_o>(curr_port)->get_is_var_args())
234  {
235  auto portNum = 1U;
236  auto indexPort = 0U;
237  for(const auto& required_variable : required_variables)
238  {
239  if(indexPort >= (i - toSkip))
240  {
241  const auto gen_port_name = "in" + STR(portNum + i - toSkip);
242  const auto var = std::get<0>(required_variable);
243  const auto dt = getDataType(var, FB);
245  if(dt->vector_size == 0)
246  {
247  dt->size = resize_to_8_or_greater(dt->size);
248  }
249  else
250  {
251  dt->vector_size = resize_to_8_or_greater(dt->vector_size);
252  }
253 
254  structural_objectRef gen_port;
255  if(curr_port->get_kind() == port_vector_o_K)
256  {
257  const auto ps = GetPointerS<port_o>(curr_port)->get_ports_size();
258  THROW_ASSERT(multiplicitiy == ps, "unexpected condition " + STR(multiplicitiy) + " " + STR(ps));
259  gen_port = CM->add_port_vector(gen_port_name, port_o::IN, ps, top, dt);
260  }
261  else
262  {
263  gen_port = CM->add_port(gen_port_name, port_o::IN, top, dt);
264  }
265  gen_port->get_typeRef()->size = dt->size;
266  gen_port->get_typeRef()->vector_size = dt->vector_size;
267  param_list = param_list + " " + gen_port_name;
268  ++portNum;
269  }
270  ++indexPort;
271  }
272  }
273  else
274  {
275  structural_objectRef gen_port;
276  if(curr_port->get_kind() == port_vector_o_K)
277  {
278  if(multiplicitiy)
279  {
280  const auto ps = GetPointerS<const port_o>(curr_port)->get_ports_size();
281  THROW_ASSERT(multiplicitiy == ps, "unexpected condition");
282  gen_port = CM->add_port_vector(port_name, port_o::IN, ps, top, curr_port->get_typeRef());
283  }
284  else
285  {
286  gen_port = CM->add_port_vector(port_name, port_o::IN, n_ports, top, curr_port->get_typeRef());
287  }
288  }
289  else
290  {
291  gen_port = CM->add_port(port_name, port_o::IN, top, curr_port->get_typeRef());
292  }
293  add_port_parameters(gen_port, curr_port);
294  }
295  }
296 
297  CM->add_NP_functionality(top, NP_functionality::LIBRARY, new_fu_name + " " + param_list);
298 
299  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Adding output ports");
300  for(auto i = 0U; i < fu_module->get_out_port_size(); i++)
301  {
302  const auto curr_port = fu_module->get_out_port(i);
303  structural_objectRef gen_port;
304  if(curr_port->get_kind() == port_vector_o_K)
305  {
306  if(multiplicitiy)
307  {
308  const auto ps = GetPointerS<const port_o>(curr_port)->get_ports_size();
309  THROW_ASSERT(multiplicitiy == ps, "unexpected condition");
310  gen_port = CM->add_port_vector(curr_port->get_id(), port_o::OUT, ps, top, curr_port->get_typeRef());
311  }
312  else
313  {
314  gen_port = CM->add_port_vector(curr_port->get_id(), port_o::OUT, n_ports, top, curr_port->get_typeRef());
315  }
316  }
317  else
318  {
319  gen_port = CM->add_port(curr_port->get_id(), port_o::OUT, top, curr_port->get_typeRef());
320  }
321  add_port_parameters(gen_port, curr_port);
322  }
323 
324  const auto writer = [&]() -> HDLWriter_Language {
326  const auto np = fu_module->get_NP_functionality();
327  const auto required_language =
328  static_cast<HDLWriter_Language>(parameters->getOption<unsigned int>(OPT_writer_language));
329  if(required_language == HDLWriter_Language::VERILOG &&
330  np->exist_NP_functionality(NP_functionality::VERILOG_GENERATOR))
331  {
333  }
334  if(required_language == HDLWriter_Language::VHDL &&
335  np->exist_NP_functionality(NP_functionality::VHDL_GENERATOR))
336  {
338  }
339  if(parameters->isOption(OPT_mixed_design) && !parameters->getOption<bool>(OPT_mixed_design))
340  {
341  THROW_ERROR("Missing VHDL GENERATOR for " + fu_name);
342  }
343  if(!np->exist_NP_functionality(NP_functionality::VERILOG_GENERATOR) &&
344  !np->exist_NP_functionality(NP_functionality::VHDL_GENERATOR))
345  {
346  THROW_ERROR("Missing GENERATOR for " + fu_name);
347  }
348  if(np->exist_NP_functionality(NP_functionality::VERILOG_GENERATOR))
349  {
351  }
352  else
353  {
355  }
356  }();
357 
358  const auto hdl_template = fu_module->get_NP_functionality()->get_NP_functionality(
361  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, new_fu_name + ": Generating dynamic HDL code");
362  const auto hdl_code = GenerateHDL(hdl_template, top, FB ? FB->CGetBehavioralHelper()->get_function_index() : 0U,
363  ve, required_variables, writer);
364 
368  hdl_code);
369 
370  const technology_nodeRef new_techNode_obj(new functional_unit);
371  {
372  const auto fu = GetPointerS<functional_unit>(new_techNode_obj);
373  if(GetPointerS<const functional_unit>(techNode_obj)->area_m)
374  {
375  fu->area_m = area_info::factory(parameters);
376  }
377  fu->functional_unit_name = new_fu_name;
378  fu->CM = CM;
379  const auto op_vec = GetPointerS<const functional_unit>(techNode_obj)->get_operations();
380  for(const auto& techNode_fu : op_vec)
381  {
382  fu->add(techNode_fu);
383  }
384  }
385  new_fu.insert(std::make_pair(new_fu_name, new_techNode_obj));
386  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, new_fu_name + " created successfully");
387  }
388  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Specialization completed");
389 }
390 
391 void ModuleGeneratorManager::create_generic_module(const std::string& fu_name, vertex ve,
392  const FunctionBehaviorConstRef FB, const std::string& libraryId,
393  const std::string& new_fu_name)
394 {
395  const auto HLS_D = HLSMgr->get_HLS_device();
396  const auto TechM = HLS_D->get_technology_manager();
397 
398  const auto libraryManager = TechM->get_library_manager(libraryId);
399  const auto techNode_obj = libraryManager->get_fu(fu_name);
400  THROW_ASSERT(techNode_obj->get_kind() == functional_unit_K, "");
401  const auto structManager_obj = GetPointerS<const functional_unit>(techNode_obj)->CM;
402  const auto fu_obj = structManager_obj->get_circ();
403  const auto fu_module = GetPointer<const module>(fu_obj);
404  THROW_ASSERT(fu_module, "");
405  const auto multiplicitiy = fu_module->get_multi_unit_multiplicity();
406  const auto n_ports = FB ? FB->GetChannelsNumber() : 1U;
407 
409  {
410  TechM->add_resource(libraryId, new_fu_name, CM);
411  const auto fu = GetPointerS<functional_unit>(TechM->get_fu(new_fu_name, libraryId));
412  fu->area_m = area_info::factory(parameters);
413  fu->area_m->set_area_value(0);
414  const auto& op_vec = GetPointerS<functional_unit>(techNode_obj)->get_operations();
415  for(const auto& techNode_fu : op_vec)
416  {
417  fu->add(techNode_fu);
418  }
419  }
420 
421  CM->set_top_info(new_fu_name, structural_type_descriptorRef(new structural_type_descriptor(new_fu_name)));
422  const auto top = CM->get_circ();
423  THROW_ASSERT(top, "");
424  const auto top_module = GetPointerS<module>(top);
425  top_module->set_generated();
427  top_module->set_description(fu_module->get_description());
428  top_module->set_copyright(fu_module->get_copyright());
429  top_module->set_authors(fu_module->get_authors());
430  top_module->set_license(fu_module->get_license());
431  for(const auto& module_parameter : fu_module->GetParameters())
432  {
433  top_module->AddParameter(module_parameter.first, fu_module->GetDefaultParameter(module_parameter.first));
434  top_module->SetParameter(module_parameter.first, module_parameter.second);
435  }
436  top_module->set_multi_unit_multiplicity(multiplicitiy);
437  const auto NP_parameters =
438  new_fu_name + " " + fu_module->get_NP_functionality()->get_NP_functionality(NP_functionality::LIBRARY);
440  if(fu_module->get_NP_functionality()->exist_NP_functionality(NP_functionality::IP_COMPONENT))
441  {
443  fu_module->get_NP_functionality()->get_NP_functionality(NP_functionality::IP_COMPONENT));
444  }
445 
446  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Adding input ports");
447  for(auto i = 0U; i < fu_module->get_in_port_size(); i++)
448  {
449  const auto curr_port = fu_module->get_in_port(i);
450  THROW_ASSERT(!GetPointer<const port_o>(curr_port)->get_is_var_args(), "unexpected condition");
451  structural_objectRef gen_port;
452  const auto port_name = curr_port->get_id();
453  if(curr_port->get_kind() == port_vector_o_K)
454  {
455  if(multiplicitiy)
456  {
457  const auto ps = GetPointerS<const port_o>(curr_port)->get_ports_size();
458  THROW_ASSERT(multiplicitiy == ps, "unexpected condition");
459  gen_port = CM->add_port_vector(port_name, port_o::IN, ps, top, curr_port->get_typeRef());
460  }
461  else
462  {
463  gen_port = CM->add_port_vector(port_name, port_o::IN, n_ports, top, curr_port->get_typeRef());
464  }
465  }
466  else
467  {
468  gen_port = CM->add_port(port_name, port_o::IN, top, curr_port->get_typeRef());
469  }
470  add_port_parameters(gen_port, curr_port);
471  }
472 
473  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "Adding output ports");
474  for(auto i = 0U; i < fu_module->get_out_port_size(); i++)
475  {
476  const auto curr_port = fu_module->get_out_port(i);
477  structural_objectRef gen_port;
478  if(curr_port->get_kind() == port_vector_o_K)
479  {
480  if(multiplicitiy)
481  {
482  const auto ps = GetPointerS<const port_o>(curr_port)->get_ports_size();
483  THROW_ASSERT(multiplicitiy == ps, "unexpected condition");
484  gen_port = CM->add_port_vector(curr_port->get_id(), port_o::OUT, ps, top, curr_port->get_typeRef());
485  }
486  else
487  {
488  gen_port = CM->add_port_vector(curr_port->get_id(), port_o::OUT, n_ports, top, curr_port->get_typeRef());
489  }
490  }
491  else
492  {
493  gen_port = CM->add_port(curr_port->get_id(), port_o::OUT, top, curr_port->get_typeRef());
494  }
495  add_port_parameters(gen_port, curr_port);
496  }
497 
498  const auto writer = [&]() -> HDLWriter_Language {
500  const auto np = fu_module->get_NP_functionality();
501  const auto required_language =
502  static_cast<HDLWriter_Language>(parameters->getOption<unsigned int>(OPT_writer_language));
503  if(required_language == HDLWriter_Language::VERILOG &&
504  np->exist_NP_functionality(NP_functionality::VERILOG_GENERATOR))
505  {
507  }
508  if(required_language == HDLWriter_Language::VHDL && np->exist_NP_functionality(NP_functionality::VHDL_GENERATOR))
509  {
511  }
512  if(parameters->isOption(OPT_mixed_design) && !parameters->getOption<bool>(OPT_mixed_design))
513  {
514  THROW_ERROR("Missing VHDL GENERATOR for " + fu_name);
515  }
516  if(!np->exist_NP_functionality(NP_functionality::VERILOG_GENERATOR) &&
517  !np->exist_NP_functionality(NP_functionality::VHDL_GENERATOR))
518  {
519  THROW_ERROR("Missing GENERATOR for " + fu_name);
520  }
521  if(np->exist_NP_functionality(NP_functionality::VERILOG_GENERATOR))
522  {
524  }
525  else
526  {
528  }
529  }();
530  const auto hdl_template = fu_module->get_NP_functionality()->get_NP_functionality(
532  PRINT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, new_fu_name + ": Generating dynamic HDL code");
533  std::vector<std::tuple<unsigned int, unsigned int>> required_variables;
534  const auto hdl_code = GenerateHDL(hdl_template, top, FB ? FB->CGetBehavioralHelper()->get_function_index() : 0U, ve,
535  required_variables, writer);
539  hdl_code);
540 }
structural_type_descriptorRef getDataType(unsigned int variable, const FunctionBehaviorConstRef function_behavior) const
unsigned long long type_size
Data structure representing the entire HLS information.
static refcount< ModuleGenerator > Create(const std::string &s, T &&... args)
Definition: Factory.hpp:60
void * top(node_stack *head)
Definition: tree.c:75
Collect information about resource area.
refcount< structural_type_descriptor > structural_type_descriptorRef
RefCount type definition of the structural_type_descriptor class structure.
#define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
#define START_PORT_NAME
Structure representing the most relevant information about the type of a structural object...
const std::string & get_id() const
Return the identifier associated with the structural_object.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
const structural_objectRef get_circ() const
Get a reference to circ field.
void specialize_fu(const std::string &fu_name, vertex ve, const FunctionBehaviorConstRef FB, const std::string &libraryId, const std::string &new_fu_name, std::map< std::string, technology_nodeRef > &new_fu)
mathematical utility function not provided by standard libraries
This class manages the circuit structures.
ModuleGeneratorManager(const HLS_managerRef HLSMgr, const ParameterConstRef parameters)
Constructor.
unsigned int get_function_index() const
Return the index of the function.
Class specification of the manager of the technology library data structures.
This class specifies the characteristic of a particular functional unit.
unsigned long long alignment
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
#define max
Definition: backprop.h:17
HDLWriter_Language
unsigned long long size
The size of the object (in bit). The objects having a size are: ports, signals, channels, data, and actions.
virtual void AddParameter(const std::string &name, const std::string &default_value)
Add a parameter.
#define CLOCK_PORT_NAME
standard name for ports
static void add_NP_functionality(structural_objectRef cir, NP_functionality::NP_functionaly_type dt, std::string functionality_description)
Add a not-parsed functionality.
void add_port_parameters(structural_objectRef generated_port, structural_objectRef original_port)
void set_top_info(const std::string &id, const technology_managerRef &LM, const std::string &Library="")
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
Class specification of the data structures used to manage technology information. ...
static structural_objectRef add_port(const std::string &id, port_o::port_direction pdir, structural_objectRef owner, structural_type_descriptorRef type_descr, unsigned int treenode=0)
Create a new port.
static unsigned long long resize_to_8_or_greater(unsigned long long value)
#define index(x, y)
Definition: Keccak.c:74
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
utility function used to read files.
const BehavioralHelperConstRef CGetBehavioralHelper() const
Returns the helper associated with the function.
Classes specification of the tree_node data structures.
const ParameterConstRef parameters
The set of input parameters.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
Definition: exceptions.hpp:263
This file collects some utility functions.
std::string GenerateHDL(const std::string &hdl_template, structural_objectRef mod, unsigned int function_id, vertex op_v, const std::vector< std::tuple< unsigned int, unsigned int >> &required_variables, HDLWriter_Language language)
const int debug_level
The debug level.
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
Class specification of the tree_reindex support class.
virtual void copy(structural_objectRef dest) const
Perform a copy of the structural object.
virtual ~ModuleGeneratorManager()
Destructor.
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
this class is used to manage the command-line or XML options.
constant strings
unsigned int GetChannelsNumber() const
#define RESET_PORT_NAME
Wrapper to call graph.
Class implementation of the structural_manager.
std::string get_specialized_name(unsigned int firstIndexToSpecialize, const std::vector< std::tuple< unsigned int, unsigned int >> &required_variables, const FunctionBehaviorConstRef FB) const
Class specification of the manager for each library.
void create_generic_module(const std::string &fu_name, vertex ve, const FunctionBehaviorConstRef FB, const std::string &libraryId, const std::string &new_fu_name)
#define DEBUG_LEVEL_VERBOSE
verbose debugging print is performed.
static structural_objectRef add_port_vector(std::string id, port_o::port_direction pdir, unsigned int n_ports, structural_objectRef owner, structural_type_descriptorRef type_descr, unsigned int treenode=0)
Create a new port_vector.
Datastructure to represent memory information in high-level synthesis.
Class specification of the manager of the tree structures extracted from the raw file.
HLS specialization of generic_device.
A brief description of the C++ Header File.
#define NAMESEPARATOR
unsigned long long vector_size
The number of the elements of a vector.
const HLS_managerRef HLSMgr
The HLS manager.
#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:54 for PandA-2024.02 by doxygen 1.8.13