From: Clifford Wolf Date: Sun, 15 Feb 2015 11:57:41 +0000 (+0100) Subject: Cosmetic fixes in "hierarchy" for blackbox modules X-Git-Tag: yosys-0.6~431 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a54c994e2be340d3d036c160e5cd065a72fe5603;p=yosys.git Cosmetic fixes in "hierarchy" for blackbox modules --- diff --git a/passes/hierarchy/hierarchy.cc b/passes/hierarchy/hierarchy.cc index 58b796a62..8f2422bd0 100644 --- a/passes/hierarchy/hierarchy.cc +++ b/passes/hierarchy/hierarchy.cc @@ -268,7 +268,7 @@ void hierarchy_worker(RTLIL::Design *design, std::set &used, RTL if (indent == 0) log("Top module: %s\n", mod->name.c_str()); - else + else if (!mod->get_bool_attribute("\\blackbox")) log("Used module: %*s%s\n", indent, "", mod->name.c_str()); used.insert(mod); @@ -295,6 +295,7 @@ void hierarchy(RTLIL::Design *design, RTLIL::Module *top, bool purge_lib, bool f if (used.count(it.second) == 0) del_modules.push_back(it.second); + int del_counter = 0; for (auto mod : del_modules) { if (first_pass && mod->name.substr(0, 9) == "$abstract") continue; @@ -302,10 +303,11 @@ void hierarchy(RTLIL::Design *design, RTLIL::Module *top, bool purge_lib, bool f continue; log("Removing unused module `%s'.\n", mod->name.c_str()); design->modules_.erase(mod->name); + del_counter++; delete mod; } - log("Removed %d unused modules.\n", GetSize(del_modules)); + log("Removed %d unused modules.\n", del_counter); } bool set_keep_assert(std::map &cache, RTLIL::Module *mod)