PandA-2024.02
fun_dominator_allocation.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  */
44 
45 #include "config_HAVE_FROM_PRAGMA_BUILT.hpp"
46 #include "config_HAVE_PRAGMA_BUILT.hpp"
47 
48 #include "Dominance.hpp"
49 #include "Parameter.hpp"
51 #include "behavioral_helper.hpp"
52 #include "call_graph.hpp"
53 #include "call_graph_manager.hpp"
54 #include "constant_strings.hpp"
55 #include "cpu_time.hpp"
56 #include "design_flow_graph.hpp"
57 #include "design_flow_manager.hpp"
59 #include "function_behavior.hpp"
60 #include "functions.hpp"
61 #include "hls.hpp"
62 #include "hls_constraints.hpp"
63 #include "hls_device.hpp"
64 #include "hls_manager.hpp"
65 #include "library_manager.hpp"
66 #include "op_graph.hpp"
67 #include "string_manipulation.hpp"
68 #include "technology_flow_step.hpp"
70 #include "technology_manager.hpp"
71 #include "technology_node.hpp"
72 #include "tree_helper.hpp"
73 #include "tree_manager.hpp"
74 #include "tree_node.hpp"
75 #include "utility.hpp"
76 
77 #include <boost/range/adaptor/reversed.hpp>
78 
80  const DesignFlowManagerConstRef _design_flow_manager,
81  const HLSFlowStep_Type _hls_flow_step_type)
82  : function_allocation(_parameters, _HLSMgr, _design_flow_manager, _hls_flow_step_type), already_executed(false)
83 {
84  debug_level = parameters->get_class_debug_level(GET_CLASS(*this));
85 }
86 
88 
90  const DesignFlowStep::RelationshipType relationship_type)
91 {
92  switch(relationship_type)
93  {
95  {
96  const auto design_flow_graph = design_flow_manager.lock()->CGetDesignFlowGraph();
97  const auto frontend_flow_step_factory = GetPointer<const FrontendFlowStepFactory>(
98  design_flow_manager.lock()->CGetDesignFlowStepFactory("Frontend"));
99  const auto frontend_flow_signature = ApplicationFrontendFlowStep::ComputeSignature(BAMBU_FRONTEND_FLOW);
100  const auto frontend_flow_step = design_flow_manager.lock()->GetDesignFlowStep(frontend_flow_signature);
101  const auto design_flow_step =
102  frontend_flow_step ? design_flow_graph->CGetDesignFlowStepInfo(frontend_flow_step)->design_flow_step :
103  frontend_flow_step_factory->CreateApplicationFrontendFlowStep(BAMBU_FRONTEND_FLOW);
104  relationship.insert(design_flow_step);
105 
106  const auto technology_flow_step_factory = GetPointer<const TechnologyFlowStepFactory>(
107  design_flow_manager.lock()->CGetDesignFlowStepFactory("Technology"));
108  const auto technology_flow_signature =
110  const auto technology_flow_step = design_flow_manager.lock()->GetDesignFlowStep(technology_flow_signature);
111  const auto technology_design_flow_step =
112  technology_flow_step ?
113  design_flow_graph->CGetDesignFlowStepInfo(technology_flow_step)->design_flow_step :
114  technology_flow_step_factory->CreateTechnologyFlowStep(TechnologyFlowStep_Type::LOAD_TECHNOLOGY);
115  relationship.insert(technology_design_flow_step);
116  break;
117  }
119  {
120  break;
121  }
123  {
124  break;
125  }
126  default:
127  THROW_UNREACHABLE("");
128  }
129  function_allocation::ComputeRelationships(relationship, relationship_type);
130 }
131 
132 const std::set<std::string> fun_dominator_allocation::simple_functions = {"__builtin_cond_expr32", "llabs",
133  "__builtin_llabs", "labs", "__builtin_labs"};
134 
136 {
137  return !already_executed;
138 }
139 
141 {
142  already_executed = true;
143  const auto CGM = HLSMgr->GetCallGraphManager();
144  const auto HLS_D = HLSMgr->get_HLS_device();
145  const auto TechM = HLS_D->get_technology_manager();
146  const auto io_proxies_only =
147  parameters->isOption(OPT_disable_function_proxy) && parameters->getOption<bool>(OPT_disable_function_proxy);
148 
149  auto root_functions = CGM->GetRootFunctions();
150  if(parameters->isOption(OPT_top_design_name)) // top design function become the top_vertex
151  {
152  const auto top_rtldesign_function =
153  HLSMgr->get_tree_manager()->GetFunction(parameters->getOption<std::string>(OPT_top_design_name));
154  if(top_rtldesign_function && root_functions.count(top_rtldesign_function->index))
155  {
156  root_functions.clear();
157  root_functions.insert(top_rtldesign_function->index);
158  }
159  }
160 
161  CustomOrderedSet<unsigned int> reached_from_all;
162  for(const auto f_id : root_functions)
163  {
164  for(const auto reached_f_id : CGM->GetReachedFunctionsFrom(f_id, false))
165  {
166  reached_from_all.insert(reached_f_id);
167  }
168  }
169 
170  // manage function constraints first
171  CustomOrderedSet<unsigned int> functions_constrained;
172  if(parameters->isOption(OPT_constraints_functions))
173  {
174  auto tmp_string = parameters->getOption<std::string>(OPT_constraints_functions);
175  const auto funcs_values = string_to_container<std::vector<std::string>>(tmp_string, ",");
176  for(auto fun_resources : funcs_values)
177  {
178  if(!fun_resources.empty() && fun_resources.at(0) == '=')
179  {
180  fun_resources = fun_resources.substr(1);
181  }
182  const auto splitted = SplitString(fun_resources, "=");
183  auto TM = HLSMgr->get_tree_manager();
184  for(auto funid : reached_from_all)
185  {
186  auto* decl_node = GetPointer<function_decl>(TM->GetTreeNode(funid));
188  const auto fu_name = functions::GetFUName(fname, HLSMgr);
189  if(fu_name.find(STR_CST_interface_parameter_keyword) != std::string::npos || TM->is_top_function(decl_node))
190  {
191  continue;
192  }
193 
194  if(!splitted.empty() && (fu_name == splitted.at(0) || splitted.at(0) == "*" ||
195  (splitted.at(0).max_size() > 1 && splitted.at(0).at(0) == '*' &&
196  fu_name.find(splitted.at(0).substr(1)) == 0)))
197  {
198  functions_constrained.insert(funid);
199  unsigned num_resources = 0;
200  if(splitted.size() == 1)
201  {
202  num_resources = 1;
203  }
204  else if(splitted.size() == 2)
205  {
206  auto res_num = splitted.at(1);
207  std::transform(res_num.begin(), res_num.end(), res_num.begin(),
208  [](unsigned char c) { return std::tolower(c); });
209  if(splitted.at(1) == "u")
210  {
211  continue;
212  }
213  num_resources = static_cast<unsigned>(std::stoul(res_num));
214  }
215  else
216  {
217  THROW_ERROR("unexpected --constraints format");
218  }
219  HLSMgr->global_resource_constraints[std::make_pair(fu_name, WORK_LIBRARY)] =
220  std::make_pair(num_resources, 1);
221 
222  INDENT_OUT_MEX(OUTPUT_LEVEL_MINIMUM, parameters->getOption<int>(OPT_output_level),
223  "Constraining function " + fu_name + " with " + STR(num_resources) + " resources");
224  }
225  }
226  }
227  }
228  if(!parameters->isOption(OPT_top_functions_names))
229  {
231  "---@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
232  for(const auto f_id : root_functions)
233  {
234  const auto function_behavior = HLSMgr->CGetFunctionBehavior(f_id);
235  const auto BH = function_behavior->CGetBehavioralHelper();
236  const auto fname = BH->get_function_name();
238  "---The top function inferred from the specification is: " + fname);
239  }
241  "---@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
242  }
243 
246  {
248  }
249  INDENT_OUT_MEX(OUTPUT_LEVEL_MINIMUM, output_level, "-->Functions to be synthesized:");
250  for(const auto& funID : reached_from_all)
251  {
252  const auto function_behavior = HLSMgr->CGetFunctionBehavior(funID);
253  const auto BH = function_behavior->CGetBehavioralHelper();
254  const auto fname = BH->get_function_name();
256  GetPointerS<const function_decl>(HLSMgr->get_tree_manager()->CGetTreeNode(funID))))
257  {
259  "---Warning: " + fname + " is empty or the compiler killed all the statements");
260  }
261  if(BH->has_implementation())
262  {
264  }
265  if(functions_constrained.find(funID) != functions_constrained.end())
266  {
267  continue;
268  }
269  }
272  {
274  }
275 
276  for(const auto& top_fid : root_functions)
277  {
279  "-->Allocation thread: " +
280  HLSMgr->CGetFunctionBehavior(top_fid)->CGetBehavioralHelper()->get_function_name());
281  const auto top_vertex = CGM->GetVertex(top_fid);
282  const auto reached_from_top = CGM->GetReachedFunctionsFrom(top_fid, false);
283  const auto subgraph = [&]() {
285  subset.insert(top_vertex);
286  std::transform(reached_from_top.begin(), reached_from_top.end(), std::inserter(subset, subset.end()),
287  [&](unsigned int fid) { return CGM->GetVertex(fid); });
288  return CGM->CGetCallSubGraph(subset);
289  }();
290 
291  if(boost::num_vertices(*subgraph) < 2)
292  {
293  INDENT_DBG_MEX(DEBUG_LEVEL_PEDANTIC, debug_level, "<--Empty thread");
294  continue;
295  }
296 
298  const auto cg_dominators =
299  refcount<dominance<graph>>(new dominance<graph>(*subgraph, top_vertex, NULL_VERTEX, parameters));
300  cg_dominators->calculate_dominance_info(dominance<graph>::CDI_DOMINATORS);
301  const auto& cg_dominator_map = cg_dominators->get_dominator_map();
304  CustomMap<std::string, bool> indirectlyCalled;
305 
306  std::list<vertex> topology_sorted_vertex;
307  subgraph->TopologicalSort(topology_sorted_vertex);
308  for(const auto& current_vertex : topology_sorted_vertex)
309  {
310  vertex vert_dominator;
311  if(boost::in_degree(current_vertex, *subgraph) != 1)
312  {
313  vert_dominator = cg_dominator_map.at(current_vertex);
314  }
315  else
316  {
317  vert_dominator = current_vertex;
318  }
319  if(boost::out_degree(current_vertex, *subgraph))
320  {
321  const auto current_id = CGM->get_function(current_vertex);
322  THROW_ASSERT(HLSMgr->get_HLS(current_id),
323  "Missing HLS initialization for " +
324  HLSMgr->CGetFunctionBehavior(current_id)->CGetBehavioralHelper()->get_function_name());
325  const auto HLS_C = HLSMgr->get_HLS(current_id)->HLS_C;
326  THROW_ASSERT(cg_dominator_map.find(current_vertex) != cg_dominator_map.end(),
327  "Dominator vertex not in the dominator tree: " +
328  HLSMgr->CGetFunctionBehavior(current_id)->CGetBehavioralHelper()->get_function_name());
329  BOOST_FOREACH(EdgeDescriptor eo, boost::out_edges(current_vertex, *subgraph))
330  {
331  auto called_fu_id = CGM->get_function(boost::target(eo, *subgraph));
332  const auto called_fu_name = functions::GetFUName(called_fu_id, HLSMgr);
333  unsigned multiplicity = 1;
334  // check if global constraints are actually propagated. It may happen in case this class add them
335  if(HLSMgr->global_resource_constraints.find(std::make_pair(called_fu_name, WORK_LIBRARY)) !=
336  HLSMgr->global_resource_constraints.end())
337  {
338  auto c = HLSMgr->global_resource_constraints.at(std::make_pair(called_fu_name, WORK_LIBRARY));
339  auto curr_res_n = HLS_C->get_number_fu(called_fu_name, WORK_LIBRARY);
340  if(curr_res_n != c.first)
341  {
343  OUTPUT_LEVEL_MINIMUM, parameters->getOption<int>(OPT_output_level),
344  "---Upgraded function constraints for " +
345  HLSMgr->CGetFunctionBehavior(current_id)->CGetBehavioralHelper()->get_function_name() +
346  " with " + STR(c.first) + " resources of " + called_fu_name + ", before was " +
347  (curr_res_n == INFINITE_UINT ? "INF" : STR(curr_res_n)));
348  HLS_C->set_number_fu(called_fu_name, WORK_LIBRARY, c.first);
349  }
350  multiplicity = c.second;
351  }
352  else if(HLSMgr->global_resource_constraints.find(std::make_pair(called_fu_name, INTERFACE_LIBRARY)) !=
353  HLSMgr->global_resource_constraints.end())
354  {
355  auto c = HLSMgr->global_resource_constraints.at(std::make_pair(called_fu_name, INTERFACE_LIBRARY));
356  if(HLS_C->get_number_fu(called_fu_name, INTERFACE_LIBRARY) != c.first)
357  {
358  HLS_C->set_number_fu(called_fu_name, INTERFACE_LIBRARY, c.first);
360  OUTPUT_LEVEL_MINIMUM, parameters->getOption<int>(OPT_output_level),
361  "---Upgraded function constraints for " +
362  HLSMgr->CGetFunctionBehavior(current_id)->CGetBehavioralHelper()->get_function_name() +
363  " with " + STR(c.first) + " resources of " + called_fu_name);
364  }
365  multiplicity = c.second;
366  }
367 
368  // std::cerr << "called_fu_name=" << called_fu_name << "\n";
369  // std::cerr << "res=" << HLS_C->get_number_fu(called_fu_name, WORK_LIBRARY) << "\n";
370  // std::cerr << "res=" << HLS_C->get_number_fu(called_fu_name, INTERFACE_LIBRARY) << "\n";
371  // std::cerr << "multiplicity=" << multiplicity << "\n";
372 
373  if(simple_functions.find(called_fu_name) == simple_functions.end() &&
374  functions_constrained.find(called_fu_id) == functions_constrained.end() &&
375  ((HLS_C->get_number_fu(called_fu_name, WORK_LIBRARY) == INFINITE_UINT &&
376  HLS_C->get_number_fu(called_fu_name, INTERFACE_LIBRARY) == INFINITE_UINT) || // without constraints
377  HLS_C->get_number_fu(called_fu_name, WORK_LIBRARY) / multiplicity ==
378  1 || // or single instance functions
379  HLS_C->get_number_fu(called_fu_name, INTERFACE_LIBRARY) / multiplicity ==
380  1 // or single instance interface functions
381  ))
382  {
383  fun_dom_map[called_fu_name].insert(vert_dominator);
384  const auto info = Cget_edge_info<FunctionEdgeInfo, const CallGraph>(eo, *subgraph);
385 
386  if(info->direct_call_points.size())
387  {
388  where_used[called_fu_name].insert(current_id);
389  }
390  else
391  {
392  where_used[called_fu_name];
393  }
394 
395  if(info->indirect_call_points.size() || info->function_addresses.size())
396  {
397  indirectlyCalled[called_fu_name] = true;
398  }
399  else
400  {
401  indirectlyCalled[called_fu_name] = false;
402  }
403  }
405  "---Dominator vertex: " +
406  HLSMgr->CGetFunctionBehavior(CGM->get_function(vert_dominator))
407  ->CGetBehavioralHelper()
408  ->get_function_name() +
409  " => " + called_fu_name);
410  }
411  }
412  }
415  num_instances[functions::GetFUName(top_fid, HLSMgr)] = 1;
416  CustomMap<unsigned int, std::vector<std::string>> function_allocation_map;
417  for(const auto& cur : topology_sorted_vertex)
418  {
419  const auto cur_id = CGM->get_function(cur);
420  if(reached_from_top.find(cur_id) != reached_from_top.end())
421  {
422  const auto cur_fu_name = functions::GetFUName(cur_id, HLSMgr);
423  THROW_ASSERT(num_instances.count(cur_fu_name),
424  "missing number of instances of function " +
425  HLSMgr->CGetFunctionBehavior(cur_id)->CGetBehavioralHelper()->get_function_name());
426  function_allocation_map[cur_id];
427  const auto cur_instances = num_instances.at(cur_fu_name);
428  BOOST_FOREACH(EdgeDescriptor eo, boost::out_edges(cur, *subgraph))
429  {
430  const auto tgt = boost::target(eo, *subgraph);
431  const auto tgt_fu_name = functions::GetFUName(CGM->get_function(tgt), HLSMgr);
432  const auto n_call_points = static_cast<unsigned int>(
433  Cget_edge_info<FunctionEdgeInfo, const CallGraph>(eo, *subgraph)->direct_call_points.size());
434  if(num_instances.find(tgt_fu_name) == num_instances.end())
435  {
436  num_instances[tgt_fu_name] = cur_instances * n_call_points;
437  }
438  else
439  {
440  num_instances[tgt_fu_name] += cur_instances * n_call_points;
441  }
442  }
443  }
444  }
445 
446  THROW_ASSERT(num_instances.at(functions::GetFUName(top_fid, HLSMgr)) == 1,
447  "top function cannot be called from some other function");
449  for(const auto& dom_map : fun_dom_map)
450  {
451  unsigned int cur_id = 0;
452  if(dom_map.second.size() == 1)
453  {
454  auto cur = *dom_map.second.begin();
455  while(num_instances.at(functions::GetFUName(CGM->get_function(cur), HLSMgr)) != 1)
456  {
457  cur = cg_dominator_map.at(cur);
458  }
459  cur_id = CGM->get_function(cur);
460  }
461  else
462  {
463  if(dom_map.second.count(top_vertex))
464  {
465  cur_id = top_fid;
466  }
467  else
468  {
469  auto vert_it = dom_map.second.begin();
470  const auto vert_it_end = dom_map.second.end();
471  std::list<vertex> dominator_list1;
472  vertex cur = *vert_it;
473  dominator_list1.push_front(cur);
474  do
475  {
476  THROW_ASSERT(cg_dominator_map.count(cur), "");
477  cur = cg_dominator_map.at(cur);
478  dominator_list1.push_front(cur);
479  } while(cur != top_vertex);
480  ++vert_it;
481  auto last = dominator_list1.end();
482  for(; vert_it != vert_it_end; ++vert_it)
483  {
484  std::list<vertex> dominator_list2;
485  cur = *vert_it;
486  dominator_list2.push_front(cur);
487  do
488  {
489  THROW_ASSERT(cg_dominator_map.count(cur), "");
490  cur = cg_dominator_map.at(cur);
491  dominator_list2.push_front(cur);
492  } while(cur != top_vertex);
494  auto dl1_it = dominator_list1.begin(), dl2_it = dominator_list2.begin(),
495  dl2_it_end = dominator_list2.end(), cur_last = dominator_list1.begin();
496  while(dl1_it != last && dl2_it != dl2_it_end && *dl1_it == *dl2_it &&
497  (num_instances.at(functions::GetFUName(CGM->get_function(*dl1_it), HLSMgr)) == 1))
498  {
499  cur = *dl1_it;
500  ++dl1_it;
501  cur_last = dl1_it;
502  ++dl2_it;
503  }
504  last = cur_last;
505  cur_id = CGM->get_function(cur);
506  if(cur == top_vertex)
507  {
508  break;
509  }
510  }
511  }
512  }
513  THROW_ASSERT(cur_id, "null function id index unexpected");
515  "---Function " + functions::GetFUName(dom_map.first, HLSMgr) + " may be allocated in " +
516  HLSMgr->CGetFunctionBehavior(cur_id)->CGetBehavioralHelper()->get_function_name());
517  function_allocation_map[cur_id].push_back(dom_map.first);
518  }
519 
521  for(const auto& funID : reached_from_top)
522  {
523  THROW_ASSERT(function_allocation_map.find(funID) != function_allocation_map.end(),
524  "Expected function allocation map for function " +
525  HLSMgr->CGetFunctionBehavior(funID)->CGetBehavioralHelper()->get_function_name());
526  for(const auto& fu_name : function_allocation_map.at(funID))
527  {
528  if(io_proxies_only && fu_name.find(STR_CST_interface_parameter_keyword) == std::string::npos)
529  {
530  INDENT_DBG_MEX(DEBUG_LEVEL_PEDANTIC, debug_level, "Unconstrained allocation for " + fu_name);
531  continue;
532  }
533  if(functions_constrained.find(funID) != functions_constrained.end())
534  {
535  INDENT_DBG_MEX(DEBUG_LEVEL_PEDANTIC, debug_level, "Unconstrained allocation for " + fu_name);
536  continue;
537  }
539  "Allocating " + fu_name + " in " +
540  HLSMgr->CGetFunctionBehavior(funID)->CGetBehavioralHelper()->get_function_name());
541  THROW_ASSERT(where_used.at(fu_name).size() > 0 || indirectlyCalled.at(fu_name),
542  fu_name + " not used anywhere");
543  if(where_used.at(fu_name).size() == 1)
544  {
546  "---Skipped because called only by one other function");
547  continue;
548  }
549  const auto fnode = HLSMgr->get_tree_manager()->GetFunction(fu_name);
550  if(fnode && HLSMgr->hasToBeInterfaced(fnode->index))
551  {
552  INDENT_DBG_MEX(DEBUG_LEVEL_PEDANTIC, debug_level, "---Skipped because it has to be interfaced");
553  continue;
554  }
555  const auto library_name = TechM->get_library(fu_name);
556  if(library_name != "")
557  {
558  const auto libraryManager = TechM->get_library_manager(library_name);
559  const auto techNode_obj = libraryManager->get_fu(fu_name);
560  if(GetPointer<functional_unit_template>(techNode_obj))
561  {
562  continue;
563  }
564  }
565 
566  HLSMgr->Rfuns->map_shared_function(funID, fu_name);
567 
568  const auto cur_function_behavior = HLSMgr->CGetFunctionBehavior(funID);
569  const auto cur_BH = cur_function_behavior->CGetBehavioralHelper();
571  "---Adding proxy wrapper in function " + cur_BH->get_function_name());
573  for(const auto& wu_id : where_used.at(fu_name))
574  {
575  if(wu_id != funID)
576  {
577  const auto wiu_function_behavior = HLSMgr->CGetFunctionBehavior(wu_id);
578  const auto wiu_BH = wiu_function_behavior->CGetBehavioralHelper();
580  "---Adding proxy function in function " + wiu_BH->get_function_name());
581  HLSMgr->Rfuns->add_shared_function_proxy(wu_id, fu_name);
582  }
583  }
584  }
585  }
587  }
588 
590 }
bool already_executed
True if this step has yet been executed.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
static bool is_a_nop_function_decl(const function_decl *fd)
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;.
Dominator o post-dominator data structure.
Definition: Dominance.hpp:627
#define STR_CST_interface_parameter_keyword
interface_parameter_keyword
#define DEBUG_LEVEL_PEDANTIC
very verbose debugging print is performed.
string target
Definition: lenet_tvm.py:16
#define GET_CLASS(obj)
Macro returning the actual type of an object.
const int output_level
The output level.
const std::vector< std::string > SplitString(const std::string &input, const std::string &separators)
Function which splits a string into tokens.
RelationshipType
The relationship type.
Source must be executed to satisfy target.
#define INDENT_OUT_MEX(outLevel, curOutLevel, mex)
CustomOrderedMap< T, U > CustomMap
Definition: custom_map.hpp:167
DesignFlowStep_Status Exec() override
Execute the step.
Class specification of the manager of the technology library data structures.
#define INTERFACE_LIBRARY
interface library
#define OUTPUT_LEVEL_MINIMUM
minimum debugging print is performed.
Include a set of utilities used to manage CPU time measures.
static std::string GetMangledFunctionName(const function_decl *fd)
Return the mangled function name.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
HLSFlowStep_Type
Definition: hls_step.hpp:95
Class specification of the data structures used to manage technology information. ...
Class to allocate function in HLS based on dominators.
Classes to describe design flow graph.
static const std::string ComputeSignature(const TechnologyFlowStep_Type technology_flow_step_type)
Compute the signature of a technology flow step.
Datastructure to describe functions allocation in high-level synthesis.
Factory for technology flow step.
static const std::string ComputeSignature(const FrontendFlowStepType frontend_flow_step_type)
Compute the signature of a function frontend flow step.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
static std::string GetFUName(const std::string &fname, const HLS_managerRef HLSMgr)
Return FU used to implement given function.
Definition: functions.cpp:118
fun_dominator_allocation(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type=HLSFlowStep_Type::DOMINATOR_FUNCTION_ALLOCATION)
Constructor.
Classes specification of the tree_node data structures.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
This file collects some utility functions and macros.
Call graph hierarchy.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
Definition: exceptions.hpp:263
Wrapper of design_flow.
Data structure definition for HLS constraints.
This file collects some utility functions.
void ComputeRelationships(DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
Definition: hls_step.cpp:302
refcount< T > lock() const
Definition: refcount.hpp:212
#define OUTPUT_LEVEL_PEDANTIC
verbose debugging print is performed.
static const std::set< std::string > simple_functions
list of trivial function that does not require to be proxied
#define WORK_LIBRARY
working library.
#define INFINITE_UINT
UNSIGNED INT representing infinite.
Definition: utility.hpp:70
This class contains the methods to create a frontend flow step.
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
void ComputeRelationships(DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
this class is used to manage the command-line or XML options.
~fun_dominator_allocation() override
Destructor.
constant strings
Wrapper to call graph.
Class specification of the manager for each library.
int debug_level
The debug level.
#define OUTPUT_LEVEL_VERBOSE
verbose debugging print is performed.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
Data structure definition for high-level synthesis flow.
This class contains the base representation for a generic frontend flow step which works on the whole...
#define NULL_VERTEX
null vertex definition
Definition: graph.hpp:1305
struct definition of the declaration node structures.
Definition: tree_node.hpp:877
Class specification of the manager of the tree structures extracted from the raw file.
Base class for technology flow steps.
HLS specialization of generic_device.
A brief description of the C++ Header File.
Allocation function class.
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.
Definition: graph.hpp:1316
#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