Refactoring: Renamed RTLIL::Design::modules to modules_
authorClifford Wolf <clifford@clifford.at>
Sun, 27 Jul 2014 08:18:00 +0000 (10:18 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 27 Jul 2014 09:18:30 +0000 (11:18 +0200)
73 files changed:
backends/autotest/autotest.cc
backends/blif/blif.cc
backends/btor/btor.cc
backends/edif/edif.cc
backends/ilang/ilang_backend.cc
backends/intersynth/intersynth.cc
backends/spice/spice.cc
backends/verilog/verilog_backend.cc
frontends/ast/ast.cc
frontends/liberty/liberty.cc
kernel/celltypes.h
kernel/driver.cc
kernel/rtlil.cc
kernel/rtlil.h
manual/CHAPTER_Prog/stubnets.cc
manual/PRESENTATION_Prog/my_cmd.cc
passes/abc/abc.cc
passes/abc/blifparse.cc
passes/cmds/add.cc
passes/cmds/connect.cc
passes/cmds/connwrappers.cc
passes/cmds/copy.cc
passes/cmds/delete.cc
passes/cmds/design.cc
passes/cmds/rename.cc
passes/cmds/scatter.cc
passes/cmds/scc.cc
passes/cmds/select.cc
passes/cmds/setattr.cc
passes/cmds/setundef.cc
passes/cmds/show.cc
passes/cmds/splice.cc
passes/cmds/splitnets.cc
passes/cmds/stat.cc
passes/fsm/fsm_detect.cc
passes/fsm/fsm_expand.cc
passes/fsm/fsm_export.cc
passes/fsm/fsm_extract.cc
passes/fsm/fsm_info.cc
passes/fsm/fsm_map.cc
passes/fsm/fsm_opt.cc
passes/fsm/fsm_recode.cc
passes/hierarchy/hierarchy.cc
passes/hierarchy/submod.cc
passes/memory/memory_collect.cc
passes/memory/memory_dff.cc
passes/memory/memory_map.cc
passes/memory/memory_share.cc
passes/memory/memory_unpack.cc
passes/opt/opt_clean.cc
passes/opt/opt_const.cc
passes/opt/opt_muxtree.cc
passes/opt/opt_reduce.cc
passes/opt/opt_rmdff.cc
passes/opt/opt_share.cc
passes/proc/proc_arst.cc
passes/proc/proc_clean.cc
passes/proc/proc_dff.cc
passes/proc/proc_init.cc
passes/proc/proc_mux.cc
passes/proc/proc_rmdead.cc
passes/sat/eval.cc
passes/sat/expose.cc
passes/sat/freduce.cc
passes/sat/miter.cc
passes/sat/sat.cc
passes/sat/share.cc
passes/techmap/dfflibmap.cc
passes/techmap/extract.cc
passes/techmap/hilomap.cc
passes/techmap/iopadmap.cc
passes/techmap/simplemap.cc
passes/techmap/techmap.cc

index 06b2c2a936752760ae57f92c4a83f2242d16438d..3bb0f9d66c177eb02a80a3c917cb8731704aa412 100644 (file)
@@ -91,7 +91,7 @@ static void autotest(FILE *f, RTLIL::Design *design)
        fprintf(f, "end\n");
        fprintf(f, "endtask\n\n");
 
-       for (auto it = design->modules.begin(); it != design->modules.end(); it++)
+       for (auto it = design->modules_.begin(); it != design->modules_.end(); it++)
        {
                std::map<std::string, int> signal_in;
                std::map<std::string, std::string> signal_const;
@@ -292,7 +292,7 @@ static void autotest(FILE *f, RTLIL::Design *design)
        fprintf(f, "initial begin\n");
        fprintf(f, "\t// $dumpfile(\"testbench.vcd\");\n");
        fprintf(f, "\t// $dumpvars(0, testbench);\n");
-       for (auto it = design->modules.begin(); it != design->modules.end(); it++)
+       for (auto it = design->modules_.begin(); it != design->modules_.end(); it++)
                if (!it->second->get_bool_attribute("\\gentb_skip"))
                        fprintf(f, "\t%s;\n", idy(it->first, "test").c_str());
        fprintf(f, "\t$finish;\n");
index 936dea023ecb60cf8556ff8925583427414ae4fe..2b783e73433cce443ce3b346e834ce80d1efd159 100644 (file)
@@ -89,9 +89,9 @@ struct BlifDumper
        {
                if (!config->gates_mode)
                        return "subckt";
-               if (!design->modules.count(RTLIL::escape_id(cell_type)))
+               if (!design->modules_.count(RTLIL::escape_id(cell_type)))
                        return "gate";
-               if (design->modules.at(RTLIL::escape_id(cell_type))->get_bool_attribute("\\blackbox"))
+               if (design->modules_.at(RTLIL::escape_id(cell_type))->get_bool_attribute("\\blackbox"))
                        return "gate";
                return "subckt";
        }
@@ -362,7 +362,7 @@ struct BlifBackend : public Backend {
                extra_args(f, filename, args, argidx);
 
                if (top_module_name.empty())
-                       for (auto & mod_it:design->modules)
+                       for (auto & mod_it:design->modules_)
                                if (mod_it.second->get_bool_attribute("\\top"))
                                        top_module_name = mod_it.first;
 
@@ -370,7 +370,7 @@ struct BlifBackend : public Backend {
 
                std::vector<RTLIL::Module*> mod_list;
 
-               for (auto module_it : design->modules)
+               for (auto module_it : design->modules_)
                {
                        RTLIL::Module *module = module_it.second;
                        if (module->get_bool_attribute("\\blackbox"))
index ef0f0dd8c6b6184d66ae74cebf65e338222273c5..4af1210050ce9a6834ac622a23164841e8541d83 100644 (file)
@@ -964,7 +964,7 @@ struct BtorBackend : public Backend {
                extra_args(f, filename, args, argidx);
                
                if (top_module_name.empty())
-                       for (auto & mod_it:design->modules)
+                       for (auto & mod_it:design->modules_)
                                if (mod_it.second->get_bool_attribute("\\top"))
                                        top_module_name = mod_it.first;
 
@@ -975,7 +975,7 @@ struct BtorBackend : public Backend {
                
                std::vector<RTLIL::Module*> mod_list;
 
-               for (auto module_it : design->modules)
+               for (auto module_it : design->modules_)
                {
                        RTLIL::Module *module = module_it.second;
                        if (module->get_bool_attribute("\\blackbox"))
index d23e99e7e82bd5576f37ebedc25485d9296aaac7..5eff4598abb618ff6dd9a0525bb0032ca0436a89 100644 (file)
@@ -125,11 +125,11 @@ struct EdifBackend : public Backend {
                extra_args(f, filename, args, argidx);
 
                if (top_module_name.empty())
-                       for (auto & mod_it:design->modules)
+                       for (auto & mod_it:design->modules_)
                                if (mod_it.second->get_bool_attribute("\\top"))
                                        top_module_name = mod_it.first;
 
-               for (auto module_it : design->modules)
+               for (auto module_it : design->modules_)
                {
                        RTLIL::Module *module = module_it.second;
                        if (module->get_bool_attribute("\\blackbox"))
@@ -146,7 +146,7 @@ struct EdifBackend : public Backend {
                        for (auto cell_it : module->cells_)
                        {
                                RTLIL::Cell *cell = cell_it.second;
-                               if (!design->modules.count(cell->type) || design->modules.at(cell->type)->get_bool_attribute("\\blackbox")) {
+                               if (!design->modules_.count(cell->type) || design->modules_.at(cell->type)->get_bool_attribute("\\blackbox")) {
                                        lib_cell_ports[cell->type];
                                        for (auto p : cell->connections()) {
                                                if (p.second.size() > 1)
@@ -213,11 +213,11 @@ struct EdifBackend : public Backend {
 
                // extract module dependencies
                std::map<RTLIL::Module*, std::set<RTLIL::Module*>> module_deps;
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        module_deps[mod_it.second] = std::set<RTLIL::Module*>();
                        for (auto &cell_it : mod_it.second->cells_)
-                               if (design->modules.count(cell_it.second->type) > 0)
-                                       module_deps[mod_it.second].insert(design->modules.at(cell_it.second->type));
+                               if (design->modules_.count(cell_it.second->type) > 0)
+                                       module_deps[mod_it.second].insert(design->modules_.at(cell_it.second->type));
                }
 
                // simple good-enough topological sort
index be4e2777c02729a6801144bcd4e7a7f956af2ed7..d45e94a0911599344327916cd7dbd82303c0901c 100644 (file)
@@ -339,7 +339,7 @@ void ILANG_BACKEND::dump_design(FILE *f, const RTLIL::Design *design, bool only_
 
        if (!flag_m) {
                int count_selected_mods = 0;
-               for (auto it = design->modules.begin(); it != design->modules.end(); it++) {
+               for (auto it = design->modules_.begin(); it != design->modules_.end(); it++) {
                        if (design->selected_whole_module(it->first))
                                flag_m = true;
                        if (design->selected(it->second))
@@ -355,7 +355,7 @@ void ILANG_BACKEND::dump_design(FILE *f, const RTLIL::Design *design, bool only_
                fprintf(f, "autoidx %d\n", RTLIL::autoidx);
        }
 
-       for (auto it = design->modules.begin(); it != design->modules.end(); it++) {
+       for (auto it = design->modules_.begin(); it != design->modules_.end(); it++) {
                if (!only_selected || design->selected(it->second)) {
                        if (only_selected)
                                fprintf(f, "\n");
index a463f5ece74c476fa6b5384f3ee0d9c62333423b..2f94e290d29b77ab02d7378cf85cba3f645e29db 100644 (file)
@@ -121,7 +121,7 @@ struct IntersynthBackend : public Backend {
                for (auto lib : libs)
                        ct.setup_design(lib);
 
-               for (auto module_it : design->modules)
+               for (auto module_it : design->modules_)
                {
                        RTLIL::Module *module = module_it.second;
                        SigMap sigmap(module);
index c58e4bec5cfb3a48938d887b8db12ab994ee5348..283448c3bff41246c630e2c44384cc3523d10898 100644 (file)
@@ -54,7 +54,7 @@ static void print_spice_module(FILE *f, RTLIL::Module *module, RTLIL::Design *de
 
                std::vector<RTLIL::SigSpec> port_sigs;
 
-               if (design->modules.count(cell->type) == 0)
+               if (design->modules_.count(cell->type) == 0)
                {
                        log("Warning: no (blackbox) module for cell type `%s' (%s.%s) found! Guessing order of ports.\n",
                                        RTLIL::id2cstr(cell->type), RTLIL::id2cstr(module->name), RTLIL::id2cstr(cell->name));
@@ -65,7 +65,7 @@ static void print_spice_module(FILE *f, RTLIL::Module *module, RTLIL::Design *de
                }
                else
                {
-                       RTLIL::Module *mod = design->modules.at(cell->type);
+                       RTLIL::Module *mod = design->modules_.at(cell->type);
 
                        std::vector<RTLIL::Wire*> ports;
                        for (auto wire_it : mod->wires_) {
@@ -171,14 +171,14 @@ struct SpiceBackend : public Backend {
                extra_args(f, filename, args, argidx);
 
                if (top_module_name.empty())
-                       for (auto & mod_it:design->modules)
+                       for (auto & mod_it:design->modules_)
                                if (mod_it.second->get_bool_attribute("\\top"))
                                        top_module_name = mod_it.first;
 
                fprintf(f, "* SPICE netlist generated by %s\n", yosys_version_str);
                fprintf(f, "\n");
 
-               for (auto module_it : design->modules)
+               for (auto module_it : design->modules_)
                {
                        RTLIL::Module *module = module_it.second;
                        if (module->get_bool_attribute("\\blackbox"))
index 098e29f925fa2175554cd35cfddae54ccb4d51ac..f7f0ecaf49b0104184614fbac81aa32568403400 100644 (file)
@@ -1055,7 +1055,7 @@ struct VerilogBackend : public Backend {
                extra_args(f, filename, args, argidx);
 
                fprintf(f, "/* Generated by %s */\n", yosys_version_str);
-               for (auto it = design->modules.begin(); it != design->modules.end(); it++) {
+               for (auto it = design->modules_.begin(); it != design->modules_.end(); it++) {
                        if (it->second->get_bool_attribute("\\blackbox") != blackboxes)
                                continue;
                        if (selected && !design->selected_whole_module(it->first)) {
index 3f704bea4fabf40b5081304fd3a2e6ca935375f4..17041686900695d6c583e47a822d2817cc80eb07 100644 (file)
@@ -931,7 +931,7 @@ void AST::process(RTLIL::Design *design, AstNode *ast, bool dump_ast1, bool dump
                        (*it)->str = (*it)->str.substr(1);
                if (defer)
                        (*it)->str = "$abstract" + (*it)->str;
-               if (design->modules.count((*it)->str)) {
+               if (design->modules_.count((*it)->str)) {
                        if (!ignore_redef)
                                log_error("Re-definition of module `%s' at %s:%d!\n",
                                                (*it)->str.c_str(), (*it)->filename.c_str(), (*it)->linenum);
@@ -939,7 +939,7 @@ void AST::process(RTLIL::Design *design, AstNode *ast, bool dump_ast1, bool dump
                                        (*it)->str.c_str(), (*it)->filename.c_str(), (*it)->linenum);
                        continue;
                }
-               design->modules[(*it)->str] =  process_module(*it, defer);
+               design->modules_[(*it)->str] =  process_module(*it, defer);
        }
 }
 
@@ -1036,10 +1036,10 @@ RTLIL::IdString AstModule::derive(RTLIL::Design *design, std::map<RTLIL::IdStrin
                modname = "$paramod" + stripped_name + para_info;
        }
 
-       if (design->modules.count(modname) == 0) {
+       if (design->modules_.count(modname) == 0) {
                new_ast->str = modname;
-               design->modules[modname] = process_module(new_ast, false);
-               design->modules[modname]->check();
+               design->modules_[modname] = process_module(new_ast, false);
+               design->modules_[modname]->check();
        } else {
                log("Found cached RTLIL representation for module `%s'.\n", modname.c_str());
        }
index 0107b974a2b4800ac8eb394844d42eaea2de23ac..d5f172f0324557712aa3b9abb16bf185fe1cc8ae 100644 (file)
@@ -476,7 +476,7 @@ struct LibertyFrontend : public Frontend {
 
                        std::string cell_name = RTLIL::escape_id(cell->args.at(0));
 
-                       if (design->modules.count(cell_name)) {
+                       if (design->modules_.count(cell_name)) {
                                if (flag_ignore_redef)
                                        continue;
                                log_error("Duplicate definition of cell/module %s.\n", RTLIL::id2cstr(cell_name));
@@ -564,7 +564,7 @@ struct LibertyFrontend : public Frontend {
                        }
 
                        module->fixup_ports();
-                       design->modules[module->name] = module;
+                       design->modules_[module->name] = module;
                        cell_count++;
 skip_cell:;
                }
index d3c848f46add626f0c41bc199404e1c9649be1ba..20d68d559d53a308324add5f316fe1490ae896c6 100644 (file)
@@ -171,7 +171,7 @@ struct CellTypes
                if (cell_types.count(type) > 0)
                        return true;
                for (auto design : designs)
-                       if (design->modules.count(type) > 0)
+                       if (design->modules_.count(type) > 0)
                                return true;
                return false;
        }
@@ -180,9 +180,9 @@ struct CellTypes
        {
                if (cell_types.count(type) == 0) {
                        for (auto design : designs)
-                               if (design->modules.count(type) > 0) {
-                                       if (design->modules.at(type)->wires_.count(port))
-                                               return design->modules.at(type)->wires_.at(port)->port_output;
+                               if (design->modules_.count(type) > 0) {
+                                       if (design->modules_.at(type)->wires_.count(port))
+                                               return design->modules_.at(type)->wires_.at(port)->port_output;
                                        return false;
                                }
                        return false;
@@ -203,9 +203,9 @@ struct CellTypes
        {
                if (cell_types.count(type) == 0) {
                        for (auto design : designs)
-                               if (design->modules.count(type) > 0) {
-                                       if (design->modules.at(type)->wires_.count(port))
-                                               return design->modules.at(type)->wires_.at(port)->port_input;
+                               if (design->modules_.count(type) > 0) {
+                                       if (design->modules_.at(type)->wires_.count(port))
+                                               return design->modules_.at(type)->wires_.at(port)->port_input;
                                        return false;
                                }
                        return false;
index edf23cd20556db9ecefb5f377065d62bded928e5..7a1c7ed16a9009736cedcc1065b7879e6e43c6d0 100644 (file)
@@ -234,14 +234,14 @@ static char *readline_obj_generator(const char *text, int state)
 
                if (design->selected_active_module.empty())
                {
-                       for (auto &it : design->modules)
+                       for (auto &it : design->modules_)
                                if (RTLIL::unescape_id(it.first).substr(0, len) == text)
                                        obj_names.push_back(strdup(RTLIL::id2cstr(it.first.c_str())));
                }
                else
-               if (design->modules.count(design->selected_active_module) > 0)
+               if (design->modules_.count(design->selected_active_module) > 0)
                {
-                       RTLIL::Module *module = design->modules.at(design->selected_active_module);
+                       RTLIL::Module *module = design->modules_.at(design->selected_active_module);
 
                        for (auto &it : module->wires_)
                                if (RTLIL::unescape_id(it.first).substr(0, len) == text)
index 5fdcb025affe05a95df2aecbd6aaa1bc35275a3a..5709875ec723ab63c7b5a4d7e6ea71ca9c3b1df9 100644 (file)
@@ -175,7 +175,7 @@ void RTLIL::Selection::optimize(RTLIL::Design *design)
 
        del_list.clear();
        for (auto mod_name : selected_modules) {
-               if (design->modules.count(mod_name) == 0)
+               if (design->modules_.count(mod_name) == 0)
                        del_list.push_back(mod_name);
                selected_members.erase(mod_name);
        }
@@ -184,7 +184,7 @@ void RTLIL::Selection::optimize(RTLIL::Design *design)
 
        del_list.clear();
        for (auto &it : selected_members)
-               if (design->modules.count(it.first) == 0)
+               if (design->modules_.count(it.first) == 0)
                        del_list.push_back(it.first);
        for (auto mod_name : del_list)
                selected_members.erase(mod_name);
@@ -192,7 +192,7 @@ void RTLIL::Selection::optimize(RTLIL::Design *design)
        for (auto &it : selected_members) {
                del_list.clear();
                for (auto memb_name : it.second)
-                       if (design->modules[it.first]->count_id(memb_name) == 0)
+                       if (design->modules_[it.first]->count_id(memb_name) == 0)
                                del_list.push_back(memb_name);
                for (auto memb_name : del_list)
                        it.second.erase(memb_name);
@@ -203,8 +203,8 @@ void RTLIL::Selection::optimize(RTLIL::Design *design)
        for (auto &it : selected_members)
                if (it.second.size() == 0)
                        del_list.push_back(it.first);
-               else if (it.second.size() == design->modules[it.first]->wires_.size() + design->modules[it.first]->memories.size() +
-                               design->modules[it.first]->cells_.size() + design->modules[it.first]->processes.size())
+               else if (it.second.size() == design->modules_[it.first]->wires_.size() + design->modules_[it.first]->memories.size() +
+                               design->modules_[it.first]->cells_.size() + design->modules_[it.first]->processes.size())
                        add_list.push_back(it.first);
        for (auto mod_name : del_list)
                selected_members.erase(mod_name);
@@ -213,7 +213,7 @@ void RTLIL::Selection::optimize(RTLIL::Design *design)
                selected_modules.insert(mod_name);
        }
 
-       if (selected_modules.size() == design->modules.size()) {
+       if (selected_modules.size() == design->modules_.size()) {
                full_selection = true;
                selected_modules.clear();
                selected_members.clear();
@@ -222,14 +222,14 @@ void RTLIL::Selection::optimize(RTLIL::Design *design)
 
 RTLIL::Design::~Design()
 {
-       for (auto it = modules.begin(); it != modules.end(); it++)
+       for (auto it = modules_.begin(); it != modules_.end(); it++)
                delete it->second;
 }
 
 void RTLIL::Design::check()
 {
 #ifndef NDEBUG
-       for (auto &it : modules) {
+       for (auto &it : modules_) {
                assert(it.first == it.second->name);
                assert(it.first.size() > 0 && (it.first[0] == '\\' || it.first[0] == '$'));
                it.second->check();
@@ -239,7 +239,7 @@ void RTLIL::Design::check()
 
 void RTLIL::Design::optimize()
 {
-       for (auto &it : modules)
+       for (auto &it : modules_)
                it.second->optimize();
        for (auto &it : selection_stack)
                it.optimize(this);
index 2fbfe8049da19c4a55ff3f9a99274ae5994658b9..7249f0cada6ea4341b8b1bf3453c2cc6d86d52fd 100644 (file)
@@ -340,7 +340,7 @@ struct RTLIL::Selection
 
 struct RTLIL::Design
 {
-       std::map<RTLIL::IdString, RTLIL::Module*> modules;
+       std::map<RTLIL::IdString, RTLIL::Module*> modules_;
 
        std::vector<RTLIL::Selection> selection_stack;
        std::map<RTLIL::IdString, RTLIL::Selection> selection_vars;
index a579074357443470d4d6b3d8aea3a65e652485e8..4d1452c97c682f4c58a03fbf3e70290ea5298e12 100644 (file)
@@ -120,7 +120,7 @@ struct StubnetsPass : public Pass {
 
                // call find_stub_nets() for each module that is either
                // selected as a whole or contains selected objects.
-               for (auto &it : design->modules)
+               for (auto &it : design->modules_)
                        if (design->selected_module(it.first))
                                find_stub_nets(design, it.second, report_bits);
        }
index c724ce375928b0e707dc319bded5fe61d3943edd..8dc72c750438a8a3a24f06360cde9e1dde07af2c 100644 (file)
@@ -12,7 +12,7 @@ struct MyPass : public Pass {
             log("  %s\n", arg.c_str());
 
         log("Modules in current design:\n");
-        for (auto &mod : design->modules)
+        for (auto &mod : design->modules_)
             log("  %s (%zd wires, %zd cells)\n", RTLIL::id2cstr(mod.first),
                     mod.second->wires_.size(), mod.second->cells_.size());
     }
@@ -40,11 +40,11 @@ struct Test1Pass : public Pass {
 
         log("Name of this module: %s\n", RTLIL::id2cstr(module->name));
 
-        if (design->modules.count(module->name) != 0)
+        if (design->modules_.count(module->name) != 0)
             log_error("A module with the name %s already exists!\n",
                     RTLIL::id2cstr(module->name));
 
-        design->modules[module->name] = module;
+        design->modules_[module->name] = module;
     }
 } Test1Pass;
 
@@ -56,7 +56,7 @@ struct Test2Pass : public Pass {
         if (design->selection_stack.back().empty())
             log_cmd_error("This command can't operator on an empty selection!\n");
 
-        RTLIL::Module *module = design->modules.at("\\test");
+        RTLIL::Module *module = design->modules_.at("\\test");
 
         RTLIL::SigSpec a(module->wires_.at("\\a")), x(module->wires_.at("\\x")),
                                                    y(module->wires_.at("\\y"));
index 7ba9424e8502ac1536c1c7f0aac443f43682af13..03fc9f9370c4dadcb4597dff307d079359f1ba12 100644 (file)
@@ -684,7 +684,7 @@ static void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std
                free(p);
 
                log_header("Re-integrating ABC results.\n");
-               RTLIL::Module *mapped_mod = mapped_design->modules["\\netlist"];
+               RTLIL::Module *mapped_mod = mapped_design->modules_["\\netlist"];
                if (mapped_mod == NULL)
                        log_error("ABC output file does not contain a module `netlist'.\n");
                for (auto &it : mapped_mod->wires_) {
@@ -1000,7 +1000,7 @@ struct AbcPass : public Pass {
                if (!constr_file.empty() && liberty_file.empty())
                        log_cmd_error("Got -constr but no -liberty!\n");
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second)) {
                                if (mod_it.second->processes.size() > 0)
                                        log("Skipping module %s as it contains processes.\n", mod_it.second->name.c_str());
index 773bbe5d220504baacd1260d88a4769a078e89bb..4bcbc01311ee9293ba5dca7d2717b049006119e3 100644 (file)
@@ -60,7 +60,7 @@ RTLIL::Design *abc_parse_blif(FILE *f, std::string dff_name)
 
        int port_count = 0;
        module->name = "\\netlist";
-       design->modules[module->name] = module;
+       design->modules_[module->name] = module;
 
        size_t buffer_size = 4096;
        char *buffer = (char*)malloc(buffer_size);
index 49aa7c98d34127dda31904ea52a7fb178cf08ea0..62995a49d546c1607f9c87575f57ecf8e43b03eb 100644 (file)
@@ -64,10 +64,10 @@ static void add_wire(RTLIL::Design *design, RTLIL::Module *module, std::string n
 
        for (auto &it : module->cells_)
        {
-               if (design->modules.count(it.second->type) == 0)
+               if (design->modules_.count(it.second->type) == 0)
                        continue;
 
-               RTLIL::Module *mod = design->modules.at(it.second->type);
+               RTLIL::Module *mod = design->modules_.at(it.second->type);
                if (!design->selected_whole_module(mod->name))
                        continue;
                if (mod->get_bool_attribute("\\blackbox"))
@@ -136,7 +136,7 @@ struct AddPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod : design->modules)
+               for (auto &mod : design->modules_)
                {
                        RTLIL::Module *module = mod.second;
                        if (!design->selected_whole_module(module->name))
index 6494ea6f604953b52aadc3458174572f39278162..3e13fd4d4dd3f6e2e23233ae53837816617132e1 100644 (file)
@@ -75,7 +75,7 @@ struct ConnectPass : public Pass {
        virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
        {
                RTLIL::Module *module = NULL;
-               for (auto &it : design->modules) {
+               for (auto &it : design->modules_) {
                        if (!design->selected(it.second))
                                continue;
                        if (module != NULL)
index cc8147c53b8f168986700b20a594b1e941729533..5125ff5e2898cf1a8eec5241934194851d590406 100644 (file)
@@ -197,7 +197,7 @@ struct ConnwrappersPass : public Pass {
 
                log_header("Executing CONNWRAPPERS pass (connect extended ports of wrapper cells).\n");
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                worker.work(design, mod_it.second);
        }
index 4b1a8db81d4e4bf8d254749ae1da983b296a81b8..fc801f61fd463896bd843bec08af44622238abc7 100644 (file)
@@ -41,14 +41,14 @@ struct CopyPass : public Pass {
                std::string src_name = RTLIL::escape_id(args[1]);
                std::string trg_name = RTLIL::escape_id(args[2]);
 
-               if (design->modules.count(src_name) == 0)
+               if (design->modules_.count(src_name) == 0)
                        log_cmd_error("Can't find source module %s.\n", src_name.c_str());
 
-               if (design->modules.count(trg_name) != 0)
+               if (design->modules_.count(trg_name) != 0)
                        log_cmd_error("Target module name %s already exists.\n", trg_name.c_str());
 
-               design->modules[trg_name] = design->modules.at(src_name)->clone();
-               design->modules[trg_name]->name = trg_name;
+               design->modules_[trg_name] = design->modules_.at(src_name)->clone();
+               design->modules_[trg_name]->name = trg_name;
        }
 } CopyPass;
  
index 2c2c370dd63da214fcc19ba8dc7b1780d4e8c54f..67b4d939fd853219d75c13d0a5d52844f421beb9 100644 (file)
@@ -66,7 +66,7 @@ struct DeletePass : public Pass {
 
                std::vector<std::string> delete_mods;
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        if (design->selected_whole_module(mod_it.first) && !flag_input && !flag_output) {
                                delete_mods.push_back(mod_it.first);
@@ -134,8 +134,8 @@ struct DeletePass : public Pass {
                }
 
                for (auto &it : delete_mods) {
-                       delete design->modules.at(it);
-                       design->modules.erase(it);
+                       delete design->modules_.at(it);
+                       design->modules_.erase(it);
                }
        }
 } DeletePass;
index 7b8889d60e220cf2295f42fc4c02ffe772e66a0e..bd1ee68f2677c37d263fcf6e8c7fd0db0206f1a8 100644 (file)
@@ -165,7 +165,7 @@ struct DesignPass : public Pass {
                                argidx = args.size();
                        }
 
-                       for (auto &it : copy_from_design->modules) {
+                       for (auto &it : copy_from_design->modules_) {
                                if (sel.selected_whole_module(it.first)) {
                                        copy_src_modules.push_back(it.second);
                                        continue;
@@ -192,10 +192,10 @@ struct DesignPass : public Pass {
                        {
                                std::string trg_name = as_name.empty() ? mod->name : RTLIL::escape_id(as_name);
 
-                               if (copy_to_design->modules.count(trg_name))
-                                       delete copy_to_design->modules.at(trg_name);
-                               copy_to_design->modules[trg_name] = mod->clone();
-                               copy_to_design->modules[trg_name]->name = trg_name;
+                               if (copy_to_design->modules_.count(trg_name))
+                                       delete copy_to_design->modules_.at(trg_name);
+                               copy_to_design->modules_[trg_name] = mod->clone();
+                               copy_to_design->modules_[trg_name]->name = trg_name;
                        }
                }
 
@@ -203,8 +203,8 @@ struct DesignPass : public Pass {
                {
                        RTLIL::Design *design_copy = new RTLIL::Design;
 
-                       for (auto &it : design->modules)
-                               design_copy->modules[it.first] = it.second->clone();
+                       for (auto &it : design->modules_)
+                               design_copy->modules_[it.first] = it.second->clone();
 
                        design_copy->selection_stack = design->selection_stack;
                        design_copy->selection_vars = design->selection_vars;
@@ -221,9 +221,9 @@ struct DesignPass : public Pass {
 
                if (reset_mode || !load_name.empty() || push_mode || pop_mode)
                {
-                       for (auto &it : design->modules)
+                       for (auto &it : design->modules_)
                                delete it.second;
-                       design->modules.clear();
+                       design->modules_.clear();
 
                        design->selection_stack.clear();
                        design->selection_vars.clear();
@@ -239,8 +239,8 @@ struct DesignPass : public Pass {
                        if (pop_mode)
                                pushed_designs.pop_back();
 
-                       for (auto &it : saved_design->modules)
-                               design->modules[it.first] = it.second->clone();
+                       for (auto &it : saved_design->modules_)
+                               design->modules_[it.first] = it.second->clone();
 
                        design->selection_stack = saved_design->selection_stack;
                        design->selection_vars = saved_design->selection_vars;
index c8b8160f14857945e3c0c3cd20c88b446ce126a5..3a60087211048ee8349c31441b489608c0d2de6b 100644 (file)
@@ -96,7 +96,7 @@ struct RenamePass : public Pass {
                {
                        extra_args(args, argidx, design);
 
-                       for (auto &mod : design->modules)
+                       for (auto &mod : design->modules_)
                        {
                                int counter = 0;
 
@@ -128,7 +128,7 @@ struct RenamePass : public Pass {
                {
                        extra_args(args, argidx, design);
 
-                       for (auto &mod : design->modules)
+                       for (auto &mod : design->modules_)
                        {
                                RTLIL::Module *module = mod.second;
                                if (!design->selected(module))
@@ -163,19 +163,19 @@ struct RenamePass : public Pass {
 
                        if (!design->selected_active_module.empty())
                        {
-                               if (design->modules.count(design->selected_active_module) > 0)
-                                       rename_in_module(design->modules.at(design->selected_active_module), from_name, to_name);
+                               if (design->modules_.count(design->selected_active_module) > 0)
+                                       rename_in_module(design->modules_.at(design->selected_active_module), from_name, to_name);
                        }
                        else
                        {
-                               for (auto &mod : design->modules) {
+                               for (auto &mod : design->modules_) {
                                        if (mod.first == from_name || RTLIL::unescape_id(mod.first) == from_name) {
                                                to_name = RTLIL::escape_id(to_name);
                                                log("Renaming module %s to %s.\n", mod.first.c_str(), to_name.c_str());
                                                RTLIL::Module *module = mod.second;
-                                               design->modules.erase(module->name);
+                                               design->modules_.erase(module->name);
                                                module->name = to_name;
-                                               design->modules[module->name] = module;
+                                               design->modules_[module->name] = module;
                                                goto rename_ok;
                                        }
                                }
index a1c12f1eead7455a1e4c0f8cb4d92f1053da8846..e09c00123e4382acde8dda8963336d5e52bfd054 100644 (file)
@@ -43,7 +43,7 @@ struct ScatterPass : public Pass {
                CellTypes ct(design);
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        if (!design->selected(mod_it.second))
                                continue;
index c9504341728d6f324169fa15d18a2c85cebfe068..1fa1b4c9c6c98ba8f119eaa38f1e0917553e042b 100644 (file)
@@ -280,7 +280,7 @@ struct SccPass : public Pass {
 
                RTLIL::Selection newSelection(false);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                        {
                                SccWorker worker(design, mod_it.second, allCellTypes, maxDepth);
index 306b7a5b18ae08ac0cceec1de201269a53b3b1ad..85c52277c39c6e965d6565e64b56b55eeccf5037 100644 (file)
@@ -151,7 +151,7 @@ static void select_op_neg(RTLIL::Design *design, RTLIL::Selection &lhs)
 
        RTLIL::Selection new_sel(false);
 
-       for (auto &mod_it : design->modules)
+       for (auto &mod_it : design->modules_)
        {
                if (lhs.selected_whole_module(mod_it.first))
                        continue;
@@ -181,13 +181,13 @@ static void select_op_neg(RTLIL::Design *design, RTLIL::Selection &lhs)
 
 static void select_op_submod(RTLIL::Design *design, RTLIL::Selection &lhs)
 {
-       for (auto &mod_it : design->modules)
+       for (auto &mod_it : design->modules_)
        {
                if (lhs.selected_whole_module(mod_it.first))
                {
                        for (auto &cell_it : mod_it.second->cells_)
                        {
-                               if (design->modules.count(cell_it.second->type) == 0)
+                               if (design->modules_.count(cell_it.second->type) == 0)
                                        continue;
                                lhs.selected_modules.insert(cell_it.second->type);
                        }
@@ -205,7 +205,7 @@ static void select_op_fullmod(RTLIL::Design *design, RTLIL::Selection &lhs)
 
 static void select_op_alias(RTLIL::Design *design, RTLIL::Selection &lhs)
 {
-       for (auto &mod_it : design->modules)
+       for (auto &mod_it : design->modules_)
        {
                if (lhs.selected_whole_module(mod_it.first))
                        continue;
@@ -260,7 +260,7 @@ static void select_op_diff(RTLIL::Design *design, RTLIL::Selection &lhs, const R
                if (!rhs.full_selection && rhs.selected_modules.size() == 0 && rhs.selected_members.size() == 0)
                        return;
                lhs.full_selection = false;
-               for (auto &it : design->modules)
+               for (auto &it : design->modules_)
                        lhs.selected_modules.insert(it.first);
        }
 
@@ -271,10 +271,10 @@ static void select_op_diff(RTLIL::Design *design, RTLIL::Selection &lhs, const R
 
        for (auto &it : rhs.selected_members)
        {
-               if (design->modules.count(it.first) == 0)
+               if (design->modules_.count(it.first) == 0)
                        continue;
 
-               RTLIL::Module *mod = design->modules[it.first];
+               RTLIL::Module *mod = design->modules_[it.first];
 
                if (lhs.selected_modules.count(mod->name) > 0)
                {
@@ -304,7 +304,7 @@ static void select_op_intersect(RTLIL::Design *design, RTLIL::Selection &lhs, co
 
        if (lhs.full_selection) {
                lhs.full_selection = false;
-               for (auto &it : design->modules)
+               for (auto &it : design->modules_)
                        lhs.selected_modules.insert(it.first);
        }
 
@@ -368,7 +368,7 @@ static int select_op_expand(RTLIL::Design *design, RTLIL::Selection &lhs, std::v
 {
        int sel_objects = 0;
        bool is_input, is_output;
-       for (auto &mod_it : design->modules)
+       for (auto &mod_it : design->modules_)
        {
                if (lhs.selected_whole_module(mod_it.first) || !lhs.selected_module(mod_it.first))
                        continue;
@@ -684,7 +684,7 @@ static void select_stmt(RTLIL::Design *design, std::string arg)
        }
        
        sel.full_selection = false;
-       for (auto &mod_it : design->modules)
+       for (auto &mod_it : design->modules_)
        {
                if (arg_mod.substr(0, 2) == "A:") {
                        if (!match_attr(mod_it.second->attributes, arg_mod.substr(2)))
@@ -1078,7 +1078,7 @@ struct SelectPass : public Pass {
                        }
                        if (arg == "-module" && argidx+1 < args.size()) {
                                RTLIL::IdString mod_name = RTLIL::escape_id(args[++argidx]);
-                               if (design->modules.count(mod_name) == 0)
+                               if (design->modules_.count(mod_name) == 0)
                                        log_cmd_error("No such module: %s\n", id2cstr(mod_name));
                                design->selected_active_module = mod_name;
                                got_module = true;
@@ -1147,7 +1147,7 @@ struct SelectPass : public Pass {
                        if (work_stack.size() > 0)
                                sel = &work_stack.back();
                        sel->optimize(design);
-                       for (auto mod_it : design->modules)
+                       for (auto mod_it : design->modules_)
                        {
                                if (sel->selected_whole_module(mod_it.first) && list_mode)
                                        log("%s\n", id2cstr(mod_it.first));
@@ -1217,7 +1217,7 @@ struct SelectPass : public Pass {
                                log_cmd_error("No selection to check.\n");
                        RTLIL::Selection *sel = &work_stack.back();
                        sel->optimize(design);
-                       for (auto mod_it : design->modules)
+                       for (auto mod_it : design->modules_)
                                if (sel->selected_module(mod_it.first)) {
                                        for (auto &it : mod_it.second->wires_)
                                                if (sel->selected_member(mod_it.first, it.first))
@@ -1299,15 +1299,15 @@ struct CdPass : public Pass {
 
                std::string modname = RTLIL::escape_id(args[1]);
 
-               if (design->modules.count(modname) == 0 && !design->selected_active_module.empty()) {
+               if (design->modules_.count(modname) == 0 && !design->selected_active_module.empty()) {
                        RTLIL::Module *module = NULL;
-                       if (design->modules.count(design->selected_active_module) > 0)
-                               module = design->modules.at(design->selected_active_module);
+                       if (design->modules_.count(design->selected_active_module) > 0)
+                               module = design->modules_.at(design->selected_active_module);
                        if (module != NULL && module->cells_.count(modname) > 0)
                                modname = module->cells_.at(modname)->type;
                }
 
-               if (design->modules.count(modname) > 0) {
+               if (design->modules_.count(modname) > 0) {
                        design->selected_active_module = modname;
                        design->selection_stack.back() = RTLIL::Selection();
                        select_filter_active_mod(design, design->selection_stack.back());
@@ -1368,12 +1368,12 @@ struct LsPass : public Pass {
 
                if (design->selected_active_module.empty())
                {
-                       counter += log_matches("modules", pattern, design->modules);
+                       counter += log_matches("modules", pattern, design->modules_);
                }
                else
-               if (design->modules.count(design->selected_active_module) > 0)
+               if (design->modules_.count(design->selected_active_module) > 0)
                {
-                       RTLIL::Module *module = design->modules.at(design->selected_active_module);
+                       RTLIL::Module *module = design->modules_.at(design->selected_active_module);
                        counter += log_matches("wires", pattern, module->wires_);
                        counter += log_matches("memories", pattern, module->memories);
                        counter += log_matches("cells", pattern, module->cells_);
index ea5221f6db334c64467a0c26af4776e0691fe4e2..029c0ec794c3e85ab334c767bd9bf0a9a8ee26e8 100644 (file)
@@ -98,7 +98,7 @@ struct SetattrPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod : design->modules)
+               for (auto &mod : design->modules_)
                {
                        RTLIL::Module *module = mod.second;
 
@@ -164,7 +164,7 @@ struct SetparamPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod : design->modules)
+               for (auto &mod : design->modules_)
                {
                        RTLIL::Module *module = mod.second;
 
index e7779415d7375916edd634f82d28cde5311814e8..c72e64b80645b22c38e7f37af1ed438614bd0748 100644 (file)
@@ -115,7 +115,7 @@ struct SetundefPass : public Pass {
                if (!got_value)
                        log_cmd_error("One of the options -zero, -one, or -random <seed> must be specified.\n");
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        RTLIL::Module *module = mod_it.second;
                        if (!design->selected(module))
index 18af8dfce325ddd7d1d2e38be5eb6f06a3661535..7ab1daf00d3535fe3c7c227c25c40b0882a27e69 100644 (file)
@@ -506,7 +506,7 @@ struct ShowWorker
 
                design->optimize();
                page_counter = 0;
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        module = mod_it.second;
                        if (!design->selected_module(module->name))
@@ -692,7 +692,7 @@ struct ShowPass : public Pass {
 
                if (format != "ps") {
                        int modcount = 0;
-                       for (auto &mod_it : design->modules) {
+                       for (auto &mod_it : design->modules_) {
                                if (mod_it.second->get_bool_attribute("\\blackbox"))
                                        continue;
                                if (mod_it.second->cells_.empty() && mod_it.second->connections().empty())
index dcd2f819f5d8dd66d6df68c15b6f1df0ad0d4a01..5fce2d6cb1e8afa16712cd951a6f261977ce588d 100644 (file)
@@ -327,7 +327,7 @@ struct SplicePass : public Pass {
 
                log_header("Executing SPLICE pass (creating cells for signal splicing).\n");
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        if (!design->selected(mod_it.second))
                                continue;
index 0998a1622d26dd9ed244e825829998aaccf98999..6b1dbe13c3e2d2773dc19fce7ce0ad1aeb2ca32e 100644 (file)
@@ -117,7 +117,7 @@ struct SplitnetsPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        RTLIL::Module *module = mod_it.second;
                        if (!design->selected(module))
index 153226ab5b873f09a95e28245dbf7b1b1bdac8bc..fabc80ec05caeda8846edb5fc78d7fc484759af1 100644 (file)
@@ -166,16 +166,16 @@ struct StatPass : public Pass {
                for (argidx = 1; argidx < args.size(); argidx++)
                {
                        if (args[argidx] == "-top" && argidx+1 < args.size()) {
-                               if (design->modules.count(RTLIL::escape_id(args[argidx+1])) == 0)
+                               if (design->modules_.count(RTLIL::escape_id(args[argidx+1])) == 0)
                                        log_cmd_error("Can't find module %s.\n", args[argidx+1].c_str());
-                               top_mod = design->modules.at(RTLIL::escape_id(args[++argidx]));
+                               top_mod = design->modules_.at(RTLIL::escape_id(args[++argidx]));
                                continue;
                        }
                        break;
                }
                extra_args(args, argidx, design);
 
-               for (auto &it : design->modules)
+               for (auto &it : design->modules_)
                {
                        if (!design->selected_module(it.first))
                                continue;
index e1528f31d2889f713b642b4cec3308489879b66f..a619cf57db7ae31e9345576e13d3360544715782 100644 (file)
@@ -148,7 +148,7 @@ struct FsmDetectPass : public Pass {
                ct.setup_stdcells();
                ct.setup_stdcells_mem();
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        if (!design->selected(mod_it.second))
                                continue;
index 40ec55c11ca1492201860f764a238f43cce255a0..f107366d68112d8e956d202b3d2ee368c97f4a2d 100644 (file)
@@ -258,7 +258,7 @@ struct FsmExpandPass : public Pass {
                log_header("Executing FSM_EXPAND pass (merging auxiliary logic into FSMs).\n");
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (!design->selected(mod_it.second))
                                continue;
                        std::vector<RTLIL::Cell*> fsm_cells;
index 129e7f9a652812789fab5d50991a164437cad69f..f84f372ac974b4a87d84f53a336eda66497a8d15 100644 (file)
@@ -174,7 +174,7 @@ struct FsmExportPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                for (auto &cell_it : mod_it.second->cells_)
                                        if (cell_it.second->type == "$fsm" && design->selected(mod_it.second, cell_it.second)) {
index 64b01064a769e3363693946ad0af070cbc3283df..99352b10a1fdae3bd150d9ca6eb01f7f6fe2a001 100644 (file)
@@ -330,7 +330,7 @@ struct FsmExtractPass : public Pass {
                ct.setup_stdcells();
                ct.setup_stdcells_mem();
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        if (!design->selected(mod_it.second))
                                continue;
index 4526939cefd1c6550a81b0aee0e1bbc2da160555..45d68a9062558ca6b93f4f37de7990ead386f20a 100644 (file)
@@ -43,7 +43,7 @@ struct FsmInfoPass : public Pass {
                log_header("Executing FSM_INFO pass (dumping all available information on FSM cells).\n");
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                for (auto &cell_it : mod_it.second->cells_)
                                        if (cell_it.second->type == "$fsm" && design->selected(mod_it.second, cell_it.second)) {
index f6ef12a7a2784342581c6edb0618446275e511bc..8b9ad6be744d55429ada8ead0aaa68e4b4f00e57 100644 (file)
@@ -309,7 +309,7 @@ struct FsmMapPass : public Pass {
                log_header("Executing FSM_MAP pass (mapping FSMs to basic logic).\n");
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (!design->selected(mod_it.second))
                                continue;
                        std::vector<RTLIL::Cell*> fsm_cells;
index 165b097478cfc9255a866c483c70b651298038c1..9d9156ae311c6f96e9c735dd11e6b94a2d2dbf64 100644 (file)
@@ -288,7 +288,7 @@ struct FsmOptPass : public Pass {
                log_header("Executing FSM_OPT pass (simple optimizations of FSMs).\n");
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (design->selected(mod_it.second))
                                for (auto &cell_it : mod_it.second->cells_)
                                        if (cell_it.second->type == "$fsm" and design->selected(mod_it.second, cell_it.second))
index 1b2eeb237854d214518f1145c0fddb62b8f26bdd..40fed130e8bf628e91038c15538e3f8910839de7 100644 (file)
@@ -144,7 +144,7 @@ struct FsmRecodePass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                for (auto &cell_it : mod_it.second->cells_)
                                        if (cell_it.second->type == "$fsm" && design->selected(mod_it.second, cell_it.second))
index 550ec39f0bbd4678d7c3bc956faccb207b1aa90a..8aec25ebad3adc67846c63d08c4b6e263c78732b 100644 (file)
@@ -37,11 +37,11 @@ static void generate(RTLIL::Design *design, const std::vector<std::string> &cell
 {
        std::set<std::string> found_celltypes;
 
-       for (auto i1 : design->modules)
+       for (auto i1 : design->modules_)
        for (auto i2 : i1.second->cells_)
        {
                RTLIL::Cell *cell = i2.second;
-               if (cell->type[0] == '$' || design->modules.count(cell->type) > 0)
+               if (cell->type[0] == '$' || design->modules_.count(cell->type) > 0)
                        continue;
                for (auto &pattern : celltypes)
                        if (!fnmatch(pattern.c_str(), RTLIL::unescape_id(cell->type).c_str(), FNM_NOESCAPE))
@@ -55,7 +55,7 @@ static void generate(RTLIL::Design *design, const std::vector<std::string> &cell
                std::map<std::string, int> portwidths;
                log("Generate module for cell type %s:\n", celltype.c_str());
 
-               for (auto i1 : design->modules)
+               for (auto i1 : design->modules_)
                for (auto i2 : i1.second->cells_)
                        if (i2.second->type == celltype) {
                                for (auto &conn : i2.second->connections()) {
@@ -115,7 +115,7 @@ static void generate(RTLIL::Design *design, const std::vector<std::string> &cell
                RTLIL::Module *mod = new RTLIL::Module;
                mod->name = celltype;
                mod->attributes["\\blackbox"] = RTLIL::Const(1);
-               design->modules[mod->name] = mod;
+               design->modules_[mod->name] = mod;
 
                for (auto &decl : ports) {
                        RTLIL::Wire *wire = mod->addWire(decl.portname, portwidths.at(decl.portname));
@@ -151,11 +151,11 @@ static bool expand_module(RTLIL::Design *design, RTLIL::Module *module, bool fla
                        cell->type = cell->type.substr(pos_type + 1);
                }
 
-               if (design->modules.count(cell->type) == 0)
+               if (design->modules_.count(cell->type) == 0)
                {
-                       if (design->modules.count("$abstract" + cell->type))
+                       if (design->modules_.count("$abstract" + cell->type))
                        {
-                               cell->type = design->modules.at("$abstract" + cell->type)->derive(design, cell->parameters);
+                               cell->type = design->modules_.at("$abstract" + cell->type)->derive(design, cell->parameters);
                                cell->parameters.clear();
                                did_something = true;
                                continue;
@@ -189,7 +189,7 @@ static bool expand_module(RTLIL::Design *design, RTLIL::Module *module, bool fla
                        continue;
 
                loaded_module:
-                       if (design->modules.count(cell->type) == 0)
+                       if (design->modules_.count(cell->type) == 0)
                                log_error("File `%s' from libdir does not declare module `%s'.\n", filename.c_str(), cell->type.c_str());
                        did_something = true;
                }
@@ -197,10 +197,10 @@ static bool expand_module(RTLIL::Design *design, RTLIL::Module *module, bool fla
                if (cell->parameters.size() == 0)
                        continue;
 
-               if (design->modules.at(cell->type)->get_bool_attribute("\\blackbox"))
+               if (design->modules_.at(cell->type)->get_bool_attribute("\\blackbox"))
                        continue;
 
-               RTLIL::Module *mod = design->modules[cell->type];
+               RTLIL::Module *mod = design->modules_[cell->type];
                cell->type = mod->derive(design, cell->parameters);
                cell->parameters.clear();
                did_something = true;
@@ -211,10 +211,10 @@ static bool expand_module(RTLIL::Design *design, RTLIL::Module *module, bool fla
                RTLIL::Cell *cell = it.first;
                int idx = it.second.first, num = it.second.second;
 
-               if (design->modules.count(cell->type) == 0)
+               if (design->modules_.count(cell->type) == 0)
                        log_error("Array cell `%s.%s' of unkown type `%s'.\n", RTLIL::id2cstr(module->name), RTLIL::id2cstr(cell->name), RTLIL::id2cstr(cell->type));
 
-               RTLIL::Module *mod = design->modules[cell->type];
+               RTLIL::Module *mod = design->modules_[cell->type];
 
                for (auto &conn : cell->connections_) {
                        int conn_size = conn.second.size();
@@ -253,8 +253,8 @@ static void hierarchy_worker(RTLIL::Design *design, std::set<RTLIL::Module*> &us
        used.insert(mod);
 
        for (auto &it : mod->cells_) {
-               if (design->modules.count(it.second->type) > 0)
-                       hierarchy_worker(design, used, design->modules[it.second->type], indent+4);
+               if (design->modules_.count(it.second->type) > 0)
+                       hierarchy_worker(design, used, design->modules_[it.second->type], indent+4);
        }
 }
 
@@ -264,7 +264,7 @@ static void hierarchy(RTLIL::Design *design, RTLIL::Module *top, bool purge_lib,
        hierarchy_worker(design, used, top, 0);
 
        std::vector<RTLIL::Module*> del_modules;
-       for (auto &it : design->modules)
+       for (auto &it : design->modules_)
                if (used.count(it.second) == 0)
                        del_modules.push_back(it.second);
 
@@ -274,7 +274,7 @@ static void hierarchy(RTLIL::Design *design, RTLIL::Module *top, bool purge_lib,
                if (!purge_lib && mod->get_bool_attribute("\\blackbox"))
                        continue;
                log("Removing unused module `%s'.\n", mod->name.c_str());
-               design->modules.erase(mod->name);
+               design->modules_.erase(mod->name);
                delete mod;
        }
 
@@ -412,11 +412,11 @@ struct HierarchyPass : public Pass {
                        if (args[argidx] == "-top") {
                                if (++argidx >= args.size())
                                        log_cmd_error("Option -top requires an additional argument!\n");
-                               top_mod = design->modules.count(RTLIL::escape_id(args[argidx])) ? design->modules.at(RTLIL::escape_id(args[argidx])) : NULL;
-                               if (top_mod == NULL && design->modules.count("$abstract" + RTLIL::escape_id(args[argidx]))) {
+                               top_mod = design->modules_.count(RTLIL::escape_id(args[argidx])) ? design->modules_.at(RTLIL::escape_id(args[argidx])) : NULL;
+                               if (top_mod == NULL && design->modules_.count("$abstract" + RTLIL::escape_id(args[argidx]))) {
                                        std::map<RTLIL::IdString, RTLIL::Const> empty_parameters;
-                                       design->modules.at("$abstract" + RTLIL::escape_id(args[argidx]))->derive(design, empty_parameters);
-                                       top_mod = design->modules.count(RTLIL::escape_id(args[argidx])) ? design->modules.at(RTLIL::escape_id(args[argidx])) : NULL;
+                                       design->modules_.at("$abstract" + RTLIL::escape_id(args[argidx]))->derive(design, empty_parameters);
+                                       top_mod = design->modules_.count(RTLIL::escape_id(args[argidx])) ? design->modules_.at(RTLIL::escape_id(args[argidx])) : NULL;
                                }
                                if (top_mod == NULL)
                                        log_cmd_error("Module `%s' not found!\n", args[argidx].c_str());
@@ -434,7 +434,7 @@ struct HierarchyPass : public Pass {
                log_push();
 
                if (top_mod == NULL)
-                       for (auto &mod_it : design->modules)
+                       for (auto &mod_it : design->modules_)
                                if (mod_it.second->get_bool_attribute("\\top"))
                                        top_mod = mod_it.second;
 
@@ -446,13 +446,13 @@ struct HierarchyPass : public Pass {
                while (did_something) {
                        did_something = false;
                        std::vector<std::string> modnames;
-                       modnames.reserve(design->modules.size());
-                       for (auto &mod_it : design->modules)
+                       modnames.reserve(design->modules_.size());
+                       for (auto &mod_it : design->modules_)
                                modnames.push_back(mod_it.first);
                        for (auto &modname : modnames) {
-                               if (design->modules.count(modname) == 0)
+                               if (design->modules_.count(modname) == 0)
                                        continue;
-                               if (expand_module(design, design->modules[modname], flag_check, libdirs))
+                               if (expand_module(design, design->modules_[modname], flag_check, libdirs))
                                        did_something = true;
                        }
                        if (did_something)
@@ -465,7 +465,7 @@ struct HierarchyPass : public Pass {
                }
 
                if (top_mod != NULL) {
-                       for (auto &mod_it : design->modules)
+                       for (auto &mod_it : design->modules_)
                                if (mod_it.second == top_mod)
                                        mod_it.second->attributes["\\top"] = RTLIL::Const(1);
                                else
@@ -478,14 +478,14 @@ struct HierarchyPass : public Pass {
                        std::map<std::pair<RTLIL::Module*,int>, RTLIL::IdString> pos_map;
                        std::vector<std::pair<RTLIL::Module*,RTLIL::Cell*>> pos_work;
 
-                       for (auto &mod_it : design->modules)
+                       for (auto &mod_it : design->modules_)
                        for (auto &cell_it : mod_it.second->cells_) {
                                RTLIL::Cell *cell = cell_it.second;
-                               if (design->modules.count(cell->type) == 0)
+                               if (design->modules_.count(cell->type) == 0)
                                        continue;
                                for (auto &conn : cell->connections())
                                        if (conn.first[0] == '$' && '0' <= conn.first[1] && conn.first[1] <= '9') {
-                                               pos_mods.insert(design->modules.at(cell->type));
+                                               pos_mods.insert(design->modules_.at(cell->type));
                                                pos_work.push_back(std::pair<RTLIL::Module*,RTLIL::Cell*>(mod_it.second, cell));
                                                break;
                                        }
@@ -507,7 +507,7 @@ struct HierarchyPass : public Pass {
                                for (auto &conn : cell->connections())
                                        if (conn.first[0] == '$' && '0' <= conn.first[1] && conn.first[1] <= '9') {
                                                int id = atoi(conn.first.c_str()+1);
-                                               std::pair<RTLIL::Module*,int> key(design->modules.at(cell->type), id);
+                                               std::pair<RTLIL::Module*,int> key(design->modules_.at(cell->type), id);
                                                if (pos_map.count(key) == 0) {
                                                        log("  Failed to map positional argument %d of cell %s.%s (%s).\n",
                                                                        id, RTLIL::id2cstr(module->name), RTLIL::id2cstr(cell->name), RTLIL::id2cstr(cell->type));
index 37410275602e4bdc269a23946642b15d662ed240..d32b5e1d377ea398bd534c66ca294bdb03fc7aba 100644 (file)
@@ -105,7 +105,7 @@ struct SubmodWorker
 
                RTLIL::Module *new_mod = new RTLIL::Module;
                new_mod->name = submod.full_name;
-               design->modules[new_mod->name] = new_mod;
+               design->modules_[new_mod->name] = new_mod;
                int port_counter = 1, auto_name_counter = 1;
 
                std::set<std::string> all_wire_names;
@@ -229,7 +229,7 @@ struct SubmodWorker
                                if (submodules.count(submod_str) == 0) {
                                        submodules[submod_str].name = submod_str;
                                        submodules[submod_str].full_name = module->name + "_" + submod_str;
-                                       while (design->modules.count(submodules[submod_str].full_name) != 0 ||
+                                       while (design->modules_.count(submodules[submod_str].full_name) != 0 ||
                                                        module->count_id(submodules[submod_str].full_name) != 0)
                                                submodules[submod_str].full_name += "_";
                                }
@@ -312,12 +312,12 @@ struct SubmodPass : public Pass {
                        while (did_something) {
                                did_something = false;
                                std::vector<std::string> queued_modules;
-                               for (auto &mod_it : design->modules)
+                               for (auto &mod_it : design->modules_)
                                        if (handled_modules.count(mod_it.first) == 0 && design->selected_whole_module(mod_it.first))
                                                queued_modules.push_back(mod_it.first);
                                for (auto &modname : queued_modules)
-                                       if (design->modules.count(modname) != 0) {
-                                               SubmodWorker worker(design, design->modules[modname]);
+                                       if (design->modules_.count(modname) != 0) {
+                                               SubmodWorker worker(design, design->modules_[modname]);
                                                handled_modules.insert(modname);
                                                did_something = true;
                                        }
@@ -328,7 +328,7 @@ struct SubmodPass : public Pass {
                else
                {
                        RTLIL::Module *module = NULL;
-                       for (auto &mod_it : design->modules) {
+                       for (auto &mod_it : design->modules_) {
                                if (!design->selected_module(mod_it.first))
                                        continue;
                                if (module != NULL)
index d5995ee0eeca728e280eddafa3b940c7e9e68322..d2803ae7882f5768385f6bf3d80d38639c3ea0ea 100644 (file)
@@ -200,7 +200,7 @@ struct MemoryCollectPass : public Pass {
        virtual void execute(std::vector<std::string> args, RTLIL::Design *design) {
                log_header("Executing MEMORY_COLLECT pass (generating $mem cells).\n");
                extra_args(args, 1, design);
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                handle_module(design, mod_it.second);
        }
index bb8b052dcf6ca7977a1601e73e9c0808be894a90..9a1e96796e034dba6f46b090a66758536af7b8f1 100644 (file)
@@ -212,7 +212,7 @@ struct MemoryDffPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                handle_module(design, mod_it.second, flag_wr_only);
        }
index 4bb0c8ccd24c7627005d9c371c1f0a7328d61687..53394b19a3c62f71414bf82c6664116b45fe82fc 100644 (file)
@@ -317,7 +317,7 @@ struct MemoryMapPass : public Pass {
        virtual void execute(std::vector<std::string> args, RTLIL::Design *design) {
                log_header("Executing MEMORY_MAP pass (converting $mem cells to logic and flip-flops).\n");
                extra_args(args, 1, design);
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                handle_module(design, mod_it.second);
        }
index b25cf73a7e85229078eb3ca4094e18e2f8043ccd..e61661a20426511da058d341ce537e047aac6704 100644 (file)
@@ -734,7 +734,7 @@ struct MemorySharePass : public Pass {
        virtual void execute(std::vector<std::string> args, RTLIL::Design *design) {
                log_header("Executing MEMORY_SHARE pass (consolidating $memrc/$memwr cells).\n");
                extra_args(args, 1, design);
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                MemoryShareWorker(design, mod_it.second);
        }
index 48b83f5fac165a05ac5e3234c6173d0a1f429d69..d2b9c0eeb9bf37e9a44541deae34dd15cc38ab1b 100644 (file)
@@ -102,7 +102,7 @@ struct MemoryUnpackPass : public Pass {
        virtual void execute(std::vector<std::string> args, RTLIL::Design *design) {
                log_header("Executing MEMORY_UNPACK pass (generating $memrd/$memwr cells form $mem cells).\n");
                extra_args(args, 1, design);
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                handle_module(design, mod_it.second);
        }
index 4cc5fc89a84781c772535f7ddc9a5719f6fc69d2..c219bc047ad6e932bbee5e3e6be9b5aaabf1fa67 100644 (file)
@@ -338,7 +338,7 @@ struct OptCleanPass : public Pass {
                ct_reg.setup_internals_mem();
                ct_reg.setup_stdcells_mem();
 
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (!design->selected_whole_module(mod_it.first)) {
                                if (design->selected(mod_it.second))
                                        log("Skipping module %s as it is only partially selected.\n", id2cstr(mod_it.second->name));
@@ -402,7 +402,7 @@ struct CleanPass : public Pass {
                count_rm_cells = 0;
                count_rm_wires = 0;
 
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (design->selected_whole_module(mod_it.first) && mod_it.second->processes.size() == 0)
                                do {
                                        OPT_DID_SOMETHING = false;
index 39e2254e0a6f87faddfd654c9b432a8049004d9d..bfd0161bfc1a579b5d02bb25a4a4d0f4068281a3 100644 (file)
@@ -939,7 +939,7 @@ struct OptConstPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        if (undriven)
                                replace_undriven(design, mod_it.second);
index 1d4916b5662f7d083769a5ba78309359f485fda3..82cc78bed3f9c58c1855f5659cb352afd9c8cdcb 100644 (file)
@@ -423,7 +423,7 @@ struct OptMuxtreePass : public Pass {
                extra_args(args, 1, design);
 
                int total_count = 0;
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (!design->selected_whole_module(mod_it.first)) {
                                if (design->selected(mod_it.second))
                                        log("Skipping module %s as it is only partially selected.\n", id2cstr(mod_it.second->name));
index d7de723537fa3df69d415b2ff8651c5df3547344..b2b7cc8b99834558288ffbdc2b3dd459061b6503 100644 (file)
@@ -367,7 +367,7 @@ struct OptReducePass : public Pass {
                extra_args(args, argidx, design);
 
                int total_count = 0;
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (!design->selected(mod_it.second))
                                continue;
                        OptReduceWorker worker(design, mod_it.second, do_fine);
index 14b734d7d8f9ddc04a0a655b96a677dbd4d95ca0..b01778b5efe3ff6cbcf317d4540479524df85199 100644 (file)
@@ -166,7 +166,7 @@ struct OptRmdffPass : public Pass {
 
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        if (!design->selected(mod_it.second))
                                continue;
index 304ba9f83b481da8c6adbc58470f048efcbd6daa..45130229f86190c3d0fd670a7267a74695a1c050 100644 (file)
@@ -315,7 +315,7 @@ struct OptSharePass : public Pass {
                extra_args(args, argidx, design);
 
                int total_count = 0;
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (!design->selected(mod_it.second))
                                continue;
                        OptShareWorker worker(design, mod_it.second, mode_nomux);
index 63d04d35176d1f6f3c609effe2a450bbca304a51..e8439477050369a1457e8b87eb38fba17082b415 100644 (file)
@@ -236,7 +236,7 @@ struct ProcArstPass : public Pass {
 
                extra_args(args, argidx, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second)) {
                                SigMap assign_map(mod_it.second);
                                for (auto &proc_it : mod_it.second->processes) {
index 682515c5e64258ac71a3edb6136ed676c0a1a99b..678d620be69ef108621b4e52cd4d8e335bb1230b 100644 (file)
@@ -149,7 +149,7 @@ struct ProcCleanPass : public Pass {
 
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        std::vector<std::string> delme;
                        if (!design->selected(mod_it.second))
                                continue;
index cfd2eb7a7799aeb2eefd9630dc45d96ab48003c5..7bd909a681061a99094814eb069b84420ec38d17 100644 (file)
@@ -371,7 +371,7 @@ struct ProcDffPass : public Pass {
 
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second)) {
                                ConstEval ce(mod_it.second);
                                for (auto &proc_it : mod_it.second->processes)
index 5976c2162a12bf9f1d8d09be4bb9c18a51fd2e20..3607905f53247fef3e2f9e458b31c513f5a9d5a6 100644 (file)
@@ -101,7 +101,7 @@ struct ProcInitPass : public Pass {
 
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                for (auto &proc_it : mod_it.second->processes)
                                        if (design->selected(mod_it.second, proc_it.second))
index 67113a68267c1551cc125d331506dfb04985227f..bcbee6cfcb89e5bd9f5fe5c025d87d669fb97984 100644 (file)
@@ -276,7 +276,7 @@ struct ProcMuxPass : public Pass {
 
                extra_args(args, 1, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                for (auto &proc_it : mod_it.second->processes)
                                        if (design->selected(mod_it.second, proc_it.second))
index d5fbef0d217318e583f0ce474a8b5269aa5adccc..e7e4bbc546d23b8c233abd8f83ea4ea17495e5b2 100644 (file)
@@ -79,7 +79,7 @@ struct ProcRmdeadPass : public Pass {
                extra_args(args, 1, design);
 
                int total_counter = 0;
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (!design->selected(mod_it.second))
                                continue;
                        for (auto &proc_it : mod_it.second->processes) {
index 454233267adcc3e3ebb76bb63d1eabac285171d2..8a2dd929b3f7d7a1e7e18d9020b1ffda68d67f08 100644 (file)
@@ -306,10 +306,10 @@ struct VlogHammerReporter
        {
                for (auto name : split(module_list, ",")) {
                        RTLIL::IdString esc_name = RTLIL::escape_id(module_prefix + name);
-                       if (design->modules.count(esc_name) == 0)
+                       if (design->modules_.count(esc_name) == 0)
                                log_error("Can't find module %s in current design!\n", name.c_str());
                        log("Using module %s (%s).\n", esc_name.c_str(), name.c_str());
-                       modules.push_back(design->modules.at(esc_name));
+                       modules.push_back(design->modules_.at(esc_name));
                        module_names.push_back(name);
                }
 
@@ -416,11 +416,11 @@ struct EvalPass : public Pass {
                                /* this should only be used for regression testing of ConstEval -- see vloghammer */
                                std::string mod1_name = RTLIL::escape_id(args[++argidx]);
                                std::string mod2_name = RTLIL::escape_id(args[++argidx]);
-                               if (design->modules.count(mod1_name) == 0)
+                               if (design->modules_.count(mod1_name) == 0)
                                        log_error("Can't find module `%s'!\n", mod1_name.c_str());
-                               if (design->modules.count(mod2_name) == 0)
+                               if (design->modules_.count(mod2_name) == 0)
                                        log_error("Can't find module `%s'!\n", mod2_name.c_str());
-                               BruteForceEquivChecker checker(design->modules.at(mod1_name), design->modules.at(mod2_name), args[argidx-2] == "-brute_force_equiv_checker_x");
+                               BruteForceEquivChecker checker(design->modules_.at(mod1_name), design->modules_.at(mod2_name), args[argidx-2] == "-brute_force_equiv_checker_x");
                                if (checker.errors > 0)
                                        log_cmd_error("Modules are not equivialent!\n");
                                log("Verified %s = %s (using brute-force check on %d cases).\n",
@@ -442,7 +442,7 @@ struct EvalPass : public Pass {
                extra_args(args, argidx, design);
 
                RTLIL::Module *module = NULL;
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second)) {
                                if (module)
                                        log_cmd_error("Only one module must be selected for the EVAL pass! (selected: %s and %s)\n",
index 24b812bb2782310612b1e2549e69bc737a495381..f2b89b000a38fe0def74e10e19c7e40e757c42f6 100644 (file)
@@ -50,7 +50,7 @@ static bool consider_cell(RTLIL::Design *design, std::set<std::string> &dff_cell
 {
        if (cell->name[0] == '$' || dff_cells.count(cell->name))
                return false;
-       if (cell->type.at(0) == '\\' && !design->modules.count(cell->type))
+       if (cell->type.at(0) == '\\' && !design->modules_.count(cell->type))
                return false;
        return true;
 }
@@ -302,7 +302,7 @@ struct ExposePass : public Pass {
                        RTLIL::Module *first_module = NULL;
                        std::set<std::string> shared_dff_wires;
 
-                       for (auto &mod_it : design->modules)
+                       for (auto &mod_it : design->modules_)
                        {
                                if (!design->selected(mod_it.second))
                                        continue;
@@ -352,7 +352,7 @@ struct ExposePass : public Pass {
                {
                        RTLIL::Module *first_module = NULL;
 
-                       for (auto &mod_it : design->modules)
+                       for (auto &mod_it : design->modules_)
                        {
                                RTLIL::Module *module = mod_it.second;
 
@@ -434,7 +434,7 @@ struct ExposePass : public Pass {
                        }
                }
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                {
                        RTLIL::Module *module = mod_it.second;
 
@@ -583,9 +583,9 @@ struct ExposePass : public Pass {
 
                                        RTLIL::Cell *cell = it.second;
 
-                                       if (design->modules.count(cell->type))
+                                       if (design->modules_.count(cell->type))
                                        {
-                                               RTLIL::Module *mod = design->modules.at(cell->type);
+                                               RTLIL::Module *mod = design->modules_.at(cell->type);
 
                                                for (auto &it : mod->wires_)
                                                {
index f8d5cf6c43dba9e1fc74e0849847159c82e91f2e..ad304c723c53ed430fee084114512b5cd409166b 100644 (file)
@@ -817,7 +817,7 @@ struct FreducePass : public Pass {
                extra_args(args, argidx, design);
 
                int bitcount = 0;
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        RTLIL::Module *module = mod_it.second;
                        if (design->selected(module))
                                bitcount += FreduceWorker(design, module).run();
index 248f934c50fbd0719afb0b8bb681694ecb626d12..0f00e71a6187cf11bd14a2452de3edad3f1fca47 100644 (file)
@@ -63,15 +63,15 @@ static void create_miter_equiv(struct Pass *that, std::vector<std::string> args,
        std::string gate_name = RTLIL::escape_id(args[argidx++]);
        std::string miter_name = RTLIL::escape_id(args[argidx++]);
 
-       if (design->modules.count(gold_name) == 0)
+       if (design->modules_.count(gold_name) == 0)
                log_cmd_error("Can't find gold module %s!\n", gold_name.c_str());
-       if (design->modules.count(gate_name) == 0)
+       if (design->modules_.count(gate_name) == 0)
                log_cmd_error("Can't find gate module %s!\n", gate_name.c_str());
-       if (design->modules.count(miter_name) != 0)
+       if (design->modules_.count(miter_name) != 0)
                log_cmd_error("There is already a module %s!\n", gate_name.c_str());
 
-       RTLIL::Module *gold_module = design->modules.at(gold_name);
-       RTLIL::Module *gate_module = design->modules.at(gate_name);
+       RTLIL::Module *gold_module = design->modules_.at(gold_name);
+       RTLIL::Module *gate_module = design->modules_.at(gate_name);
 
        for (auto &it : gold_module->wires_) {
                RTLIL::Wire *w1 = it.second, *w2;
@@ -113,7 +113,7 @@ static void create_miter_equiv(struct Pass *that, std::vector<std::string> args,
 
        RTLIL::Module *miter_module = new RTLIL::Module;
        miter_module->name = miter_name;
-       design->modules[miter_name] = miter_module;
+       design->modules_[miter_name] = miter_module;
 
        RTLIL::Cell *gold_cell = miter_module->addCell("\\gold", gold_name);
        RTLIL::Cell *gate_cell = miter_module->addCell("\\gate", gate_name);
index 3e1c722243a44ec6a08bf60e7e6b6c43834ec113..dce312065ef6bf788d451117049eb6a67d332dfe 100644 (file)
@@ -1141,7 +1141,7 @@ struct SatPass : public Pass {
                extra_args(args, argidx, design);
 
                RTLIL::Module *module = NULL;
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second)) {
                                if (module)
                                        log_cmd_error("Only one module must be selected for the SAT pass! (selected: %s and %s)\n",
index facacf1960ba5a2f044ffa1e943637748c5f2907..671a631ddd3dcce4735a4f1e3e3b8011a1699d3d 100644 (file)
@@ -961,7 +961,7 @@ struct SharePass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &mod_it : design->modules)
+               for (auto &mod_it : design->modules_)
                        if (design->selected(mod_it.second))
                                ShareWorker(config, design, mod_it.second);
        }
index 01284656d03fed1d196fa3bcd8ec0ddce684b993..ffe241182bc46da942527ddd09b228d7b0d8955d 100644 (file)
@@ -524,7 +524,7 @@ struct DfflibmapPass : public Pass {
                log("  final dff cell mappings:\n");
                logmap_all();
 
-               for (auto &it : design->modules)
+               for (auto &it : design->modules_)
                        if (design->selected(it.second) && !it.second->get_bool_attribute("\\blackbox"))
                                dfflibmap(design, it.second);
 
index b66a11b8555f6f034279cf8c461f2222835ed004..8587f53b000899d7b95eb0cf64396a3f709ae268 100644 (file)
@@ -604,9 +604,9 @@ struct ExtractPass : public Pass {
                                                delete map;
                                                log_cmd_error("Can't saved design `%s'.\n", filename.c_str()+1);
                                        }
-                                       for (auto &it : saved_designs.at(filename.substr(1))->modules)
-                                               if (!map->modules.count(it.first))
-                                                       map->modules[it.first] = it.second->clone();
+                                       for (auto &it : saved_designs.at(filename.substr(1))->modules_)
+                                               if (!map->modules_.count(it.first))
+                                                       map->modules_[it.first] = it.second->clone();
                                }
                                else
                                {
@@ -632,7 +632,7 @@ struct ExtractPass : public Pass {
                log_header("Creating graphs for SubCircuit library.\n");
 
                if (!mine_mode)
-                       for (auto &mod_it : map->modules) {
+                       for (auto &mod_it : map->modules_) {
                                SubCircuit::Graph mod_graph;
                                std::string graph_name = "needle_" + RTLIL::unescape_id(mod_it.first);
                                log("Creating needle graph %s.\n", graph_name.c_str());
@@ -643,7 +643,7 @@ struct ExtractPass : public Pass {
                                }
                        }
 
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        SubCircuit::Graph mod_graph;
                        std::string graph_name = "haystack_" + RTLIL::unescape_id(mod_it.first);
                        log("Creating haystack graph %s.\n", graph_name.c_str());
@@ -725,7 +725,7 @@ struct ExtractPass : public Pass {
 
                                RTLIL::Module *newMod = new RTLIL::Module;
                                newMod->name = stringf("\\needle%05d_%s_%dx", needleCounter++, id2cstr(haystack_map.at(result.graphId)->name), result.totalMatchesAfterLimits);
-                               map->modules[newMod->name] = newMod;
+                               map->modules_[newMod->name] = newMod;
 
                                int portCounter = 1;
                                for (auto wire : wires) {
index 3097778760ec9054d60b8da5cdf43593cd76b4b6..a3261dccd0796c63fb26a5ac59d0f356044ae00d 100644 (file)
@@ -104,7 +104,7 @@ struct HilomapPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &it : design->modules)
+               for (auto &it : design->modules_)
                {
                        module = it.second;
 
index 6f7427f034bad8ee6c2f01422cfb6417b77312e1..10627cd12d11cf9d6bfc018bfa76f302bb628b54 100644 (file)
@@ -111,7 +111,7 @@ struct IopadmapPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &it : design->modules)
+               for (auto &it : design->modules_)
                {
                        RTLIL::Module *module = it.second;
 
index 8c7f64230063a83066e006fca4cb1d28526faf64..6def10081c4d7bfdb70f8e34276d339010123ee4 100644 (file)
@@ -435,7 +435,7 @@ struct SimplemapPass : public Pass {
                std::map<std::string, void(*)(RTLIL::Module*, RTLIL::Cell*)> mappers;
                simplemap_get_mappers(mappers);
 
-               for (auto &mod_it : design->modules) {
+               for (auto &mod_it : design->modules_) {
                        if (!design->selected(mod_it.second))
                                continue;
                        std::vector<RTLIL::Cell*> delete_cells;
index 86d9e73ae3c2e954d449f52b0d1fe1a69f4f777d..32e18e08bb51e8ba788be8a1acd73d4238ba0981 100644 (file)
@@ -243,7 +243,7 @@ struct TechmapWorker
                        for (auto &tpl_name : celltypeMap.at(cell->type))
                        {
                                std::string derived_name = tpl_name;
-                               RTLIL::Module *tpl = map->modules[tpl_name];
+                               RTLIL::Module *tpl = map->modules_[tpl_name];
                                std::map<RTLIL::IdString, RTLIL::Const> parameters = cell->parameters;
 
                                if (tpl->get_bool_attribute("\\blackbox"))
@@ -334,7 +334,7 @@ struct TechmapWorker
                                } else {
                                        if (cell->parameters.size() != 0) {
                                                derived_name = tpl->derive(map, parameters);
-                                               tpl = map->modules[derived_name];
+                                               tpl = map->modules_[derived_name];
                                                log_continue = true;
                                        }
                                        techmap_cache[key] = tpl;
@@ -592,15 +592,15 @@ struct TechmapPass : public Pass {
                        }
 
                std::map<RTLIL::IdString, RTLIL::Module*> modules_new;
-               for (auto &it : map->modules) {
+               for (auto &it : map->modules_) {
                        if (it.first.substr(0, 2) == "\\$")
                                it.second->name = it.first.substr(1);
                        modules_new[it.second->name] = it.second;
                }
-               map->modules.swap(modules_new);
+               map->modules_.swap(modules_new);
 
                std::map<RTLIL::IdString, std::set<RTLIL::IdString>> celltypeMap;
-               for (auto &it : map->modules) {
+               for (auto &it : map->modules_) {
                        if (it.second->attributes.count("\\techmap_celltype") && !it.second->attributes.at("\\techmap_celltype").bits.empty()) {
                                char *p = strdup(it.second->attributes.at("\\techmap_celltype").decode_string().c_str());
                                for (char *q = strtok(p, " \t\r\n"); q; q = strtok(NULL, " \t\r\n"))
@@ -614,7 +614,7 @@ struct TechmapPass : public Pass {
                std::set<RTLIL::Cell*> handled_cells;
                while (did_something) {
                        did_something = false;
-                       for (auto &mod_it : design->modules)
+                       for (auto &mod_it : design->modules_)
                                if (worker.techmap_module(design, mod_it.second, map, handled_cells, celltypeMap, false))
                                        did_something = true;
                        if (did_something)
@@ -653,12 +653,12 @@ struct FlattenPass : public Pass {
                TechmapWorker worker;
 
                std::map<RTLIL::IdString, std::set<RTLIL::IdString>> celltypeMap;
-               for (auto &it : design->modules)
+               for (auto &it : design->modules_)
                        celltypeMap[it.first].insert(it.first);
 
                RTLIL::Module *top_mod = NULL;
                if (design->full_selection())
-                       for (auto &mod_it : design->modules)
+                       for (auto &mod_it : design->modules_)
                                if (mod_it.second->get_bool_attribute("\\top"))
                                        top_mod = mod_it.second;
 
@@ -670,7 +670,7 @@ struct FlattenPass : public Pass {
                                if (worker.techmap_module(design, top_mod, design, handled_cells, celltypeMap, true))
                                        did_something = true;
                        } else {
-                               for (auto &mod_it : design->modules)
+                               for (auto &mod_it : design->modules_)
                                        if (worker.techmap_module(design, mod_it.second, design, handled_cells, celltypeMap, true))
                                                did_something = true;
                        }
@@ -680,14 +680,14 @@ struct FlattenPass : public Pass {
 
                if (top_mod != NULL) {
                        std::map<RTLIL::IdString, RTLIL::Module*> new_modules;
-                       for (auto &mod_it : design->modules)
+                       for (auto &mod_it : design->modules_)
                                if (mod_it.second == top_mod || mod_it.second->get_bool_attribute("\\blackbox")) {
                                        new_modules[mod_it.first] = mod_it.second;
                                } else {
                                        log("Deleting now unused module %s.\n", RTLIL::id2cstr(mod_it.first));
                                        delete mod_it.second;
                                }
-                       design->modules.swap(new_modules);
+                       design->modules_.swap(new_modules);
                }
 
                log_pop();