Fix to select UDPs when they are the only candidate for a top module.

This commit is contained in:
Wilson Snyder
2025-08-23 15:20:58 -04:00
parent f45b811c22
commit b226be7f98
7 changed files with 88 additions and 1 deletions
+4 -1
View File
@@ -47,7 +47,10 @@ void V3LinkLevel::modSortByLevel() {
ModVec tops; // Top level modules
for (AstNodeModule* nodep = v3Global.rootp()->modulesp(); nodep;
nodep = VN_AS(nodep->nextp(), NodeModule)) {
if (nodep->level() <= 2 && !VN_IS(nodep, NotFoundModule)) tops.push_back(nodep);
if (nodep->level() <= 2 && !VN_IS(nodep, NotFoundModule)) {
UINFO(9, "top candidate " << nodep);
tops.push_back(nodep);
}
mods.push_back(nodep);
}
if (tops.size() >= 2) {