Commit Graph

9574 Commits

Author SHA1 Message Date
Matthew Ballance d0d919c66c Correct accidentally-removed visit method (and debug output)
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:58 +00:00
Matthew Ballance 97d4920182 Show all cross bins
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:58 +00:00
github action 4f270c3e41 Apply 'make format' 2026-04-18 00:44:58 +00:00
Matthew Ballance 271ddc8044 Close code coverage gaps
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance be7a947899 More code-coverage updates
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance f8dbafc1f3 Code coverage improvements
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
github action 4ca3ff5ad3 Apply 'make format' 2026-04-18 00:44:57 +00:00
Matthew Ballance 10afed99aa Fix golden files after adding SPDX copyright line to .v files
Adding the SPDX-FileCopyrightText line to t_covergroup_auto_bin_max_bad.v
and t_covergroup_cross_opt_unsup.v shifted all line numbers by 1.
Update the corresponding .out golden files to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 49b4b3aac6 Fix missing SPDX-FileCopyrightText in covergroup test files
Add missing SPDX-FileCopyrightText headers to four test files that
were created without them, causing t_dist_copyright to fail.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 07e3337f80 covergroup: Close coverage gaps per patch_coverage_plan
- V3AstAttr.h: Add LCOV_EXCL_START/STOP and LCOV_EXCL_LINE to the
  unreachable methods of VCoverBinsType, VCoverOptionType, VTransRepType
  enum wrappers (default ctors, int ctors, operator en(), and the
  first/third operator== overloads that are never called by production code)

- V3AstNodes.cpp: Add LCOV_EXCL_BR_LINE to AstCoverTransItem::dump() and
  dumpJson() branches that check m_repType != VTransRepType::NONE; these are
  unreachable because all repetition bin forms ([*], [->], [=]) produce
  nullptr via BBCOVERIGN and the node is never constructed with non-NONE type

- V3Covergroup.cpp: Fix optp->prettyName() -> optp->optionType().ascii() in
  extractCoverpointOptions() error message so the option name is printed
  correctly instead of an empty string; the non-constant option-value error
  path (lines 199-202) is unreachable in practice — the SV spec requires
  option values to be constant expressions and V3Width enforces this before
  covergroup lowering

- V3LinkParse.cpp: Mark the else branch in visit(AstCoverCross*) with
  LCOV_EXCL_START/STOP; it is unreachable because all non-option items in
  cross_body_item produce nullptr via BBCOVERIGN and addNextNull filters nulls

- t_covergroup_unsup.v: Add ignore_bins/illegal_bins with [] array form to
  exercise the corresponding grammar branches separately from bins []

- t_covergroup_args.v: Add cg_clocked(int) covergroup (clocked + constructor
  args) to exercise the loop-past-sentinel branch in createCovergroupMethods
  (line 1137); add cg_toplevel at file scope to exercise the m_modp==null
  branch (line 1269 false branch) in visit(AstCovergroup*)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 084eee0761 Fix CI regressions post-rebase: test coverage and crash fixes
- V3Covergroup.cpp: fix crash when coverpoint option value is non-const
  (VN_AS → VN_CAST with graceful error emission)
- V3Width.cpp: remove non-ASCII em-dash in comment (whitespace check)
- t_covergroup_cross_opt_unsup: new test for COVERIGN on cross options
- t_covergroup_auto_bin_max_bad: new test for non-const auto_bin_max error
- t_vlcov_covergroup: add --Wno-COVERIGN flag; update golden files for
  new covergroups added to t_covergroup_cross.v

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance ee87094c35 More coverage-closure test updates
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance aa912537f3 Coverage fixes
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 77e2c0b4e2 Remove dead guards
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance feb11da024 Fix CI regressions from covergroup changes
V3DfgOptimizer: Remove SenItem special case added in commit 20970c7dd.
By the time the scoped DFG pass runs (pipeline line 439), V3Active has
already deleted all AstCovergroup nodes (line 423). The SenItem block was
therefore unnecessary — and harmful, as it set HasExtRdRefs on ALL clock
signals in sensitivity lists, preventing clock-gate deduplication.
Fixes t_opt_dedupe_clk_gate (got 4 deduped instead of expected 2).

V3Width: Restore constifyEdit guard in visit(AstInsideRange*) with null
checks. The guard was needed so that negative literals (e.g. AstNegate
wrapping a Const) in covergroup bin ranges are folded to constants before
V3Width visits them as expressions. Without it, V3Width sees a bare NEGATE
under INSIDERANGE with m_vup==nullptr and fires v3fatalSrc.
Fixes t_covergroup_negative_ranges.

Root-cause note: t_debug_width was failing due to the SenItem DFG change
above, not the constifyEdit. t_opt_const.v (used by t_debug_width) has no
inside-range expressions, so constifyEdit was never triggered for that test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance e578838c75 Increase dump coverage
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 64f6ab5069 Fix whitespace issues
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
github action 3ae3f52e2d Apply 'make format' 2026-04-18 00:44:57 +00:00
Matthew Ballance 7b0c443f65 Improve code coverage and add coverage report production to more tests
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 3088782e28 Checkpoint on closing coverage holes
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance ae4fb13879 Combine/minimize cross and transition tests
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance fe9d9846d6 Update t_vlcov_covergroup to produce its own data instead of relying on a cached file
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 8dd992efdb Adjust code patterns based on PR feedback
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
github action 4a16d39d72 Apply 'make format' 2026-04-18 00:44:57 +00:00
Matthew Ballance 3334d91e49 Fix t_debug_emitv golden file: update while-loop emit after upstream unroll change
Upstream commit 7607f0e7f changed how while loops over queue.size() are
emitted, adding an __Vrepeat0 temporary variable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 9601b74dab Fix golden file: update BASICDTYPE 'logic' to 'bit' after upstream four-state cleanup
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance e0aa381384 Added verilator_coverage test for covergroups
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
github action f07d4601f7 Apply 'make format' 2026-04-18 00:44:57 +00:00
Matthew Ballance c96c8cd4cc Fix warnings
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 957a238605 Move AST building from parser proper to LinkParse ; simplify Coverpoint construction
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 731d7d3152 Clean up unneeded dump()
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 810666f936 Refactor visitor structure to successively collect state vs having multiple flag-controlled passes
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 663b9845a2 Correct use of deleteTree
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 8a4b25d800 const-ify variables
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 8e2977b969 Add coverage report output for covergroup
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
github action bf0f8d6035 Apply 'make format' 2026-04-18 00:44:57 +00:00
Matthew Ballance 5ad6b62615 Update unsupported and clean up warnings
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 52e7874134 Update format of unsupported messages for consistency
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 8709d79092 Removed redundant local teml
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
github action 0fd0791c7c Apply 'make format' 2026-04-18 00:44:57 +00:00
Matthew Ballance e35916e95e Format fixes
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
github action 10881c40bc Apply 'make format' 2026-04-18 00:44:57 +00:00
Matthew Ballance 440d990634 Cleanup mis-merge ; move initial Ast manipulation out of Grammar
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 682556cd05 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-18 00:44:57 +00:00
Matthew Ballance ac06e1f8be Clean up comments
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
github action 6df855cb91 Apply 'make format' 2026-04-18 00:44:57 +00:00
Matthew Ballance 1e16c8bcdd Aligned with C++14 and fixed a couple non-ascii characters
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 5633bb488d cleanup
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance c659fe900a Refactor loops in V3Active ; add three tests to vlt_all, so they run with threading
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-18 00:44:57 +00:00
Matthew Ballance 48e3b7888a 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-18 00:44:57 +00:00