pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
Compile.h
Go to the documentation of this file.
1
7#ifndef PFLIB_COMPILE_H
8#define PFLIB_COMPILE_H
9
10#include <map>
11#include <string>
12#include <vector>
13
14namespace YAML {
15class Node;
16}
17
18namespace pflib {
19
36int str_to_int(std::string str);
37
42
75void compile(const std::string& page, const std::string& param, const int& val,
76 std::map<int,std::map<int,uint8_t>>& registers);
77
89compile(const std::string& page_name, const std::string& param_name, const int& val);
90
119
144decompile(const std::map<int,std::map<int,uint8_t>>& compiled_config, bool be_careful);
145
161
171
210void extract(const std::vector<std::string>& setting_files,
212
224compile(const std::vector<std::string>& setting_files, bool prepend_defaults = true);
225
237compile(const std::string& setting_file, bool prepend_defaults = true);
238
242namespace detail {
243
254void extract(YAML::Node params, std::map<std::string,std::map<std::string,int>>& settings);
255
256} // namespace detail
257} // namespace pflib
258
259#endif
void extract(YAML::Node params, std::map< std::string, std::map< std::string, int > > &settings)
Extract a map of page_name, param_name to their values by crawling the YAML tree.
Definition: Compile.cxx:595
Polarfire Interaction Library.
Definition: Backend.h:8
std::map< std::string, std::map< std::string, int > > defaults()
get the default parameter values as specified in the manual
Definition: Compile.cxx:550
void compile(const std::string &page, const std::string &param, const int &val, std::map< int, std::map< int, uint8_t > > &registers)
Overlay a single parameter onto the input register map.
Definition: Compile.cxx:406
int str_to_int(std::string str)
Get an integer from the input string.
Definition: Compile.cxx:379
void extract(const std::vector< std::string > &setting_files, std::map< std::string, std::map< std::string, int > > &settings)
Extract the page name, parameter name, and parameter values from the YAML files into the passed setti...
Definition: Compile.cxx:561
std::map< std::string, std::map< std::string, int > > decompile(const std::map< int, std::map< int, uint8_t > > &compiled_config, bool be_careful)
unpack register values into the page names, parameter names and parameter values mapping
Definition: Compile.cxx:474
std::vector< std::string > parameters(const std::string &page)
get the parameter names for the input page-type
Definition: Compile.cxx:522
std::string upper_cp(const std::string &str)
Get a copy of the input string with all caps.
Definition: Compile.cxx:400