49 #include <boost/iterator/iterator_facade.hpp> 50 #include <boost/token_functions.hpp> 51 #include <boost/tokenizer.hpp> 71 THROW_ASSERT(i < UNKNOWN,
"Wrong NP_functionaly_typeNames specified: |" + val +
"|");
85 "SYSTEM_VERILOG_PROVIDED",
93 "VERILOG_FILE_PROVIDED",
106 for(
auto iter : list)
150 if(library_description.empty())
152 return library_description;
154 using tokenizer = boost::tokenizer<boost::char_separator<char>>;
155 boost::char_separator<char> sep(
" ",
nullptr);
156 tokenizer
tokens(library_description, sep);
157 return *tokens.begin();
163 if(library_description.empty())
168 using tokenizer = boost::tokenizer<boost::char_separator<char>>;
169 boost::char_separator<char> sep(
" ",
nullptr);
170 tokenizer
tokens(library_description, sep);
171 tokenizer::iterator tok_iter = tokens.begin();
172 for(++tok_iter; tok_iter != tokens.end(); ++tok_iter)
174 parameters.push_back(*tok_iter);
179 std::map<
unsigned int, std::map<std::string, std::string>>& OutPortMap)
const 182 if(port_list.empty())
186 std::vector<std::string> splitted =
SplitString(port_list,
",");
187 for(
const auto& port_description : splitted)
189 if(port_description.empty())
193 std::vector<std::string> ports =
SplitString(port_description,
":");
194 THROW_ASSERT(ports.size() == 4,
"Wrong format for NP_functionality::PORT_LIST functionality");
197 InPortMap[
static_cast<unsigned>(std::stoul(ports[1]))][ports[2]] = ports[3];
201 OutPortMap[
static_cast<unsigned>(std::stoul(ports[1]))][ports[2]] = ports[3];
208 for(
unsigned int i = 0; i <
UNKNOWN; i++)
NP_functionality()=default
Constructor.
std::list< xml_attribute * > attribute_list
const std::vector< std::string > SplitString(const std::string &input, const std::string &separators)
Function which splits a string into tokens.
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.
attribute_list get_attributes()
Remove the attribute with this name.
std::string get_NP_functionality(NP_functionaly_type type) const
Return the description provided the type.
exceptions managed by PandA
static const char * NP_functionaly_typeNames[]
store the names of the enumerative NP_functionaly_type.
Auxiliary methods for manipulating string.
void add_NP_functionality(NP_functionaly_type type, const std::string &functionality_description)
Add a non SystemC based description.
unsigned map[NUM_VERTICES]
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).
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.
#define WRITE_XNVM2(name, value, node)
WRITE XML Name Value Macro second version. Insert a value in an XML tree given the name of the attrib...
NP_functionaly_type
functionality type descriptors.
Some macro used to interface with the XML library.
Not parsed functionality manager.
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.
std::string get_kind_text() const
Definition of get_kind_text()
xml_element * add_child_element(const std::string &name)
Add a child element to this node.
void get_library_parameters(std::vector< std::string > ¶meters) const
fill a vector with the library parameters in case it there exists a LIBRARY based description...
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...