PandA-2024.02
ASLAP.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  */
43 #ifndef ASLAP_HPP
44 #define ASLAP_HPP
45 
46 #include <deque>
47 #include <iosfwd>
48 
49 #include "graph.hpp"
50 #include "refcount.hpp"
51 
53 #include "schedule.hpp"
54 
67 class graph;
68 class OpVertexSet;
69 enum class Allocation_MinMax;
71 
75 class ASLAP
76 {
77  private:
80 
83 
85  ControlStep min_tot_csteps;
86 
88  ControlStep max_tot_csteps;
89 
92 
95  std::deque<vertex> levels;
96 
99 
102 
105 
107  const double clock_period;
108 
111 
113  unsigned int ctrl_step_multiplier;
114 
122 
129 
135  void compute_ALAP_fast(bool* feasible = nullptr);
136 
144  void compute_ALAP_LB();
145 
151 
156  ControlStep get_min_csteps() const
157  {
158  return min_tot_csteps;
159  }
160 
166  ControlStep get_max_csteps() const
167  {
168  return max_tot_csteps;
169  }
170 
177  ControlStep GetCycleLatency(const vertex operation, Allocation_MinMax minmax) const;
178 
179  public:
188  ASLAP(const HLS_managerConstRef hls_manager, const hlsRef HLS, const bool speculation,
190  unsigned int _ctrl_step_multiplier);
191 
195  ~ASLAP() = default;
196 
210  {
216  };
217 
222  void print(std::ostream& os) const;
223 
229  void compute_ASAP(const ScheduleConstRef partial_schedule = ScheduleConstRef());
230 
236  {
237  return ASAP;
238  }
239 
241  {
242  return ASAP;
243  }
244 
262  void compute_ALAP(ALAP_method met, const ScheduleConstRef partial_schedule = ScheduleConstRef(),
263  bool* feasible = nullptr, const ControlStep = ControlStep(0u));
264 
270  {
271  return ALAP;
272  }
273 
278  {
279  return ALAP;
280  }
281 
290  void update_ALAP(const ControlStep maxc, bool* feasible = nullptr,
291  const ScheduleConstRef partial_schedule = ScheduleConstRef());
292 
296  friend std::ostream& operator<<(std::ostream& os, const ASLAP& s)
297  {
298  s.print(os);
299  return os;
300  }
301 
305  const OpGraphConstRef CGetOpGraph() const;
306 };
307 
309 
310 #endif
Class managing the schedule of the operations.
Definition: schedule.hpp:118
const AllocationInformationConstRef allocation_information
The allocation data structure.
Definition: ASLAP.hpp:101
ControlStep min_tot_csteps
variable storing the minimum number of control steps required to schedule the graph.
Definition: ASLAP.hpp:85
Class specification of the graph structures.
ScheduleRef ALAP
Array storing the ALAP values of the nodes in the graph.
Definition: ASLAP.hpp:82
Allocation_MinMax
Definition: allocation.hpp:89
void compute_ALAP(ALAP_method met, const ScheduleConstRef partial_schedule=ScheduleConstRef(), bool *feasible=nullptr, const ControlStep=ControlStep(0u))
Function that computes the ALAP scheduling of the graph.
Definition: ASLAP.cpp:420
const ScheduleConstRef CGetALAP() const
Returns the ALAP vector of the vertices.
Definition: ASLAP.hpp:269
ScheduleRef ASAP
Array storing the ASAP values of the nodes in the graph.
Definition: ASLAP.hpp:79
A set of operation vertices.
Definition: op_graph.hpp:654
int debug_level
debug level
Definition: ASLAP.hpp:110
void print(std::ostream &os) const
Function that prints the class ASLAP.
Definition: ASLAP.cpp:137
This class specifies the characteristic of a particular operation working on a given functional unit...
void compute_ASAP(const ScheduleConstRef partial_schedule=ScheduleConstRef())
Function that computes the ASAP scheduling of the graph.
Definition: ASLAP.cpp:273
Data structure used to store the schedule of the operations.
void add_constraints_to_ASAP()
Modify the ASAP scheduling taking into account also technology constraints.
Definition: ASLAP.cpp:190
ControlStep get_min_csteps() const
This method returns the minimum number of control steps to schedule the graph.
Definition: ASLAP.hpp:156
ControlStep get_max_csteps() const
This method returns the maximum number of control steps induced by the specification and by the techn...
Definition: ASLAP.hpp:166
bool has_branching_blocks
is true if the beh_graph has at least one branching block
Definition: ASLAP.hpp:98
~ASLAP()=default
Destructor.
bool speculation
speculation
Definition: ASLAP.hpp:104
const ScheduleConstRef CGetASAP() const
Returns the ASAP vector of the vertices.
Definition: ASLAP.hpp:235
friend std::ostream & operator<<(std::ostream &os, const ASLAP &s)
Friend definition of the << operator.
Definition: ASLAP.hpp:296
Data structure used to store all the HLS constraints.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
General class used to describe a graph in PandA.
Definition: graph.hpp:771
ControlStep GetCycleLatency(const vertex operation, Allocation_MinMax minmax) const
Return the number of cycles required to execute an operation.
Definition: ASLAP.cpp:601
void compute_ALAP_LB()
Compute the ALAP scheduling with uncontrained resources and with the minumum execution time...
Class managing ALAP and ASAP algorithms.
Definition: ASLAP.hpp:75
ASLAP(const HLS_managerConstRef hls_manager, const hlsRef HLS, const bool speculation, const CustomUnorderedSet< vertex > &operations, const ParameterConstRef parameters, unsigned int _ctrl_step_multiplier)
Constructor.
Definition: ASLAP.cpp:85
const OpGraphConstRef CGetOpGraph() const
Gets graph.
Definition: ASLAP.cpp:132
unsigned int ctrl_step_multiplier
multiplier used to take into account chaining during asap/alap computation
Definition: ASLAP.hpp:113
ControlStep max_tot_csteps
variable storing the maximum number of control steps required to schedule the graph.
Definition: ASLAP.hpp:88
Template definition of refcount.
std::deque< vertex > levels
constant variable storing the reference to the array of vertexes sorted by topological order associat...
Definition: ASLAP.hpp:95
void add_constraints_to_ALAP()
Modify the ALAP scheduling taking into account also technology constraints.
Definition: ASLAP.cpp:331
void compute_ALAP_worst_case()
Compute ALAP using list based euristic to identify the total number of control steps.
Definition: ASLAP.cpp:545
refcount< const Schedule > ScheduleConstRef
Definition: schedule.hpp:411
CONSTREF_FORWARD_DECL(AllocationInformation)
void compute_ALAP_fast(bool *feasible=nullptr)
Compute the standard ALAP scheduling with uncontrained resource.
Definition: ASLAP.cpp:501
void update_ALAP(const ControlStep maxc, bool *feasible=nullptr, const ScheduleConstRef partial_schedule=ScheduleConstRef())
Update the ALAP by using maxc as upper bound.
Definition: ASLAP.cpp:475
REF_FORWARD_DECL(HLS_constraints)
OpGraphConstRef beh_graph
the graph to be scheduled
Definition: ASLAP.hpp:91
const CustomUnorderedSet< vertex > & operations
relevant vertex for the aslap scheduling
Definition: ASLAP.hpp:116
ScheduleRef GetASAP()
Definition: ASLAP.hpp:240
ALAP_method
Possible type of ALAP method currently implemented.
Definition: ASLAP.hpp:209
Data structure that contains all information about high level synthesis process.
Definition: hls.hpp:83
Class used to describe a particular graph with operations as nodes.
Definition: op_graph.hpp:783
const double clock_period
The clock period.
Definition: ASLAP.hpp:107
const ScheduleRef GetALAP()
Return the ALAP (modifiable)
Definition: ASLAP.hpp:277

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