PandA-2024.02
mem_dominator_allocation_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  */
40 #include "Parameter.hpp"
41 #include "behavioral_helper.hpp"
42 #include "call_graph_manager.hpp"
43 #include "cmath"
44 #include "function_behavior.hpp"
45 #include "hls_manager.hpp"
46 #include "memory_cs.hpp"
47 #include "omp_functions.hpp"
48 
50 #include "math_function.hpp"
51 #include "utility.hpp"
52 
54  const ParameterConstRef _parameters, const HLS_managerRef _HLSMgr,
55  const DesignFlowManagerConstRef _design_flow_manager,
56  const HLSFlowStepSpecializationConstRef _hls_flow_step_specialization, const HLSFlowStep_Type _hls_flow_step_type)
57  : mem_dominator_allocation(_parameters, _HLSMgr, _design_flow_manager, _hls_flow_step_specialization,
58  _hls_flow_step_type)
59 {
60  debug_level = _parameters->get_class_debug_level(GET_CLASS(*this));
61 }
62 
64 
66 {
67  mem_dominator_allocation::Exec(); // exec of hierarchical class
68  auto context_switch = ceil_log2(parameters->getOption<unsigned long long int>(OPT_context_switch));
69  if(!context_switch)
70  {
71  context_switch = 1;
72  }
73  auto num_bits_acc = ceil_log2(parameters->getOption<unsigned long long>(OPT_num_accelerators));
74  if(!num_bits_acc)
75  {
76  num_bits_acc = 1;
77  }
78  const auto tag_index = context_switch + num_bits_acc + 2ULL; // tag_index is log2(switch)+log2(thread)+2
79  GetPointer<memory_cs>(HLSMgr->Rmem)->set_bus_tag_bitsize(static_cast<unsigned>(tag_index));
81 }
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Definition: hls_step.hpp:205
Data structure representing the entire HLS information.
mem_dominator_allocation_cs(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization, const HLSFlowStep_Type hls_flow_step_type)
Constructor.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
mathematical utility function not provided by standard libraries
T ceil_log2(T x)
Return the smallest n such that 2**n >= X.
HLSFlowStep_Type
Definition: hls_step.hpp:95
DesignFlowStep_Status Exec() override
Execute the step.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
This file collects some utility functions and macros.
~mem_dominator_allocation_cs() override
Destructor.
DesignFlowStep_Status Exec() override
Execute the step.
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.
Wrapper to call graph.
int debug_level
The debug level.
Datastructure to describe functions allocation in high-level synthesis.
A brief description of the C++ Header File.

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