PandA-2024.02
storage_value_information.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  */
40 #ifndef STORAGE_VALUE_INFORMATION_HPP
41 #define STORAGE_VALUE_INFORMATION_HPP
42 
44 #include "graph.hpp"
45 
47 #include "custom_map.hpp"
48 
50 #include "refcount.hpp"
51 
52 class fu_binding;
55 
57 {
58  protected:
59  friend class values_scheme;
60 
63 
66 
69 
72 
74  const unsigned int function_id;
75 
78 
81 
82  public:
86  StorageValueInformation(const HLS_managerConstRef HLS_mgr, const unsigned int function_id);
87 
91  virtual ~StorageValueInformation();
92 
96  void Initialize();
97 
101  unsigned int get_number_of_storage_values() const;
102 
108  virtual bool is_a_storage_value(vertex curr_vertex, unsigned int var_index) = 0;
109 
115  virtual unsigned int get_storage_value_index(vertex curr_vertex, unsigned int var_index) = 0;
116 
120  unsigned int get_variable_index(unsigned int storage_value_index) const;
121 
126  int get_compatibility_weight(unsigned int storage_value_index1, unsigned int storage_value_index2) const;
127 
133  virtual void set_storage_value_index(vertex curr_state, unsigned int variable, unsigned int sv) = 0;
134 
140  bool are_value_bitsize_compatible(unsigned int storage_value_index1, unsigned int storage_value_index2) const;
141 };
143 #endif
int get_compatibility_weight(unsigned int storage_value_index1, unsigned int storage_value_index2) const
return a weight that estimate how much two storage values are compatible.
Wrefcount< const fu_binding > fu
functional unit assignments
unsigned int get_variable_index(unsigned int storage_value_index) const
Returns the index of the variable associated with the storage value in a given vertex.
const HLS_managerConstRef HLS_mgr
The HLS manager.
CustomUnorderedMap< unsigned int, vertex > vw2vertex
relation between var written and operations
Class specification of the graph structures.
CONSTREF_FORWARD_DECL(HLS_manager)
virtual bool is_a_storage_value(vertex curr_vertex, unsigned int var_index)=0
return true in case a storage value exist for the pair vertex variable
redefinition of map to manage ordered/unordered structures
OpGraphConstRef data
operation graph used to compute the affinity between storage values
bool are_value_bitsize_compatible(unsigned int storage_value_index1, unsigned int storage_value_index2) const
return the in case the storage values have compatible size
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Definition: custom_map.hpp:148
virtual void set_storage_value_index(vertex curr_state, unsigned int variable, unsigned int sv)=0
assign a storage value to a couple state-variable
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
const unsigned int function_id
The index of the function.
StorageValueInformation(const HLS_managerConstRef HLS_mgr, const unsigned int function_id)
Constructor.
Template definition of refcount.
void Initialize()
Initialize the step (i.e., like a constructor)
virtual unsigned int get_storage_value_index(vertex curr_vertex, unsigned int var_index)=0
Returns the index of the storage value associated with the variable in a given vertex.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
virtual ~StorageValueInformation()
Destructor.
Class managing the functional-unit binding.
Definition: fu_binding.hpp:90
Class used to describe a particular graph with operations as nodes.
Definition: op_graph.hpp:783
unsigned int get_number_of_storage_values() const
Returns the number of storage values inserted.
CustomUnorderedMap< unsigned int, unsigned int > variable_index_map
put into relation storage value index with variables
unsigned int number_of_storage_values
current number of storage values

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