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>
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>
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>
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>
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>
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>
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>
'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>
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>
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>