From e7abbeb4c54f49ae9a7283377d6e6184b9026c74 Mon Sep 17 00:00:00 2001 From: Krzysztof Boronski Date: Mon, 23 Oct 2023 16:02:55 +0200 Subject: [PATCH] Remove EVENTEXPR and EVENTMT warnings Signed-off-by: Krzysztof Boronski --- src/V3Error.h | 4 +-- src/V3LinkDot.cpp | 27 ---------------- src/V3Width.cpp | 5 --- test_regress/t/t_event_control_assign_mt.out | 6 ---- test_regress/t/t_event_control_assign_mt.pl | 22 ------------- test_regress/t/t_event_control_assign_mt.v | 14 -------- .../t/t_event_control_eventexpr_bad.out | 10 ------ .../t/t_event_control_eventexpr_bad.pl | 20 ------------ .../t/t_event_control_eventexpr_bad.v | 32 ------------------- test_regress/t/t_event_control_pass.pl | 2 +- test_regress/t/t_uvm_todo.pl | 1 - 11 files changed, 2 insertions(+), 141 deletions(-) delete mode 100644 test_regress/t/t_event_control_assign_mt.out delete mode 100755 test_regress/t/t_event_control_assign_mt.pl delete mode 100644 test_regress/t/t_event_control_assign_mt.v delete mode 100644 test_regress/t/t_event_control_eventexpr_bad.out delete mode 100755 test_regress/t/t_event_control_eventexpr_bad.pl delete mode 100644 test_regress/t/t_event_control_eventexpr_bad.v diff --git a/src/V3Error.h b/src/V3Error.h index eafecc151d..acebf7e6bc 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -98,8 +98,6 @@ class V3ErrorCode final { ENDLABEL, // End lable name mismatch ENUMVALUE, // Error: enum type needs explicit cast EOFNEWLINE, // End-of-file missing newline - EVENTEXPR, // Non-identifier expression used to send an event - EVENTMT, // Dangerous event operation in multithreaded simulation GENCLK, // Generated Clock. Historical, never issued. GENUNNAMED, // Generate unnamed, without label HIERBLOCK, // Ignored hierarchical block setting @@ -197,7 +195,7 @@ class V3ErrorCode final { "CASEINCOMPLETE", "CASEOVERLAP", "CASEWITHX", "CASEX", "CASTCONST", "CDCRSTLOGIC", "CLKDATA", "CMPCONST", "COLONPLUS", "COMBDLY", "CONSTRAINTIGN", "CONTASSREG", "DECLFILENAME", "DEFPARAM", "DEPRECATED", - "ENCAPSULATED", "ENDLABEL", "ENUMVALUE", "EOFNEWLINE", "EVENTEXPR", "EVENTMT", "GENCLK", + "ENCAPSULATED", "ENDLABEL", "ENUMVALUE", "EOFNEWLINE", "GENCLK", "GENUNNAMED", "HIERBLOCK", "IFDEPTH", "IGNOREDRETURN", "IMPERFECTSCH", "IMPLICIT", "IMPLICITSTATIC", "IMPORTSTAR", "IMPURE", diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index d9ae6d5691..473545166e 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -2269,25 +2269,6 @@ class LinkDotResolveVisitor final : public VNVisitor { if (nodep && nodep->isParam()) nodep->usedParam(true); } - static bool isTreeHierarchicalIdentExpr(AstNode* nodep) { - while (true) { - if (const AstMemberSel* mselp = VN_CAST(nodep, MemberSel)) { - nodep = mselp->fromp(); - continue; - } - if (const AstSelBit* selbp = VN_CAST(nodep, SelBit)) { - if (VN_IS(selbp->bitp(), Const)) { - nodep = selbp->fromp(); - continue; - } else { - return false; - } - } - break; - } - return VN_IS(nodep, VarRef); - } - // VISITs void visit(AstNetlist* nodep) override { // Recurse..., backward as must do packages before using packages @@ -3407,14 +3388,6 @@ class LinkDotResolveVisitor final : public VNVisitor { } m_ds.m_dotSymp = VL_RESTORER_PREV(m_curSymp); } - void visit(AstFireEvent* nodep) override { - visit(static_cast(nodep)); - if (!isTreeHierarchicalIdentExpr(nodep->operandp())) { - nodep->operandp()->v3warn(EVENTEXPR, - "Non-identifier expression used to reference an event to " - "be sent. This is not a part of IEEE 1800-2017."); - } - } void visit(AstWith* nodep) override { UINFO(5, " " << nodep << endl); checkNoDot(nodep); diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 344a6eb2b6..808cd0aecb 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -4808,11 +4808,6 @@ class WidthVisitor final : public VNVisitor { if (nodep->hasDType() && nodep->dtypep()->isEvent()) { checkEventAssignement(nodep); v3Global.setAssignsEvents(); - if (v3Global.opt.threads() > 1) { - nodep->v3warn(EVENTMT, - "Event assignements might cause issues in multithreaded simulation. " - "Use at your own risk."); - } } } diff --git a/test_regress/t/t_event_control_assign_mt.out b/test_regress/t/t_event_control_assign_mt.out deleted file mode 100644 index e1c4242505..0000000000 --- a/test_regress/t/t_event_control_assign_mt.out +++ /dev/null @@ -1,6 +0,0 @@ -%Warning-EVENTMT: t/t_event_control_assign_mt.v:12:10: Event assignements might cause issues in multithreaded simulation. Use at your own risk. - 12 | evt1 = evt2; - | ^ - ... For warning description see https://verilator.org/warn/EVENTMT?v=latest - ... Use "/* verilator lint_off EVENTMT */" and lint_on around source to disable this message. -%Error: Exiting due to diff --git a/test_regress/t/t_event_control_assign_mt.pl b/test_regress/t/t_event_control_assign_mt.pl deleted file mode 100755 index a8b9fc41fc..0000000000 --- a/test_regress/t/t_event_control_assign_mt.pl +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env perl -if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } -# DESCRIPTION: Verilator: Verilog Test driver/expect definition -# -# Copyright 2023 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 - -scenarios(vltmt => 1); - -compile( - verilator_flags2 => ["--exe --main --timing"], - make_main => 0, - threads => 2, - fails => 1, - expect_filename => $Self->{golden_filename}, - ); - -ok(1); -1; diff --git a/test_regress/t/t_event_control_assign_mt.v b/test_regress/t/t_event_control_assign_mt.v deleted file mode 100644 index a8c3ec583a..0000000000 --- a/test_regress/t/t_event_control_assign_mt.v +++ /dev/null @@ -1,14 +0,0 @@ -// DESCRIPTION: Verilator: Verilog Test module -// -// This file ONLY is placed under the Creative Commons Public Domain, for -// any use, without warranty, 2023 by Antmicro Ltd. -// SPDX-License-Identifier: CC0-1.0 - - -class Foo; - event evt1; - task automatic assign_new(); - event evt2; - evt1 = evt2; - endtask -endclass diff --git a/test_regress/t/t_event_control_eventexpr_bad.out b/test_regress/t/t_event_control_eventexpr_bad.out deleted file mode 100644 index 7736f7a918..0000000000 --- a/test_regress/t/t_event_control_eventexpr_bad.out +++ /dev/null @@ -1,10 +0,0 @@ -%Warning-EVENTEXPR: t/t_event_control_eventexpr_bad.v:19:7: Non-identifier expression used to reference an event to be sent. This is not a part of IEEE 1800-2017. - 19 | ->get_event(); - | ^~~~~~~~~ - ... For warning description see https://verilator.org/warn/EVENTEXPR?v=latest - ... Use "/* verilator lint_off EVENTEXPR */" and lint_on around source to disable this message. -%Warning-EVENTEXPR: t/t_event_control_eventexpr_bad.v:22:18: Non-identifier expression used to reference an event to be sent. This is not a part of IEEE 1800-2017. - 22 | ->evt_array[i]; - | ^ -%Error: Verilator internal fault, sorry. Suggest trying --debug --gdbbt -%Error: Command Failed diff --git a/test_regress/t/t_event_control_eventexpr_bad.pl b/test_regress/t/t_event_control_eventexpr_bad.pl deleted file mode 100755 index 54bfd3960a..0000000000 --- a/test_regress/t/t_event_control_eventexpr_bad.pl +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env perl -if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } -# DESCRIPTION: Verilator: Verilog Test driver/expect definition -# -# Copyright 2023 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 - -scenarios(linter => 1); - -lint( - verilator_flags2 => ["--timing"], - fails => 1, - expect_filename => $Self->{golden_filename}, - ); - -ok(1); -1; diff --git a/test_regress/t/t_event_control_eventexpr_bad.v b/test_regress/t/t_event_control_eventexpr_bad.v deleted file mode 100644 index fe7433f0ba..0000000000 --- a/test_regress/t/t_event_control_eventexpr_bad.v +++ /dev/null @@ -1,32 +0,0 @@ -// DESCRIPTION: Verilator: Verilog Test module -// -// This file ONLY is placed under the Creative Commons Public Domain, for -// any use, without warranty, 2023 by Antmicro Ltd. -// SPDX-License-Identifier: CC0-1.0 - -class Foo; - Foo other; - Foo other_array[10]; - event evt; - event evt_array[10]; - - function automatic event get_event(); - return evt; - endfunction - - task send_events(); - ->evt; // Should be good - ->get_event(); // Should fail - it's not a hierarchical identifier - ->other.evt; // Should be good - for (int i = 0; i < 10; i++) begin - ->evt_array[i]; // Should fail - it's an expression that's not a - // hierarhical identifier, because of the variable - // used for indexing - end - // Should be good because we are using constant selectors - ->evt_array[2]; - ->other.evt_array[1]; - ->other_array[3].evt; - ->other_array[0].evt_array[7]; - endtask -endclass diff --git a/test_regress/t/t_event_control_pass.pl b/test_regress/t/t_event_control_pass.pl index 1c0f611960..2f83297914 100755 --- a/test_regress/t/t_event_control_pass.pl +++ b/test_regress/t/t_event_control_pass.pl @@ -11,7 +11,7 @@ scenarios(simulator => 1); compile( - verilator_flags2 => ["--exe --main --timing -Wno-EVENTEXPR"], + verilator_flags2 => ["--exe --main --timing"], make_main => 0, threads => 1, ); diff --git a/test_regress/t/t_uvm_todo.pl b/test_regress/t/t_uvm_todo.pl index 850402182f..9fb3de36f6 100755 --- a/test_regress/t/t_uvm_todo.pl +++ b/test_regress/t/t_uvm_todo.pl @@ -14,7 +14,6 @@ v_flags2 => ["--timing", "-Wno-PKGNODECL -Wno-IMPLICITSTATIC -Wno-CONSTRAINTIGN -Wno-MISINDENT", "-Wno-CASEINCOMPLETE -Wno-CASTCONST -Wno-SYMRSVDWORD -Wno-WIDTHEXPAND -Wno-WIDTHTRUNC", - "-Wno-EVENTEXPR", "-Wno-REALCVT", # TODO note mostly related to $realtime - could suppress or fix upstream "-Wno-ZERODLY", # TODO issue #4494, add support ],