mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 10:33:13 +02:00
Internals: Move wrapTop before V3Coverage (#8291)
This commit is contained in:
+7
-1
@@ -400,7 +400,10 @@ class DeadVisitor final : public VNVisitor {
|
||||
AstNodeModule* nextmodp;
|
||||
for (AstNodeModule* modp = v3Global.rootp()->modulesp(); modp; modp = nextmodp) {
|
||||
nextmodp = VN_AS(modp->nextp(), NodeModule);
|
||||
if (modp->dead() || (!modp->isTop() && modp->user1() == 0 && !modp->internal())) {
|
||||
// Keep $unit until m_elimCells stages. Note v3Global.opt.serializeOnly()
|
||||
// won't reach this stage, and will always have an empty $unit. That's ok.
|
||||
const bool keep = !m_elimCells && modp == v3Global.rootp()->dollarUnitPkgp();
|
||||
if (modp->dead() || (!modp->isTop() && modp->user1() == 0 && !keep)) {
|
||||
// > 2 because L1 is the wrapper, L2 is the top user module
|
||||
UINFO(4, " Dead module " << modp);
|
||||
// And its children may now be killable too; correct counts
|
||||
@@ -410,6 +413,9 @@ class DeadVisitor final : public VNVisitor {
|
||||
cellp->modp()->user1Inc(-1);
|
||||
});
|
||||
}
|
||||
if (modp == v3Global.rootp()->dollarUnitPkgp()) {
|
||||
v3Global.rootp()->dollarUnitPkgp(nullptr);
|
||||
}
|
||||
deleting(modp);
|
||||
retry = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user