PandA-2024.02
NP_functionality.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 NP_FUNCTIONALITY_HPP
44 #define NP_FUNCTIONALITY_HPP
45 #include "custom_map.hpp"
46 #include "refcount.hpp"
47 #include <ostream>
48 #include <string>
49 #include <vector>
50 
52 
56 class xml_element;
58 
63 #define START_LIBRARY_PARAMETER 1
64 #define LIBRARY_NAME 0
65 
66 
68 #define LIBRARY_DECL_SUFFIX_EXT "_DECL"
69 
86 {
87  public:
99  {
100  TABLE = 0,
121  };
122 
123  private:
125  std::map<NP_functionaly_type, std::string> descriptions;
127  static const char* NP_functionaly_typeNames[];
132  NP_functionaly_type to_NP_functionaly_type(const std::string& val);
133 
134  public:
136  NP_functionality() = default;
137 
139  explicit NP_functionality(const NP_functionalityRef& obj);
140 
142  ~NP_functionality() = default;
143 
147  void add_NP_functionality(NP_functionaly_type type, const std::string& functionality_description);
148 
152  std::string get_NP_functionality(NP_functionaly_type type) const;
153 
158 
162  std::string get_library_name() const;
163 
168  void get_library_parameters(std::vector<std::string>& parameters) const;
169 
170  void get_port_list(std::map<unsigned int, std::map<std::string, std::string>>& InPortMap,
171  std::map<unsigned int, std::map<std::string, std::string>>& OutPortMap) const;
172 
177  void xload(const xml_element* Enode);
178 
183  void xwrite(xml_element* rootnode);
184 
189  void print(std::ostream& os) const;
190 
194  std::string get_kind_text() const
195  {
196  return std::string("NP_functionality");
197  }
198 };
199 
204 
205 #endif
NP_functionality()=default
Constructor.
void get_port_list(std::map< unsigned int, std::map< std::string, std::string >> &InPortMap, std::map< unsigned int, std::map< std::string, std::string >> &OutPortMap) const
NP_functionaly_type to_NP_functionaly_type(const std::string &val)
Convert a string into the corresponding NP_functionaly_type enumerative type.
std::string get_NP_functionality(NP_functionaly_type type) const
Return the description provided the type.
REF_FORWARD_DECL(NP_functionality)
redefinition of map to manage ordered/unordered structures
static const char * NP_functionaly_typeNames[]
store the names of the enumerative NP_functionaly_type.
void add_NP_functionality(NP_functionaly_type type, const std::string &functionality_description)
Add a non SystemC based description.
unsigned map[NUM_VERTICES]
Definition: bfs.c:12
void xload(const xml_element *Enode)
Load a NP_functionality starting from an xml file.
void print(std::ostream &os) const
Print the Non-SystemC based functionality description (for debug purpose).
~NP_functionality()=default
Destructor.
std::string get_library_name() const
return the name of the library in case it there exists a LIBRARY based description.
void xwrite(xml_element *rootnode)
Add a NP_functionality to an xml tree.
Template definition of refcount.
NP_functionaly_type
functionality type descriptors.
std::map< NP_functionaly_type, std::string > descriptions
Store the description of the functionality.
bool exist_NP_functionality(NP_functionaly_type type) const
Return true in case there exist a functionaly of the given type.
Not parsed functionality descriptor of a module.
std::string get_kind_text() const
Definition of get_kind_text()
void get_library_parameters(std::vector< std::string > &parameters) const
fill a vector with the library parameters in case it there exists a LIBRARY based description...

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