From a18fdb1c4bd3eaaf66bd77d774c8169b075dafba Mon Sep 17 00:00:00 2001 From: Matthew Ballance Date: Sat, 7 Mar 2026 15:22:33 +0000 Subject: [PATCH] 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> --- ...covergroup_with_sample_args_too_many_bad.out | 6 ++++++ ..._covergroup_with_sample_args_too_many_bad.py | 16 ++++++++++++++++ ...t_covergroup_with_sample_args_too_many_bad.v | 17 +++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 test_regress/t/t_covergroup_with_sample_args_too_many_bad.out create mode 100755 test_regress/t/t_covergroup_with_sample_args_too_many_bad.py create mode 100644 test_regress/t/t_covergroup_with_sample_args_too_many_bad.v diff --git a/test_regress/t/t_covergroup_with_sample_args_too_many_bad.out b/test_regress/t/t_covergroup_with_sample_args_too_many_bad.out new file mode 100644 index 000000000..a8718cb93 --- /dev/null +++ b/test_regress/t/t_covergroup_with_sample_args_too_many_bad.out @@ -0,0 +1,6 @@ +%Error: t/t_covergroup_with_sample_args_too_many_bad.v:15:26: Too many arguments in function call to FUNC 'sample' + : ... note: In instance 't' + 15 | cov1.sample(5, 1'b0, 42); + | ^~ + ... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance. +%Error: Exiting due to diff --git a/test_regress/t/t_covergroup_with_sample_args_too_many_bad.py b/test_regress/t/t_covergroup_with_sample_args_too_many_bad.py new file mode 100755 index 000000000..dff5516bf --- /dev/null +++ b/test_regress/t/t_covergroup_with_sample_args_too_many_bad.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2025 by Wilson Snyder. This program is free software; you +# can redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +import vltest_bootstrap + +test.scenarios('simulator') + +test.compile(fails=True, expect_filename=test.golden_filename) + +test.passes() diff --git a/test_regress/t/t_covergroup_with_sample_args_too_many_bad.v b/test_regress/t/t_covergroup_with_sample_args_too_many_bad.v new file mode 100644 index 000000000..60ba2dc26 --- /dev/null +++ b/test_regress/t/t_covergroup_with_sample_args_too_many_bad.v @@ -0,0 +1,17 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed under the Creative Commons Public Domain, for +// any use, without warranty, 2025 by Antmicro. +// SPDX-License-Identifier: CC0-1.0 + +/* verilator lint_off COVERIGN */ +module t; + covergroup cg_with_sample(int init) with function sample (int addr, bit is_read = 1'b0); + endgroup + + cg_with_sample cov1 = new(7); + + function void run(); + cov1.sample(5, 1'b0, 42); // Too many arguments + endfunction +endmodule