Three node deletions were accidentally dropped from the initial covergroup
commit as collateral damage:
- wait_order (no-stmt variant): restore DEL($3) for vrdList
- expect (no-stmt variant): restore DEL($3) for property_spec
- property_exprCaseIf yIF/yELSE: restore DEL($3) for condition expr
In all three cases $3 is an AstNode* that is not assigned to $$ and would
be leaked without the deletion.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add v3Global.useCovergroup() flag (following the useRandSequence()
pattern) that is set to true when a covergroup_declaration is parsed.
Gate the V3Covergroup::covergroup() pass in Verilator.cpp on this flag
so the pass is skipped entirely for designs with no covergroups.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Two bugs fixed:
1. AstCReset: mark as ineligible for coverage expressions via
isExprCoverageEligible() override, preventing verilogForTree
from being called on CReset nodes (which has no V3EmitV handler).
2. generateCrossCode: when a cross references an unknown coverpoint,
don't delete the cross node early. The caller's cleanup loop
(in visit(AstClass*)) is responsible for deleting all coverpoints
and crosses. Early deletion left a dangling pointer in m_coverCrosses
causing a use-after-free segfault.
3. hasUnsupportedEvent path: added coverpoint/cross cleanup before
returning so AST nodes don't reach downstream passes (V3EmitCFunc,
V3MergeCond) which no longer have stub visitors for them.
All 60 covergroup tests now pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The VLifetime::AUTOMATIC_EXPLICIT addition is not required for
functional coverage — all 60 covergroup tests pass without it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These changes are not required for functional coverage support and
should not be included in the upstream patch.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Without this, CFG_CXXFLAGS_PCH_I was left empty in CMake builds, causing
GCC to treat the PCH filename as a linker input instead of applying it as
a -include flag, breaking compilation of any model that uses PCH.
This is a general CMake build fix (not funccov-specific); the same bug
exists in upstream CMakeLists.txt. It is included here because funccov's
cross-coverage tests expose the issue.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After conversion of Ast to Dfg, but before synthesizing AstAlways into
primitives, run a pass to remove variables that are not observable, and
all logic that only computes such variables. This can get rid of a lot
of content early so we don't build redundant Dfgs, and also enables
synthesizing always blocks that use temporaries only in some branches,
which will come in a follow up.