Fixed "stat" handling of blackbox modules
authorClifford Wolf <clifford@clifford.at>
Sat, 14 Feb 2015 21:36:34 +0000 (22:36 +0100)
committerClifford Wolf <clifford@clifford.at>
Sat, 14 Feb 2015 21:36:34 +0000 (22:36 +0100)
passes/cmds/stat.cc

index d68c57b20a94d017725b13773ad0e39ec401d2e9..bd3a43acab76718e3eacf1ddaec370616399b696 100644 (file)
@@ -208,20 +208,17 @@ struct StatPass : public Pass {
                }
                extra_args(args, argidx, design);
 
-               for (auto &it : design->modules_)
+               for (auto mod : design->selected_modules())
                {
-                       if (!design->selected_module(it.first))
-                               continue;
-
                        if (!top_mod && design->full_selection())
-                               if (it.second->get_bool_attribute("\\top"))
-                                       top_mod = it.second;
+                               if (mod->get_bool_attribute("\\top"))
+                                       top_mod = mod;
 
-                       statdata_t data(design, it.second, width_mode);
-                       mod_stat[it.first] = data;
+                       statdata_t data(design, mod, width_mode);
+                       mod_stat[mod->name] = data;
 
                        log("\n");
-                       log("=== %s%s ===\n", RTLIL::id2cstr(it.first), design->selected_whole_module(it.first) ? "" : " (partially selected)");
+                       log("=== %s%s ===\n", RTLIL::id2cstr(mod->name), design->selected_whole_module(mod->name) ? "" : " (partially selected)");
                        log("\n");
                        data.log_data();
                }