diff --git a/src/V3AssertPre.cpp b/src/V3AssertPre.cpp index c61299a66..54d6d90e0 100644 --- a/src/V3AssertPre.cpp +++ b/src/V3AssertPre.cpp @@ -91,7 +91,8 @@ private: fromAlways = true; } if (!senip) { - nodep->v3warn(E_UNSUPPORTED, "Unsupported: Unclocked assertion"); + nodep->v3error("Concurrent assertion has no clock; provide a clocking event, a default" + " clocking, or a clocked procedural context (IEEE 1800-2023 16.16)"); newp = new AstSenTree{nodep->fileline(), nullptr}; } else { if (cassertp && fromAlways) cassertp->senFromAlways(true); diff --git a/test_regress/t/t_assert_unclocked_bad.out b/test_regress/t/t_assert_unclocked_bad.out new file mode 100644 index 000000000..94068f445 --- /dev/null +++ b/test_regress/t/t_assert_unclocked_bad.out @@ -0,0 +1,18 @@ +%Error: t/t_assert_unclocked_bad.v:9:3: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' + 9 | assert property (a); + | ^~~~~~ + ... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance. +%Error: t/t_assert_unclocked_bad.v:10:22: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' + 10 | assert property (a |=> b); + | ^~~ +%Error: t/t_assert_unclocked_bad.v:10:3: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' + 10 | assert property (a |=> b); + | ^~~~~~ +%Error: t/t_assert_unclocked_bad.v:11:3: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' + 11 | cover property (a); + | ^~~~~ +%Error: Exiting due to diff --git a/test_regress/t/t_assert_unclocked_bad.py b/test_regress/t/t_assert_unclocked_bad.py new file mode 100755 index 000000000..77a0ac64b --- /dev/null +++ b/test_regress/t/t_assert_unclocked_bad.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# 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-FileCopyrightText: 2026 Wilson Snyder +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +import vltest_bootstrap + +test.scenarios('vlt') + +test.lint(expect_filename=test.golden_filename, fails=True) + +test.passes() diff --git a/test_regress/t/t_assert_unclocked_bad.v b/test_regress/t/t_assert_unclocked_bad.v new file mode 100644 index 000000000..ae659cf7b --- /dev/null +++ b/test_regress/t/t_assert_unclocked_bad.v @@ -0,0 +1,12 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed under the Creative Commons Public Domain. +// SPDX-FileCopyrightText: 2026 PlanV GmbH +// SPDX-License-Identifier: CC0-1.0 + +module t; + logic a, b; + assert property (a); + assert property (a |=> b); + cover property (a); +endmodule diff --git a/test_regress/t/t_property_pexpr_unsup.out b/test_regress/t/t_property_pexpr_unsup.out index bae43d802..3699cd414 100644 --- a/test_regress/t/t_property_pexpr_unsup.out +++ b/test_regress/t/t_property_pexpr_unsup.out @@ -1,26 +1,26 @@ -%Error-UNSUPPORTED: t/t_property_pexpr_unsup.v:115:21: Unsupported: Unclocked assertion - : ... note: In instance 't' +%Error: t/t_property_pexpr_unsup.v:115:21: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' 115 | assert property ((s_eventually a) implies (s_eventually a)); | ^~~~~~~~~~~~ - ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error-UNSUPPORTED: t/t_property_pexpr_unsup.v:115:46: Unsupported: Unclocked assertion - : ... note: In instance 't' + ... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance. +%Error: t/t_property_pexpr_unsup.v:115:46: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' 115 | assert property ((s_eventually a) implies (s_eventually a)); | ^~~~~~~~~~~~ -%Error-UNSUPPORTED: t/t_property_pexpr_unsup.v:115:3: Unsupported: Unclocked assertion - : ... note: In instance 't' +%Error: t/t_property_pexpr_unsup.v:115:3: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' 115 | assert property ((s_eventually a) implies (s_eventually a)); | ^~~~~~ -%Error-UNSUPPORTED: t/t_property_pexpr_unsup.v:117:21: Unsupported: Unclocked assertion - : ... note: In instance 't' +%Error: t/t_property_pexpr_unsup.v:117:21: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' 117 | assert property ((s_eventually a) iff (s_eventually a)); | ^~~~~~~~~~~~ -%Error-UNSUPPORTED: t/t_property_pexpr_unsup.v:117:42: Unsupported: Unclocked assertion - : ... note: In instance 't' +%Error: t/t_property_pexpr_unsup.v:117:42: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' 117 | assert property ((s_eventually a) iff (s_eventually a)); | ^~~~~~~~~~~~ -%Error-UNSUPPORTED: t/t_property_pexpr_unsup.v:117:3: Unsupported: Unclocked assertion - : ... note: In instance 't' +%Error: t/t_property_pexpr_unsup.v:117:3: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' 117 | assert property ((s_eventually a) iff (s_eventually a)); | ^~~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_property_s_eventually_unsup.out b/test_regress/t/t_property_s_eventually_unsup.out index 6a9be1c3a..54d181201 100644 --- a/test_regress/t/t_property_s_eventually_unsup.out +++ b/test_regress/t/t_property_s_eventually_unsup.out @@ -1,14 +1,15 @@ -%Error-UNSUPPORTED: t/t_property_s_eventually_unsup.v:14:20: Unsupported: Unclocked assertion - : ... note: In instance 't' +%Error: t/t_property_s_eventually_unsup.v:14:20: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' 14 | assert property (s_eventually ##1 1); | ^~~~~~~~~~~~ - ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error-UNSUPPORTED: t/t_property_s_eventually_unsup.v:14:3: Unsupported: Unclocked assertion - : ... note: In instance 't' + ... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance. +%Error: t/t_property_s_eventually_unsup.v:14:3: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 't' 14 | assert property (s_eventually ##1 1); | ^~~~~~ %Error-UNSUPPORTED: t/t_property_s_eventually_unsup.v:15:35: Unsupported: cycle delay in s_eventually : ... note: In instance 't' 15 | assert property (@(negedge clk) s_eventually ##1 1); | ^~~~~~~~~~~~ + ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest %Error: Exiting due to diff --git a/test_regress/t/t_sequence_first_match_unsup.out b/test_regress/t/t_sequence_first_match_unsup.out index e4e3a5d37..1a60f2a09 100644 --- a/test_regress/t/t_sequence_first_match_unsup.out +++ b/test_regress/t/t_sequence_first_match_unsup.out @@ -7,11 +7,10 @@ : ... note: In instance 'main' 51 | initial p0 : assert property ((##1 1) or(##2 1) |-> x == 1); | ^~ -%Error-UNSUPPORTED: t/t_sequence_first_match_unsup.v:51:16: Unsupported: Unclocked assertion - : ... note: In instance 'main' +%Error: t/t_sequence_first_match_unsup.v:51:16: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 'main' 51 | initial p0 : assert property ((##1 1) or(##2 1) |-> x == 1); | ^~~~~~ - ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest %Error: t/t_sequence_first_match_unsup.v:54:47: Usage of cycle delays requires default clocking (IEEE 1800-2023 14.11) : ... note: In instance 'main' 54 | initial p1 : assert property (first_match ((##1 1) or(##2 1)) |-> x == 1); @@ -20,24 +19,24 @@ : ... note: In instance 'main' 54 | initial p1 : assert property (first_match ((##1 1) or(##2 1)) |-> x == 1); | ^~ -%Error-UNSUPPORTED: t/t_sequence_first_match_unsup.v:54:16: Unsupported: Unclocked assertion - : ... note: In instance 'main' +%Error: t/t_sequence_first_match_unsup.v:54:16: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 'main' 54 | initial p1 : assert property (first_match ((##1 1) or(##2 1)) |-> x == 1); | ^~~~~~ %Error: t/t_sequence_first_match_unsup.v:57:38: Usage of cycle delays requires default clocking (IEEE 1800-2023 14.11) : ... note: In instance 'main' 57 | initial p2 : assert property (1 or ##1 1 |-> x == 0); | ^~ -%Error-UNSUPPORTED: t/t_sequence_first_match_unsup.v:57:16: Unsupported: Unclocked assertion - : ... note: In instance 'main' +%Error: t/t_sequence_first_match_unsup.v:57:16: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 'main' 57 | initial p2 : assert property (1 or ##1 1 |-> x == 0); | ^~~~~~ %Error: t/t_sequence_first_match_unsup.v:60:51: Usage of cycle delays requires default clocking (IEEE 1800-2023 14.11) : ... note: In instance 'main' 60 | initial p3 : assert property (first_match (1 or ##1 1) |-> x == 0); | ^~ -%Error-UNSUPPORTED: t/t_sequence_first_match_unsup.v:60:16: Unsupported: Unclocked assertion - : ... note: In instance 'main' +%Error: t/t_sequence_first_match_unsup.v:60:16: Concurrent assertion has no clock; provide a clocking event, a default clocking, or a clocked procedural context (IEEE 1800-2023 16.16) + : ... note: In instance 'main' 60 | initial p3 : assert property (first_match (1 or ##1 1) |-> x == 0); | ^~~~~~ %Error: Internal Error: t/t_sequence_first_match_unsup.v:51:34: ../V3Ast.cpp:#: AstSExpr must have non-nullptr delayp()