PandA-2024.02
priority.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  */
47 #ifndef PRIORITY_HPP
48 #define PRIORITY_HPP
49 
50 #include "Vertex.hpp"
51 
52 #include "custom_map.hpp"
53 #include "refcount.hpp"
54 
55 #include "op_graph.hpp"
56 
63 
68 template <class dataType>
70 {
75  virtual bool update() = 0;
80  virtual dataType operator()(const vertex& _a) const
81  {
82  return priority_values(_a);
83  }
88  virtual dataType& operator[](const vertex& _a)
89  {
90  return priority_values[_a];
91  }
95  virtual ~priority_data() = default;
96 
97  private:
100 };
101 
107 {
111  explicit priority_static_mobility(const ASLAPRef& aslap);
112 
116  bool update() override
117  {
118  return false;
119  }
120 };
121 
127 {
131  priority_dynamic_mobility(const ASLAPRef& aslap, const OpVertexSet& _ready_nodes,
132  unsigned int _ctrl_step_multiplier);
133 
137  bool update() override;
138 
139  private:
143  unsigned int ctrl_step_multiplier;
144 };
145 
150 struct priority_fixed : public priority_data<int>
151 {
155  explicit priority_fixed(const CustomUnorderedMapUnstable<vertex, int>& priority_value);
156 
160  bool update() override
161  {
162  return false;
163  }
164 };
165 
169 template <class Type>
171 {
178  bool operator()(const vertex& a, const vertex& b) const
179  {
180  return priority_values->operator()(a) < priority_values->operator()(b) ||
181  (priority_values->operator()(a) == priority_values->operator()(b) && a > b);
182  }
183 
189  {
190  }
191 
196  {
198  return *this;
199  }
204  {
205  }
206 
210  ~priority_compare_functor() = default;
211 
212  private:
215 };
216 
217 #endif
virtual dataType & operator[](const vertex &_a)
return the priority associated with the vertex.
Definition: priority.hpp:88
This is a specialization based on mobility.
Definition: priority.hpp:106
vertex2obj< dataType > priority_values
data structure storing the priority values.
Definition: priority.hpp:99
const OpVertexSet & ready_nodes
set of ready vertices.
Definition: priority.hpp:141
virtual dataType operator()(const vertex &_a) const
Return the priority associated with the vertex.
Definition: priority.hpp:80
bool operator()(const vertex &a, const vertex &b) const
functor function used to compare two vertices with respect to the priority data structure.
Definition: priority.hpp:178
Base class used to define the priority associated with each vertex of a list base scheduling problem...
Definition: priority.hpp:69
Data structures used to manage set of vertexes.
priority_compare_functor(const refcount< priority_data< Type >> pri)
Constructor.
Definition: priority.hpp:188
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMapUnstable
Definition: custom_map.hpp:156
redefinition of map to manage ordered/unordered structures
A set of operation vertices.
Definition: op_graph.hpp:654
const refcount< priority_data< Type > > priority_values
copy of the priority values
Definition: priority.hpp:214
unsigned int ctrl_step_multiplier
multiplier used to take into account chaining during asap/alap computation
Definition: priority.hpp:143
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
REF_FORWARD_DECL(ASLAP)
bool update() override
This specialization does not update the priorities at the end of the control step.
Definition: priority.hpp:116
Class managing ALAP and ASAP algorithms.
Definition: ASLAP.hpp:75
Functor used to compare two vertices with respect to a priority object.
Definition: priority.hpp:170
This is a specialization based on mobility.
Definition: priority.hpp:126
Template definition of refcount.
This is a specialization based on a given fixed priority value.
Definition: priority.hpp:150
virtual bool update()=0
this function updates the value of the priority at the end of the control step analysis.
virtual ~priority_data()=default
Destructor.
priority_compare_functor & operator=(const priority_compare_functor &in)
Copy assignment.
Definition: priority.hpp:195
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
bool update() override
This specialization does not update the priorities at the end of the control step.
Definition: priority.hpp:160
priority_compare_functor(const priority_compare_functor &in)
Copy constructor.
Definition: priority.hpp:203

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