diff --git a/src/V3Coverage.cpp b/src/V3Coverage.cpp index afb674551a..aadd1a97d1 100644 --- a/src/V3Coverage.cpp +++ b/src/V3Coverage.cpp @@ -117,7 +117,7 @@ class CoverageVisitor final : public VNVisitor { AstCoverDecl* const declp = new AstCoverDecl{fl, page, comment, linescov, offset}; declp->hier(hier); - m_modp->addStmtsp(declp); + v3Global.rootp()->dollarUnitPkgAddp()->addStmtsp(declp); UINFO(9, "new " << declp << endl); AstCoverInc* const incp = new AstCoverInc{fl, declp};