diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 74a36a344..5a0e6113f 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -2760,7 +2760,7 @@ void import_all(const char* work, std::map *nl_todo, Map * #endif } -std::set import_tops(const char* work, std::map *nl_todo, Map *parameters, bool show_message, std::string ppfile YS_MAYBE_UNUSED, std::vector &tops) +std::set import_tops(const char* work, std::map *nl_todo, Map *parameters, bool show_message, std::string ppfile YS_MAYBE_UNUSED, std::vector &tops, std::string *top = nullptr) { std::set top_mod_names; Array *netlists = nullptr; @@ -2821,6 +2821,8 @@ std::set import_tops(const char* work, std::mapId()->OrigName()) != 0) { top_mod_names.erase(name); top_mod_names.insert(vhdl_unit->Id()->OrigName()); + if (top && *top == name) + *top = vhdl_unit->Id()->OrigName(); } continue; } @@ -2962,7 +2964,7 @@ std::string verific_import(Design *design, const std::map