From: Eddie Hung Date: Thu, 16 Apr 2020 19:46:07 +0000 (-0700) Subject: design: -import to not count black/white-boxes as candidates for top X-Git-Tag: working-ls180~600^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dac5adde12c585f5e0552f776ae0a5ab05e995c9;p=yosys.git design: -import to not count black/white-boxes as candidates for top --- diff --git a/passes/cmds/design.cc b/passes/cmds/design.cc index cfe97067d..421defe0c 100644 --- a/passes/cmds/design.cc +++ b/passes/cmds/design.cc @@ -228,14 +228,20 @@ struct DesignPass : public Pass { } if (import_mode) { + std::vector candidates; for (auto module : copy_src_modules) { if (module->get_bool_attribute(ID::top)) { - copy_src_modules.clear(); - copy_src_modules.push_back(module); + candidates.clear(); + candidates.push_back(module); break; } + if (!module->get_blackbox_attribute()) + candidates.push_back(module); } + + if (GetSize(candidates) == 1) + copy_src_modules = std::move(candidates); } }