From a54c994e2be340d3d036c160e5cd065a72fe5603 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 15 Feb 2015 12:57:41 +0100 Subject: [PATCH] Cosmetic fixes in "hierarchy" for blackbox modules --- passes/hierarchy/hierarchy.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.30.2