PandA-2024.02
datapath_parallel_cs.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) 2016-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 "datapath_parallel_cs.hpp"
42 #include "BambuParameter.hpp"
43 #include "behavioral_helper.hpp"
44 #include "copyrights_strings.hpp"
45 #include "custom_set.hpp"
46 #include "dbgPrintHelper.hpp"
47 #include "function_behavior.hpp"
48 #include "hls.hpp"
49 #include "hls_device.hpp"
50 #include "hls_manager.hpp"
51 #include "loop.hpp"
52 #include "loops.hpp"
53 #include "math_function.hpp"
54 #include "memory.hpp"
55 #include "memory_cs.hpp"
56 #include "omp_functions.hpp"
57 #include "structural_manager.hpp"
58 #include "structural_objects.hpp"
59 #include "technology_manager.hpp"
60 #include "utility.hpp"
61 #include <cmath>
62 #include <list>
63 #include <string>
64 #include <tuple>
65 
67  unsigned int _funId, const DesignFlowManagerConstRef _design_flow_manager,
68  const HLSFlowStep_Type _hls_flow_step_type)
69  : classic_datapath(_parameters, _HLSMgr, _funId, _design_flow_manager, _hls_flow_step_type)
70 {
71  debug_level = parameters->get_class_debug_level(GET_CLASS(*this));
72 }
73 
74 // HLSFunctionStep(_parameters, _HLSMgr, _funId, _design_flow_manager, _hls_flow_step_type)
75 
77 
80 {
82  switch(relationship_type)
83  {
85  {
90  break;
91  }
93  {
94  break;
95  }
97  {
98  break;
99  }
100  default:
101  THROW_UNREACHABLE("");
102  }
103  return ret;
104 }
105 
107 {
109  const auto FB = HLSMgr->CGetFunctionBehavior(funId);
110  const structural_type_descriptorRef module_type(
111  new structural_type_descriptor("datapath_" + FB->CGetBehavioralHelper()->get_function_name()));
112  THROW_ASSERT(HLS, "");
115  HLS->datapath->set_top_info("Datapath_i", module_type);
116  const auto datapath_cir = HLS->datapath->get_circ();
117 
118  // Now the top circuit is created, just as an empty box. <circuit> is a reference to the structural object that
119  // will contain all the circuit components
120  datapath_cir->set_black_box(false);
121 
123  GetPointerS<module>(datapath_cir)
124  ->set_description("Datapath RTL descrition for " + FB->CGetBehavioralHelper()->get_function_name());
125  GetPointerS<module>(datapath_cir)->set_copyright(GENERATED_COPYRIGHT);
126  GetPointerS<module>(datapath_cir)->set_authors("Component automatically generated by bambu");
127  GetPointerS<module>(datapath_cir)->set_license(GENERATED_LICENSE);
128 
130  INDENT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "---Adding clock and reset ports");
132  add_clock_reset(clock, reset);
133 
135  INDENT_DBG_MEX(DEBUG_LEVEL_VERBOSE, debug_level, "---Adding ports for primary inputs and outputs");
136  add_ports();
137 
138  instantiate_component_parallel(clock, reset);
139 
140  std::vector<structural_objectRef> memory_modules;
141  const auto& SM = this->HLS->datapath;
142  const auto circuit = SM->get_circ();
143  const auto omp_functions = GetPointerS<const OmpFunctions>(HLSMgr->Rfuns);
144  const auto kernel_functions = omp_functions->kernel_functions;
145 #ifndef NDEBUG
146  if(kernel_functions.size() > 1)
147  {
148  for(const auto kernel_function : kernel_functions)
149  {
151  "Kernel function " +
152  HLSMgr->CGetFunctionBehavior(kernel_function)->CGetBehavioralHelper()->get_function_name());
153  }
154  THROW_UNREACHABLE("More than one kernel function");
155  }
156 #endif
157  const auto kernel_function_id = *(kernel_functions.begin());
158  const auto kernel_function_name =
159  HLSMgr->CGetFunctionBehavior(kernel_function_id)->CGetBehavioralHelper()->get_function_name();
160  const auto kernel_library = HLS->HLS_D->get_technology_manager()->get_library(kernel_function_name);
161  structural_objectRef kernel_mod;
162  auto addr_kernel = ceil_log2(parameters->getOption<unsigned long long>(OPT_num_accelerators));
163  if(!addr_kernel)
164  {
165  addr_kernel = 1;
166  }
167  for(unsigned int i = 0; i < parameters->getOption<unsigned int>(OPT_num_accelerators); ++i)
168  {
169  const auto kernel_module_name = kernel_function_name + "_" + STR(i);
170  kernel_mod = SM->add_module_from_technology_library(kernel_module_name, kernel_function_name, kernel_library,
171  circuit, HLS->HLS_D->get_technology_manager());
172  memory_modules.push_back(kernel_mod);
173  connect_module_kernel(kernel_mod, i);
174  // setting num of kernel in each scheduler
175  GetPointer<module>(kernel_mod)
176  ->SetParameter("KERN_NUM", STR(addr_kernel) + "'d" + STR(i)); // add num_kernel to kernel
177  }
178  manage_extern_global_port_parallel(SM, memory_modules, datapath_cir);
179  memory::propagate_memory_parameters(const_cast<structural_objectRef&>(kernel_mod),
180  SM); // propagate memory_parameter to datapath_parallel
181 
182  for(unsigned int i = 0; i < parameters->getOption<unsigned int>(OPT_num_accelerators); ++i)
183  {
184  kernel_mod = circuit->find_member(kernel_function_name + "_" + STR(i), component_o_K, circuit);
185  THROW_ASSERT(kernel_mod, "");
186  connect_i_module_kernel(kernel_mod);
187  }
189 }
190 
192 {
193  classic_datapath::add_ports(); // add standard port
194  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Added standard port kernel");
195  const structural_managerRef& SM = this->HLS->datapath;
196  const structural_objectRef circuit = SM->get_circ();
197  auto num_thread = parameters->getOption<unsigned int>(OPT_num_accelerators);
199  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Start adding new ports");
200  SM->add_port_vector(STR(DONE_PORT_NAME) + "_accelerator", port_o::OUT, num_thread, circuit, bool_type);
201  SM->add_port_vector(STR(DONE_REQUEST) + "_accelerator", port_o::OUT, num_thread, circuit, bool_type);
202  SM->add_port_vector(STR(START_PORT_NAME) + "_accelerator", port_o::IN, num_thread, circuit, bool_type);
203 
204  SM->add_port(STR(TASKS_POOL_END), port_o::IN, circuit, bool_type);
205  structural_type_descriptorRef request_type =
207  SM->add_port("request", port_o::IN, circuit, request_type);
209 }
210 
211 void datapath_parallel_cs::connect_module_kernel(structural_objectRef kernel_mod, unsigned int num_kernel)
212 {
213  const structural_managerRef SM = this->HLS->datapath;
214  const structural_objectRef circuit = SM->get_circ();
215  const FunctionBehaviorConstRef FB = HLSMgr->CGetFunctionBehavior(funId);
217  std::string prefix = "in_port_";
218 
219  structural_objectRef clock_kernel = kernel_mod->find_member(CLOCK_PORT_NAME, port_o_K, kernel_mod);
220  structural_objectRef clock_datapath = circuit->find_member(CLOCK_PORT_NAME, port_o_K, circuit);
221  SM->add_connection(clock_datapath, clock_kernel);
222  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, " - Connected clock port");
223 
224  structural_objectRef reset_kernel = kernel_mod->find_member(RESET_PORT_NAME, port_o_K, kernel_mod);
225  structural_objectRef reset_datapath = circuit->find_member(RESET_PORT_NAME, port_o_K, circuit);
226  SM->add_connection(reset_datapath, reset_kernel);
227  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, " - Connected reset port");
228 
229  const std::list<unsigned int>& function_parameters = BH->get_parameters();
230  for(auto const function_parameter : function_parameters)
231  {
232  structural_objectRef parameter_kernel =
233  kernel_mod->find_member(BH->PrintVariable(function_parameter), port_o_K, kernel_mod);
234  structural_objectRef parameter_datapath =
235  circuit->find_member(prefix + BH->PrintVariable(function_parameter), port_o_K, circuit);
236  if(parameter_datapath == nullptr)
237  {
238  structural_type_descriptorRef request_type =
240  SM->add_port(prefix + BH->PrintVariable(function_parameter), port_o::IN, circuit, request_type);
241  parameter_datapath = circuit->find_member(prefix + BH->PrintVariable(function_parameter), port_o_K, circuit);
242  }
243  std::cout << "Parameter: " << BH->PrintVariable(function_parameter) << std::endl;
244  if(parameter_kernel != nullptr)
245  {
246  SM->add_connection(parameter_datapath, parameter_kernel);
247  }
248  }
249  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, " - Connected parameter port");
250 
251  structural_objectRef task_pool_kernel = kernel_mod->find_member(TASKS_POOL_END, port_o_K, kernel_mod);
252  structural_objectRef task_pool_datapath = circuit->find_member(TASKS_POOL_END, port_o_K, circuit);
253  SM->add_connection(task_pool_datapath, task_pool_kernel);
254  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, " - Connected task_pool_end");
255 
256  structural_objectRef start_kernel = kernel_mod->find_member(START_PORT_NAME, port_o_K, kernel_mod);
257  structural_objectRef start_datapath =
258  circuit->find_member(STR(START_PORT_NAME) + "_accelerator", port_vector_o_K, circuit);
259  SM->add_connection(start_kernel, GetPointer<port_o>(start_datapath)->get_port(num_kernel));
260  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, " - Connected start");
261 
262  structural_objectRef done_kernel = kernel_mod->find_member(DONE_PORT_NAME, port_o_K, kernel_mod);
263  structural_objectRef done_datapath =
264  circuit->find_member(STR(DONE_PORT_NAME) + "_accelerator", port_vector_o_K, circuit);
265  SM->add_connection(done_kernel, GetPointer<port_o>(done_datapath)->get_port(num_kernel));
266  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, " - Connected done");
267 
268  structural_objectRef done_req_kernel = kernel_mod->find_member(DONE_REQUEST, port_o_K, kernel_mod);
269  structural_objectRef done_req_datapath =
270  circuit->find_member(STR(DONE_REQUEST) + "_accelerator", port_vector_o_K, circuit);
271  SM->add_connection(done_req_kernel, GetPointer<port_o>(done_req_datapath)->get_port(num_kernel));
272  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, " - Connected done_req");
273 }
274 
276 {
277  const structural_managerRef SM = this->HLS->datapath;
278  const structural_objectRef circuit = SM->get_circ();
279  structural_objectRef request_datapath = circuit->find_member("request", port_o_K, circuit);
280  for(unsigned int j = 0; j < GetPointer<module>(kernel_mod)->get_in_port_size(); j++) // find i
281  {
282  structural_objectRef port_i = GetPointer<module>(kernel_mod)->get_in_port(j);
283  structural_objectRef connectedPort = GetPointer<port_o>(port_i)->find_bounded_object();
284  if(connectedPort == nullptr)
285  {
286  std::cout << "Found i var" << std::endl;
287  SM->add_connection(request_datapath, port_i);
288  }
289  }
290  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, " - Connected request");
291 }
292 
294  structural_objectRef reset_port)
295 {
296  const structural_managerRef SM = HLS->datapath;
297  const structural_objectRef circuit = SM->get_circ();
298  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Start to instantiate memory_ctrl_parallel");
300  std::string mem_par_model = "memory_ctrl_parallel";
301  std::string mem_par_name = "memory_parallel";
302  std::string mem_par_library = HLS->HLS_D->get_technology_manager()->get_library(mem_par_model);
304  mem_par_name, mem_par_model, mem_par_library, circuit, HLS->HLS_D->get_technology_manager());
305 
306  structural_objectRef clock_mem_par = mem_par_mod->find_member(CLOCK_PORT_NAME, port_o_K, mem_par_mod);
307  structural_objectRef clock_sign = SM->add_sign("clock_mem_par_signal", circuit, bool_type);
308  SM->add_connection(clock_sign, clock_port);
309  SM->add_connection(clock_sign, clock_mem_par);
310 
311  structural_objectRef reset_mem_par = mem_par_mod->find_member(RESET_PORT_NAME, port_o_K, mem_par_mod);
312  structural_objectRef reset_sign = SM->add_sign("reset_mem_par_signal", circuit, bool_type);
313  SM->add_connection(reset_sign, reset_port);
314  SM->add_connection(reset_sign, reset_mem_par);
315  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Instantiated memory_ctrl_parallel!");
316 
317  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Starting setting parameter memory_ctrl_parallel!");
318  GetPointer<module>(mem_par_mod)
319  ->SetParameter("NUM_CHANNEL", STR(parameters->getOption<unsigned int>(OPT_channels_number)));
320  GetPointer<module>(mem_par_mod)
321  ->SetParameter("NUM_ACC", STR(parameters->getOption<unsigned int>(OPT_num_accelerators)));
322  auto addr_task = ceil_log2(parameters->getOption<unsigned long long int>(OPT_context_switch));
323  if(!addr_task)
324  {
325  addr_task = 1;
326  }
327  GetPointer<module>(mem_par_mod)->SetParameter("ADDR_TASKS", STR(addr_task));
328  auto addr_kern = ceil_log2(parameters->getOption<unsigned long long>(OPT_num_accelerators));
329  if(!addr_kern)
330  {
331  addr_kern = 1;
332  }
333  GetPointer<module>(mem_par_mod)->SetParameter("ADDR_ACC", STR(addr_kern));
334  PRINT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Parameter memory_ctrl_top set!");
335 
336  resize_ctrl_parallel_ports(mem_par_mod);
337 }
338 
340 {
341  auto memory_channel = parameters->getOption<unsigned int>(OPT_channels_number);
342  auto num_kernel = parameters->getOption<unsigned int>(OPT_num_accelerators);
343  for(unsigned int j = 0; j < GetPointer<module>(mem_par_mod)->get_in_port_size(); j++) // resize input port
344  {
345  structural_objectRef port_i = GetPointer<module>(mem_par_mod)->get_in_port(j);
346  if(GetPointer<port_o>(port_i)->get_is_memory())
347  {
348  std::string port_name = GetPointer<port_o>(port_i)->get_id();
349  if(port_name.substr(0, 3) == "IN_")
350  {
351  resize_dimension_bus_port(memory_channel, port_i);
352  }
353  else
354  {
355  resize_dimension_bus_port(num_kernel, port_i);
356  }
357  }
358  }
359  for(unsigned int j = 0; j < GetPointer<module>(mem_par_mod)->get_out_port_size(); j++) // resize output port
360  {
361  structural_objectRef port_i = GetPointer<module>(mem_par_mod)->get_out_port(j);
362  if(GetPointer<port_o>(port_i)->get_is_memory())
363  {
364  std::string port_name = GetPointer<port_o>(port_i)->get_id();
365  if(port_name.substr(0, 4) == "OUT_")
366  {
367  resize_dimension_bus_port(memory_channel, port_i);
368  }
369  else
370  {
371  resize_dimension_bus_port(num_kernel, port_i);
372  }
373  }
374  }
375 }
376 
378 {
379  auto bus_data_bitsize = HLSMgr->Rmem->get_bus_data_bitsize();
380  auto bus_addr_bitsize = HLSMgr->get_address_bitsize();
381  auto bus_size_bitsize = HLSMgr->Rmem->get_bus_size_bitsize();
382  auto bus_tag_bitsize = GetPointer<memory_cs>(HLSMgr->Rmem)->get_bus_tag_bitsize();
383 
384  if(GetPointer<port_o>(port)->get_is_data_bus())
385  {
386  port->type_resize(bus_data_bitsize);
387  }
388  else if(GetPointer<port_o>(port)->get_is_addr_bus())
389  {
390  port->type_resize(bus_addr_bitsize);
391  }
392  else if(GetPointer<port_o>(port)->get_is_size_bus())
393  {
394  port->type_resize(bus_size_bitsize);
395  }
396  else if(GetPointer<port_o>(port)->get_is_tag_bus())
397  {
398  port->type_resize(bus_tag_bitsize);
399  }
400 
401  GetPointer<port_o>(port)->add_n_ports(vector_size, port);
402 }
403 
405  const std::vector<structural_objectRef>& memory_modules,
406  const structural_objectRef circuit)
407 {
408  structural_objectRef cir_port;
409  structural_objectRef mem_paral_port;
410  structural_objectRef memory_parallel = circuit->find_member("memory_parallel", component_o_K, circuit);
411  unsigned int num_kernel = 0;
412  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "-->Connecting memory_port of memory_parallel");
413  for(const auto& memory_module : memory_modules)
414  {
415  for(unsigned int j = 0; j < GetPointer<module>(memory_module)->get_in_port_size();
416  j++) // from ctrl_parallel to module
417  {
418  structural_objectRef port_i = GetPointer<module>(memory_module)->get_in_port(j);
419  if(GetPointer<port_o>(port_i)->get_is_memory() && GetPointer<port_o>(port_i)->get_is_global() &&
420  GetPointer<port_o>(port_i)->get_is_extern())
421  {
422  std::string port_name = GetPointer<port_o>(port_i)->get_id();
423  mem_paral_port = memory_parallel->find_member(port_name, port_vector_o_K, memory_parallel);
424  structural_objectRef mem_paral_Sign =
425  SM->add_sign(port_name + "_signal_" + STR(num_kernel), circuit, port_i->get_typeRef());
426  THROW_ASSERT(!mem_paral_port || GetPointer<port_o>(mem_paral_port), "should be a port");
427  SM->add_connection(GetPointer<port_o>(mem_paral_port)->get_port(num_kernel), mem_paral_Sign);
428  SM->add_connection(mem_paral_Sign, port_i);
429  }
430  }
431  for(unsigned int j = 0; j < GetPointer<module>(memory_module)->get_out_port_size();
432  j++) // from module to ctrl_parallel
433  {
434  structural_objectRef port_i = GetPointer<module>(memory_module)->get_out_port(j);
435  if(GetPointer<port_o>(port_i)->get_is_memory() && !GetPointer<port_o>(port_i)->get_is_global() &&
436  !GetPointer<port_o>(port_i)->get_is_extern())
437  {
438  std::string port_name = GetPointer<port_o>(port_i)->get_id();
439  mem_paral_port = memory_parallel->find_member(port_name, port_vector_o_K, memory_parallel);
440  structural_objectRef mem_paral_Sign =
441  SM->add_sign(port_name + "_signal_" + STR(num_kernel), circuit, port_i->get_typeRef());
442  THROW_ASSERT(!mem_paral_port || GetPointer<port_o>(mem_paral_port), "should be a port");
443  SM->add_connection(port_i, mem_paral_Sign);
444  SM->add_connection(mem_paral_Sign, GetPointer<port_o>(mem_paral_port)->get_port(num_kernel));
445  }
446  }
447  ++num_kernel;
448  }
449 
450  for(unsigned int j = 0; j < GetPointer<module>(memory_parallel)->get_in_port_size();
451  j++) // connect input ctrl_parallel with input datapath
452  {
453  structural_objectRef port_i = GetPointer<module>(memory_parallel)->get_in_port(j);
454  std::string port_name = GetPointer<port_o>(port_i)->get_id();
455  if(GetPointer<port_o>(port_i)->get_is_memory() && GetPointer<port_o>(port_i)->get_is_global() &&
456  GetPointer<port_o>(port_i)->get_is_extern() && port_name.substr(0, 3) == "IN_")
457  {
458  cir_port = circuit->find_member(port_name.erase(0, 3), port_i->get_kind(), circuit);
459  THROW_ASSERT(!cir_port || GetPointer<port_o>(cir_port), "should be a port or null");
460  if(!cir_port)
461  {
462  cir_port = SM->add_port_vector(port_name, port_o::IN, GetPointer<port_o>(port_i)->get_ports_size(), circuit,
463  port_i->get_typeRef());
464  port_o::fix_port_properties(port_i, cir_port);
465  SM->add_connection(cir_port, port_i);
466  }
467  else
468  {
469  SM->add_connection(cir_port, port_i);
470  }
471  }
472  }
473  for(unsigned int j = 0; j < GetPointer<module>(memory_parallel)->get_out_port_size();
474  j++) // connect output ctrl_parallel with output datapath
475  {
476  structural_objectRef port_i = GetPointer<module>(memory_parallel)->get_out_port(j);
477  std::string port_name = GetPointer<port_o>(port_i)->get_id();
478  if(GetPointer<port_o>(port_i)->get_is_memory() && !GetPointer<port_o>(port_i)->get_is_global() &&
479  !GetPointer<port_o>(port_i)->get_is_extern() && port_name.substr(0, 4) == "OUT_")
480  {
481  cir_port =
482  circuit->find_member(port_name.erase(0, 4), port_i->get_kind(), circuit); // delete OUT from port name
483  THROW_ASSERT(!cir_port || GetPointer<port_o>(cir_port), "should be a port or null");
484  if(!cir_port)
485  {
486  cir_port = SM->add_port_vector(port_name, port_o::OUT, GetPointer<port_o>(port_i)->get_ports_size(),
487  circuit, port_i->get_typeRef());
488  port_o::fix_port_properties(port_i, cir_port);
489  SM->add_connection(cir_port, port_i);
490  }
491  else
492  {
493  SM->add_connection(cir_port, port_i);
494  }
495  }
496  }
497  INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "<--Connected memory_port of memory_parallel");
498 }
~datapath_parallel_cs() override
Destructor.
static void propagate_memory_parameters(const structural_objectRef src, const structural_managerRef tgt)
Propagates the memory parameters from the source (innermost) module to the target (outermost) one...
Definition: memory.cpp:654
void add_connection(structural_objectRef src, structural_objectRef dest)
Create a connection between a source structural object and a destination structural object...
#define TASKS_POOL_END
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
Data structure representing the entire HLS information.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
refcount< structural_type_descriptor > structural_type_descriptorRef
RefCount type definition of the structural_type_descriptor class structure.
File containing functions and utilities to support the printing of debug messagges.
#define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
#define DONE_REQUEST
structural_managerRef datapath
Store the datapath description.
Definition: hls.hpp:155
#define START_PORT_NAME
Structure representing the most relevant information about the type of a structural object...
const ParameterConstRef Param
class containing all the parameters
Definition: hls.hpp:169
virtual void add_ports()
Adds the input/output ports of the module.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
#define GENERATED_LICENSE
const structural_objectRef get_circ() const
Get a reference to circ field.
void reset()
Definition: adpcm.c:540
RelationshipType
The relationship type.
Source must be executed to satisfy target.
mathematical utility function not provided by standard libraries
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
void manage_extern_global_port_parallel(const structural_managerRef SM, const std::vector< structural_objectRef > &memory_modules, const structural_objectRef circuit)
connect mem_parallel with datapath and kernels
This class manages the circuit structures.
const HLS_deviceRef HLS_D
reference to the information representing the target for the synthesis
Definition: hls.hpp:107
virtual structural_objectRef find_member(const std::string &id, so_kind type, const structural_objectRef owner) const =0
Return the object named id of a given type which belongs to or it is associated with the object...
Class specification of the manager of the technology library data structures.
#define STR(s)
Macro which performs a lexical_cast to a string.
void add_ports() override
Adds the input/output ports of the module.
void connect_module_kernel(structural_objectRef kernel, unsigned int num_kernel)
connect datapath with each kernel
DesignFlowStep_Status InternalExec() override
InternalExec.
#define CLOCK_PORT_NAME
standard name for ports
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
T ceil_log2(T x)
Return the smallest n such that 2**n >= X.
const std::list< unsigned int > get_parameters() const
Return the list of index of original parameters of the function.
void set_top_info(const std::string &id, const technology_managerRef &LM, const std::string &Library="")
#define DONE_PORT_NAME
HLSFlowStep_Type
Definition: hls_step.hpp:95
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.
redefinition of set to manage ordered/unordered structures
void set_black_box(bool bb)
Set the black box property associated with the structural_object.
static void fix_port_properties(structural_objectRef port_i, structural_objectRef cir_port)
copy the port properties from port_i to cir_port
const BehavioralHelperConstRef CGetBehavioralHelper() const
Returns the helper associated with the function.
virtual enum so_kind get_kind() const =0
Virtual function used to find the real type of a structural_object instance.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
This file collects some utility functions and macros.
void instantiate_component_parallel(structural_objectRef clock_port, structural_objectRef reset_port)
instantiate memory_parallel
#define DEBUG_LEVEL_NONE
no debugging print is performed.
std::string PrintVariable(unsigned int var) const
Print the name of the variable associated to the index.
refcount< structural_manager > structural_managerRef
RefCount type definition of the structural_manager class structure.
void type_resize(unsigned long long new_bit_size)
Just resize the size of the bits of the object.
void resize_dimension_bus_port(unsigned int vector_size, structural_objectRef port)
for each port resize it depending on the type of bus port
structural_objectRef add_module_from_technology_library(const std::string &id, const std::string &fu_name, const std::string &library_name, const structural_objectRef owner, const technology_managerConstRef TM)
Create a new object starting from a library component.
void resize_ctrl_parallel_ports(structural_objectRef mem_par_mod)
for each port decide the vector size
void connect_i_module_kernel(structural_objectRef kernel)
connect datapath with each kernel
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 structural_objectRef add_sign(std::string id, structural_objectRef owner, structural_type_descriptorRef sign_type, unsigned int treenode=0)
Create a new signal.
void add_clock_reset(structural_objectRef &clock_obj, structural_objectRef &reset_obj)
Adds the clock and reset ports to the structural description of the circuit.
hlsRef HLS
HLS data structure of the function to be analyzed.
interface of a loop
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
interface of loops finding algorithm
It collects all the common strings covering PandA copyrights issues.
datapath_parallel_cs(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type)
Constructor.
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
ComputeHLSRelationships datapath need kernel in order to be created.
#define RESET_PORT_NAME
Class implementation of the structural_manager.
int debug_level
The debug level.
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
Definition: hls_step.hpp:93
Datastructure to describe functions allocation in high-level synthesis.
#define DEBUG_LEVEL_VERBOSE
verbose debugging print is performed.
Data structure definition for high-level synthesis flow.
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.
#define GENERATED_COPYRIGHT
Datastructure to represent memory information in high-level synthesis.
HLS specialization of generic_device.
A brief description of the C++ Header File.
#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:53 for PandA-2024.02 by doxygen 1.8.13