Commit Graph

9503 Commits

Author SHA1 Message Date
github action 71bc885db5 Apply 'make format' 2026-04-05 21:10:49 +00:00
Matthew Ballance e710f1b6b3 Improve code coverage and add coverage report production to more tests
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
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 d5f8790d1c Combine/minimize cross and transition tests
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance 8b40d7a407 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-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 07db7608b1 Apply 'make format' 2026-04-05 21:10:49 +00:00
Matthew Ballance 7e87abb4fd 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-05 21:10:49 +00:00
Matthew Ballance 5b3f5e3f75 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-05 21:10:49 +00:00
Matthew Ballance 9f4ba736ef Added verilator_coverage test for covergroups
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 6634a399e6 Fix warnings
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance 45de7acffd Move AST building from parser proper to LinkParse ; simplify Coverpoint construction
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance fd6311a74b Clean up unneeded dump()
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance df03614a24 Refactor visitor structure to successively collect state vs having multiple flag-controlled passes
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
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
github action 73332329be Apply 'make format' 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 cbf6c64d05 Update format of unsupported messages for consistency
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
Matthew Ballance 9e70f0a2ae Removed redundant local teml
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
github action a6acde41a8 Apply 'make format' 2026-04-05 21:10:49 +00:00
Matthew Ballance 65ee9cd865 Format fixes
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:49 +00:00
github action 601e05615d Apply 'make format' 2026-04-05 21:10:49 +00:00
Matthew Ballance 8eb03568fd Cleanup mis-merge ; move initial Ast manipulation out of Grammar
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:48 +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
Matthew Ballance fe26b9212e Clean up comments
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 a30e729852 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-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 4c4d3e91bc Add missing SPDX-FileCopyrightText headers to covergroup test files
All new covergroup test files were missing the canonical
SPDX-FileCopyrightText line required by t_dist_copyright.
Add it above the existing SPDX-License-Identifier line in each file.
Also canonicalize t_covergroup_with_sample_args_too_many_bad.py to
use SPDX form instead of prose copyright comment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:48 +00:00
Matthew Ballance ae10856ec0 Update golden files after rebase onto upstream/master
Upstream commit 07ed6aef5 'Tests: Verilog format' reformatted several
Verilog test files, shifting line/column numbers in compiler output.
Also pick up upstream's improved 'Too many arguments' error message
which now includes the declaration location.

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
Matthew Ballance a18fdb1c4b Restore t_covergroup_with_sample_args_too_many_bad test
This test was added upstream in a364704e3 and should not have been
deleted. The driver normalizes version strings (?v=X.Y -> ?v=latest)
and 'Exiting due to...' messages, so the upstream .out file is
compatible with our branch's error output as-is.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:48 +00:00
Matthew Ballance 4eb676cb49 Convert 'if' tests to assertion macros
Signed-off-by: Matthew Ballance <matt.ballance@gmail.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 bcf6e6ac72 Update debug_emitv to include covergroup constructs ; update emit of covergroup debug content
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:33 +00:00
Matthew Ballance 464be2c85b Test clean-ups, resolve an internal error masked by the checking strategy, and add 'automatic' to remove warnings
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:33 +00:00
Matthew Ballance affe776463 t_covergroup_with_sample_args_too_many_bad: remove redundant test
'sample' argument count checking is generic function/task behavior
already covered by t_func_bad and similar tests. Removing this test
eliminates fragility from upstream error message/caret changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:33 +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
Matthew Ballance a3a456779d Fix V3Fork lifetime assertion by restoring V3LinkInc temp var lifetime
Commit b4244fc57 accidentally dropped the varp->lifetime(VLifetime::AUTOMATIC_EXPLICIT)
line when reverting V3LinkInc.cpp to a merge base. This caused __Vincrement* temp
variables to have VLifetime::NONE, triggering V3Fork's assertion that all variables
inside fork...join_none blocks have a known lifetime.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:33 +00:00
github action 83eb65a6c3 Apply 'make format' 2026-04-05 21:10:33 +00:00
Matthew Ballance 80502fd9ee Correct indent on coverage tests ; add required test drivers ; back out CMakeLists pch change and adjust test that required it to no longer need it
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:33 +00:00
Matthew Ballance e347943e3b Whitespace fixes
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
2026-04-05 21:10:33 +00:00
Matthew Ballance ff9781fc73 Update golden file for covergroup fileline fix
The covergroup keyword fileline fix (using $<fl>1 instead of $<fl>2)
shifts error column from the name position to the 'covergroup' keyword.
Update the golden output for t_covergroup_in_class_duplicate_bad to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 21:10:33 +00:00