mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 18:13:50 +02:00
Internals: Move wrapTop before V3Coverage (#8291)
This commit is contained in:
+16
-14
@@ -233,11 +233,22 @@ static void process() {
|
||||
v3Global.vlExit(0);
|
||||
}
|
||||
|
||||
// Insert generic non-FSM coverage before dead code elimination and
|
||||
// inlining, or those opportunities may be optimized away. FSM
|
||||
// coverage is handled later in V3FsmDetect, after scoping has created
|
||||
// the AST context needed to recover and lower FSMs reliably.
|
||||
if (v3Global.opt.coverageNonFsm()) V3Coverage::coverage(v3Global.rootp());
|
||||
if (!v3Global.opt.serializeOnly() || v3Global.opt.flatten()) {
|
||||
// Add top level wrapper with instance pointing to old top
|
||||
// Move packages to under new top
|
||||
// Must do this after we know parameters and dtypes (as don't clone dtype decls)
|
||||
V3LinkLevel::wrapTop(v3Global.rootp());
|
||||
} else {
|
||||
V3LinkLevel::nonWrapTop(v3Global.rootp());
|
||||
}
|
||||
|
||||
if (!v3Global.opt.serializeOnly()) {
|
||||
// Insert generic code coverage before dead code elimination and
|
||||
// inlining, or those opportunities may be optimized away. FSM
|
||||
// coverage is handled later in V3FsmDetect, after scoping has created
|
||||
// the AST context needed to recover and lower FSMs reliably.
|
||||
if (v3Global.opt.coverageNonFsm()) V3Coverage::coverage(v3Global.rootp());
|
||||
}
|
||||
|
||||
// Functional coverage code generation
|
||||
// Generate code for covergroups/coverpoints
|
||||
@@ -268,15 +279,6 @@ static void process() {
|
||||
//
|
||||
V3Assert::assertAll(v3Global.rootp());
|
||||
|
||||
if (!(v3Global.opt.serializeOnly() && !v3Global.opt.flatten())) {
|
||||
// Add top level wrapper with instance pointing to old top
|
||||
// Move packages to under new top
|
||||
// Must do this after we know parameters and dtypes (as don't clone dtype decls)
|
||||
V3LinkLevel::wrapTop(v3Global.rootp());
|
||||
} else {
|
||||
V3LinkLevel::nonWrapTop(v3Global.rootp());
|
||||
}
|
||||
|
||||
// Propagate constants into expressions
|
||||
if (v3Global.opt.fConstBeforeDfg()) V3Const::constifyAllLint(v3Global.rootp());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user