Commit Graph

23 Commits

Author SHA1 Message Date
Matthew Ballance f1389497c1 Checkpoint on closing coverage holes
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance ae7258f365 Adjust code patterns based on PR feedback
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
github action bf035d17f3 Apply 'make format' 2026-04-05 21:10:49 +00:00
Matthew Ballance 3ca51092cd Correct use of deleteTree
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance cb3d8ebb72 const-ify variables
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance 47d5f536bc Add coverage report output for covergroup
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance 2c371c88bd Update unsupported and clean up warnings
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance 94a65f8e64 Comment new Ast classes, clean up accidentally added members, clean up a few interim workarounds, and adjust approach to stay out of sensitive paths
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:48 +00:00
github action ebf553021b Apply 'make format' 2026-04-05 21:10:48 +00:00
Matthew Ballance ad89a6c8f4 Aligned with C++14 and fixed a couple non-ascii characters
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:48 +00:00
Matthew Ballance 777e6b0c29 cleanup
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:48 +00:00
Matthew Ballance 1ec09f9d2d Remove low-value tests ; Rename tests to better-align with their purpose ; Move to using coverage.dat to assess correctness
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:48 +00:00
Matthew Ballance e5594e9c6c Fix constifyParamsEdit regression in visit(AstInsideRange*)
The original code called V3Const::constifyParamsEdit() in
V3Width::visit(AstInsideRange*) to fold negative bin bounds
(e.g., NEGATE(100) -> -100) for covergroup bins. Since
constifyParamsEdit uses m_required=true, it errored on any
non-constant expression -- breaking the upstream test
t_constraint_array_index_simple which uses a foreach loop
variable 'i' in an inside constraint expression.

Fix: Remove the unconditional constifyParamsEdit calls from
V3Width::visit(AstInsideRange*). Instead:
- In V3Width: when m_vup is null (covergroup bin context,
  not an expression context), use constifyEdit (m_required=false)
  to fold constant arithmetic before iterating children.
- In V3Covergroup: call constifyEdit at the two sites that
  cast InsideRange bounds to AstConst for bin expansion.

This moves the covergroup-specific concern to the right layer
(V3Covergroup) while keeping V3Width safe for all contexts.

Also update golden files for t_covergroup_trans_3value,
t_covergroup_trans_restart, and t_covergroup_with_sample_args_too_many_bad
whose line numbers shifted by 1 due to the SPDX copyright header
additions in the previous commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:48 +00:00
Matthew Ballance b4ff2f7704 Fix non-ASCII characters in V3Covergroup.cpp comment
Replace Unicode em-dash and curly apostrophe with plain ASCII
equivalents to pass t_dist_whitespace CI check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:48 +00:00
github action 7475dea9f3 Apply 'make format' 2026-04-05 21:10:48 +00:00
Matthew Ballance 06d34cc4cf Cleaned up coverpoint-bin warning around 'excessive size'
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:48 +00:00
Matthew Ballance dda0405fce V3Covergroup: initialize bin counters to 0, not random
Coverage bin counters (__Vcov_* member variables) were being initialized
with VL_SCOPED_RAND_RESET_I because they are plain uint32 members with no
explicit initial value. This caused 0% coverage readings at runtime when
randReset != 0 (as used in CI).

Fix all 5 bin counter AstVar creation sites to set an explicit valuep of
AstConst(0), so V3EmitCFunc emits '= 0U' instead of VL_SCOPED_RAND_RESET_I.

Affects: regular bins, default bins, array bins, transition array bins,
and cross bins.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:33 +00:00
github action eba0dcdb37 Apply 'make format' 2026-04-05 21:10:33 +00:00
Matthew Ballance 3aef029184 V3Covergroup: fix coverpoint cleanup for unsupported covergroups
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>
2026-04-05 21:10:32 +00:00
Matthew Ballance 07f959d31d Refactoring node locations and enums ; Delete coverpoints after V3Covergroup so they don't accidentally hit the generators
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:32 +00:00
github action 30ca516362 Apply 'make format' 2026-04-05 21:10:32 +00:00
Matthew Ballance 17eaa5514b Adopt use of MemberMap
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:09:39 +00:00
Matthew Ballance c749ff09b4 Refactoring before renaming tests
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:09:39 +00:00