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>
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>
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>
Introduce a new DfgAstRd vertex, which holds an AstNodeExpr that is a
reference to a variable. This enables tracking all read references in
Dfg, which both enables more optimization, and allows inlining of
expressions in place of the reference more intelligently (e.g, when the
expression is only used once, and is not in a loop). This can get rid of
20-30% of temporary variables introduced in Dfg in some designs. Note
V3Gate later got rid of a lot of those, this is a step towards making
V3Gate redundant. The more intelligent expression inlining is worth ~10%
runtime speed on some designs.