PandA-2024.02
memory_allocation.hpp
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  */
45 #ifndef _MEMORY_ALLOCATION_HPP_
46 #define _MEMORY_ALLOCATION_HPP_
47 
48 #include "custom_set.hpp"
49 #include "hls_step.hpp"
50 #include "refcount.hpp"
51 #include <list>
52 #include <map>
53 #include <string>
54 #include <tuple>
55 
58 
63 {
64  LSS = 1,
65  GSS = 2,
66  ALL_BRAM = 3,
67  NO_BRAM = 0,
69  4,
70  NONE = 7
71 };
72 
77 {
78  MEM_ACC_11 = 0,
79  MEM_ACC_N1 = 1,
80  MEM_ACC_NN = 3,
81  MEM_ACC_P1N =
82  6,
83  MEM_ACC_CS = 8
84 };
85 
90 {
91  public:
94 
97 
103  MemoryAllocationSpecialization(const MemoryAllocation_Policy memory_allocation_policy,
104  const MemoryAllocation_ChannelsType memory_allocation_channels_type);
105 
109  std::string GetKindText() const override;
110 
114  std::string GetSignature() const override;
115 };
116 
121 {
122  protected:
125 
127  unsigned int memory_version;
128 
130  std::map<unsigned int, unsigned int> last_bb_ver;
131 
133  std::map<unsigned int, unsigned int> last_bitvalue_ver;
134 
138  void setup_memory_allocation();
139 
143  void finalize_memory_allocation();
144 
151  ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override;
152 
157  virtual DesignFlowStep_Status InternalExec() = 0;
158 
159  public:
166  const ParameterConstRef _parameters, const HLS_managerRef HLSMgr,
167  const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type,
168  const HLSFlowStepSpecializationConstRef hls_flow_step_specialization = HLSFlowStepSpecializationConstRef());
169 
173  ~memory_allocation() override;
174 
181  void allocate_parameters(unsigned int functionId, memoryRef Rmem = nullptr);
182 
187  bool HasToBeExecuted() const override;
188 
193  DesignFlowStep_Status Exec() override;
194 };
195 
196 #endif
std::map< unsigned int, unsigned int > last_bb_ver
The version of BB IR representation on which this step was applied.
only external memory access Datapath see only 1 memory port, while the bus manage parallel accesses ...
RelationshipType
The relationship type.
all objects that need to be stored in memory are allocated on an external pipelined memory ...
MemoryAllocation_ChannelsType
The number of channels.
all objects that need to be stored in memory are allocated on an external memory
Allocation memory class.
Abstract class containing information about specialization of the single steps.
Definition: hls_step.hpp:75
all global variables, static variables and strings are allocated on BRAMs
HLSFlowStep_Type
Definition: hls_step.hpp:95
redefinition of set to manage ordered/unordered structures
const MemoryAllocation_ChannelsType memory_allocation_channels_type
number of channels
DesignFlowStep_Status
The status of a step.
std::map< unsigned int, unsigned int > last_bitvalue_ver
The version of bit value IR representation on which this step was applied.
Template definition of refcount.
for each memory at maximum n parallel direct accesses and one indirect access
CustomOrderedSet< unsigned int > func_list
list of functions to be analyzed
unsigned int memory_version
The version of memory representation on which this step was applied.
all local variables, static variables and strings are allocated on BRAMs
for each memory at maximum n parallel direct accesses and n parallel indirect accesses ...
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
for each memory at maximum one direct access and one indirect access
The information about how memory allocation has to be specialized.
refcount< const HLSFlowStepSpecialization > HLSFlowStepSpecializationConstRef
const refcount definition of the class
Definition: hls_step.hpp:93
all objects that need to be stored in memory are allocated on BRAMs
const MemoryAllocation_Policy memory_allocation_policy
memory allocation policy
MemoryAllocation_Policy
The allocation memory polycy.
REF_FORWARD_DECL(memory_allocation)

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