Internals: Identify $unit package by netlist pointer

This commit is contained in:
Geza Lore
2026-09-26 07:48:56 +01:00
parent 435af6afe6
commit 33d63ac0b0
6 changed files with 8 additions and 10 deletions
+1 -2
View File
@@ -1220,8 +1220,7 @@ class LinkDotFindVisitor final : public VNVisitor {
AstNodeModule* const modulesp = nodep->modulesp();
UASSERT_OBJ(modulesp, nodep, "$unit should always be in the netlist");
if (!modulesp->nextp()) {
UASSERT_OBJ(modulesp == v3Global.rootp()->dollarUnitPkgp(), modulesp,
"Sole module should be $unit");
UASSERT_OBJ(modulesp->isDollarUnit(), modulesp, "Sole module should be $unit");
if (!modulesp->stmtsp()) nodep->v3error("No top level module found");
}
for (AstNodeModule* modp = nodep->modulesp(); modp && modp->isTop();