Fixing t_constraint_array_limit test

This commit is contained in:
Rahul Behl 2026-02-13 14:03:43 +05:30
parent fec88978f3
commit dbc9062dcd
3 changed files with 10 additions and 10 deletions

View File

@ -1,6 +0,0 @@
%Warning-CONSTRAINTIGN: t/t_constraint_array_limit.v:15:12: Constraint array reduction ignored (array size 100 exceeds --constraint-array-limit of 64), treating as state
15 | data.sum() with (item) < 1000;
| ^~~
... For warning description see https://verilator.org/warn/CONSTRAINTIGN?v=latest
... Use "/* verilator lint_off CONSTRAINTIGN */" and lint_on around source to disable this message.
%Error: Exiting due to

View File

@ -9,8 +9,14 @@
import vltest_bootstrap
test.scenarios('linter')
test.scenarios('simulator')
test.lint(fails=test.vlt_all, expect_filename=test.golden_filename)
if not test.have_solver:
test.skip("No constraint solver installed")
test.compile(
fails=True,
verilator_flags2=["--constraint-array-limit", "16"],
expect=r'%Warning-CONSTRAINTIGN:.*exceeds --constraint-array-limit')
test.passes()

View File

@ -9,10 +9,10 @@
`define checkd(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got=%0d exp=%0d\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0);
class Packet;
rand int data[100]; // Array size 100 > default limit of 64
rand int data[32];
constraint c {
data.sum() with (item) < 1000; // This should be ignored due to array size
data.sum() with (item) < 1000;
}
function void verify();