aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorAlberto Gonzalez <boqwxp@airmail.cc>2020-04-11 06:53:59 +0000
committerAlberto Gonzalez <boqwxp@airmail.cc>2020-04-11 06:53:59 +0000
commit73bd7fb01d83d276e47fb181fd53b1c97c2c0111 (patch)
treeeedf29abff124de93acc85931272fc36491af1ec /passes
parentde5e6fa56ada699ae13585791593eabce089b718 (diff)
downloadyosys-73bd7fb01d83d276e47fb181fd53b1c97c2c0111.tar.gz
yosys-73bd7fb01d83d276e47fb181fd53b1c97c2c0111.tar.bz2
yosys-73bd7fb01d83d276e47fb181fd53b1c97c2c0111.zip
Use `dict` instead of `std::map`.
Diffstat (limited to 'passes')
-rw-r--r--passes/sat/qbfsat.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/passes/sat/qbfsat.cc b/passes/sat/qbfsat.cc
index 77a34ec40..8c0d63601 100644
--- a/passes/sat/qbfsat.cc
+++ b/passes/sat/qbfsat.cc
@@ -40,7 +40,7 @@ PRIVATE_NAMESPACE_BEGIN
struct QbfSolutionType {
std::vector<std::string> stdout;
- std::map<std::string, std::string> hole_to_value;
+ dict<std::string, std::string> hole_to_value;
bool sat;
bool unknown; //true if neither 'sat' nor 'unsat'
bool success; //true if exit code 0
@@ -71,7 +71,7 @@ void recover_solution(QbfSolutionType &sol) {
YS_REGEX_MATCH_TYPE m;
bool sat_regex_found = false;
bool unsat_regex_found = false;
- std::map<std::string, bool> hole_value_recovered;
+ dict<std::string, bool> hole_value_recovered;
for (const std::string &x : sol.stdout) {
if(YS_REGEX_NS::regex_search(x, m, hole_value_regex)) {
std::string loc = m[1].str();
@@ -93,8 +93,8 @@ void recover_solution(QbfSolutionType &sol) {
#endif
}
-std::map<std::string, std::string> get_hole_loc_name_map(RTLIL::Module *module, const QbfSolutionType &sol) {
- std::map<std::string, std::string> hole_loc_to_name;
+dict<std::string, std::string> get_hole_loc_name_map(RTLIL::Module *module, const QbfSolutionType &sol) {
+ dict<std::string, std::string> hole_loc_to_name;
for (auto cell : module->cells()) {
std::string cell_src = cell->get_src_attribute();
auto pos = sol.hole_to_value.find(cell_src);
@@ -115,7 +115,7 @@ void write_solution(RTLIL::Module *module, const QbfSolutionType &sol, const std
if (!fout)
log_cmd_error("could not open solution file for writing.\n");
- std::map<std::string, std::string> hole_loc_to_name = get_hole_loc_name_map(module, sol);
+ dict<std::string, std::string> hole_loc_to_name = get_hole_loc_name_map(module, sol);
for(auto &x : sol.hole_to_value)
fout << hole_loc_to_name[x.first] << "=" << x.second << std::endl;
}
@@ -124,7 +124,7 @@ void specialize_from_file(RTLIL::Module *module, const std::string &file) {
YS_REGEX_TYPE hole_assn_regex = YS_REGEX_COMPILE_WITH_SUBS("^(.*)=([01]+)$");
YS_REGEX_MATCH_TYPE m;
std::set<RTLIL::Cell *> anyconsts_to_remove;
- std::map<std::string, std::string> hole_name_to_value;
+ dict<std::string, std::string> hole_name_to_value;
std::ifstream fin(file.c_str());
if (!fin)
log_cmd_error("could not read solution file.\n");
@@ -168,7 +168,7 @@ void specialize_from_file(RTLIL::Module *module, const std::string &file) {
}
void specialize(RTLIL::Module *module, const QbfSolutionType &sol) {
- std::map<std::string, std::string> hole_loc_to_name = get_hole_loc_name_map(module, sol);
+ dict<std::string, std::string> hole_loc_to_name = get_hole_loc_name_map(module, sol);
std::set<RTLIL::Cell *> anyconsts_to_remove;
for (auto cell : module->cells())
if (cell->type == "$anyconst")
@@ -204,7 +204,7 @@ void specialize(RTLIL::Module *module, const QbfSolutionType &sol) {
void dump_model(RTLIL::Module *module, const QbfSolutionType &sol) {
log("Satisfiable model:\n");
- std::map<std::string, std::string> hole_loc_to_name = get_hole_loc_name_map(module, sol);
+ dict<std::string, std::string> hole_loc_to_name = get_hole_loc_name_map(module, sol);
for (auto &it : sol.hole_to_value) {
std::string hole_loc = it.first;
std::string hole_value = it.second;