From 0a045a7bf6fe928645c9895520a5aae0be4537a0 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 12 Nov 2022 12:09:37 -0500 Subject: [PATCH] Change ENDLABEL from warning into an error. --- Changes | 1 + docs/guide/exe_verilator.rst | 4 ++-- docs/guide/warnings.rst | 8 ++++---- src/V3Error.h | 6 +++--- test_regress/t/t_hierarchy_identifier_bad.out | 13 ++++++------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Changes b/Changes index 9da2aaabc..13e49197e 100644 --- a/Changes +++ b/Changes @@ -17,6 +17,7 @@ Verilator 5.003 devel * Support named properties (#3667). [Ryszard Rozak, Antmicro Ltd] * Support randcase. * Internal AST improvements, also affect XML format (#3721). [Geza Lore] +* Change ENDLABEL from warning into an error. * Fix return type of $countbits functions to int (#3725). [Ryszard Rozak, Antmicro Ltd] * Fix missing UNUSED warnings with --coverage (#3736). [alejandro-castro-ortegon] * Fix tracing parameters overridden with -G (#3723). [Iztok Jeras] diff --git a/docs/guide/exe_verilator.rst b/docs/guide/exe_verilator.rst index 35b589351..ffb990356 100644 --- a/docs/guide/exe_verilator.rst +++ b/docs/guide/exe_verilator.rst @@ -1490,7 +1490,7 @@ Summary: Disable all lint related warning messages, and all style warnings. This is equivalent to ``-Wno-ALWCOMBORDER -Wno-BSSPACE -Wno-CASEINCOMPLETE -Wno-CASEOVERLAP -Wno-CASEX -Wno-CASTCONST -Wno-CASEWITHX -Wno-CMPCONST -Wno-COLONPLUS - -Wno-ENDLABEL -Wno-IMPLICIT -Wno-LITENDIAN -Wno-PINCONNECTEMPTY + -Wno-IMPLICIT -Wno-LITENDIAN -Wno-PINCONNECTEMPTY -Wno-PINMISSING -Wno-SYNCASYNCNET -Wno-UNDRIVEN -Wno-UNSIGNED -Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL -Wno-WIDTH`` plus the list shown for Wno-style. @@ -1526,7 +1526,7 @@ Summary: enabled), but do not affect style messages. This is equivalent to ``-Wwarn-ALWCOMBORDER -Wwarn-BSSPACE -Wwarn-CASEINCOMPLETE -Wwarn-CASEOVERLAP -Wwarn-CASEX -Wwarn-CASTCONST -Wwarn-CASEWITHX -Wwarn-CMPCONST - -Wwarn-COLONPLUS -Wwarn-ENDLABEL -Wwarn-IMPLICIT -Wwarn-LITENDIAN + -Wwarn-COLONPLUS -Wwarn-IMPLICIT -Wwarn-LITENDIAN -Wwarn-PINMISSING -Wwarn-REALCVT -Wwarn-UNSIGNED -Wwarn-WIDTH``. .. option:: -Wwarn-style diff --git a/docs/guide/warnings.rst b/docs/guide/warnings.rst index 681f11ab5..3a5f625de 100644 --- a/docs/guide/warnings.rst +++ b/docs/guide/warnings.rst @@ -537,11 +537,11 @@ List Of Warnings .. option:: ENDLABEL - Warns that a label attached to a "end"-something statement does not + Error that a label attached to a "end"-something statement does not match the label attached to the block start. - Ignoring this warning will only suppress the lint check, it will - simulate correctly. + This error is required by IEEE. Ignoring this warning will only suppress + the lint check, it will simulate correctly. Faulty example: @@ -556,7 +556,7 @@ List Of Warnings .. code-block:: - %Warning-ENDLABEL: example.v:2:13: End label 'not_mine' does not match begin label 'mine' + %Error-ENDLABEL: example.v:2:13: End label 'not_mine' does not match begin label 'mine' To repair either fix the end label's name, or remove entirely. diff --git a/src/V3Error.h b/src/V3Error.h index 2aca831d9..1268136a2 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -206,8 +206,8 @@ public: // Later -Werror- options may make more of these. bool pretendError() const VL_MT_SAFE { return (m_e == ASSIGNIN || m_e == BADSTDPRAGMA || m_e == BLKANDNBLK || m_e == BLKLOOPINIT - || m_e == CONTASSREG || m_e == IMPURE || m_e == PINNOTFOUND || m_e == PKGNODECL - || m_e == PROCASSWIRE // Says IEEE + || m_e == CONTASSREG || m_e == ENDLABEL || m_e == IMPURE || m_e == PINNOTFOUND + || m_e == PKGNODECL || m_e == PROCASSWIRE // Says IEEE || m_e == ZERODLY); } // Warnings to mention manual @@ -218,7 +218,7 @@ public: bool lintError() const VL_MT_SAFE { return (m_e == ALWCOMBORDER || m_e == BSSPACE || m_e == CASEINCOMPLETE || m_e == CASEOVERLAP || m_e == CASEWITHX || m_e == CASEX || m_e == CASTCONST - || m_e == CMPCONST || m_e == COLONPLUS || m_e == ENDLABEL || m_e == IMPLICIT + || m_e == CMPCONST || m_e == COLONPLUS || m_e == IMPLICIT || m_e == LATCH || m_e == LITENDIAN || m_e == PINMISSING || m_e == REALCVT || m_e == UNSIGNED || m_e == WIDTH); } diff --git a/test_regress/t/t_hierarchy_identifier_bad.out b/test_regress/t/t_hierarchy_identifier_bad.out index b18adbb8e..fb853a322 100644 --- a/test_regress/t/t_hierarchy_identifier_bad.out +++ b/test_regress/t/t_hierarchy_identifier_bad.out @@ -1,18 +1,17 @@ -%Warning-ENDLABEL: t/t_hierarchy_identifier_bad.v:34:10: End label 'if_cnt_finish_bad' does not match begin label 'if_cnt_finish' +%Error-ENDLABEL: t/t_hierarchy_identifier_bad.v:34:10: End label 'if_cnt_finish_bad' does not match begin label 'if_cnt_finish' 34 | end : if_cnt_finish_bad | ^~~~~~~~~~~~~~~~~ - ... For warning description see https://verilator.org/warn/ENDLABEL?v=latest - ... Use "/* verilator lint_off ENDLABEL */" and lint_on around source to disable this message. -%Warning-ENDLABEL: t/t_hierarchy_identifier_bad.v:40:10: End label 'generate_for_bad' does not match begin label 'generate_for' + ... For error description see https://verilator.org/warn/ENDLABEL?v=latest +%Error-ENDLABEL: t/t_hierarchy_identifier_bad.v:40:10: End label 'generate_for_bad' does not match begin label 'generate_for' 40 | end : generate_for_bad | ^~~~~~~~~~~~~~~~ -%Warning-ENDLABEL: t/t_hierarchy_identifier_bad.v:47:10: End label 'generate_if_if_bad' does not match begin label 'generate_if_if' +%Error-ENDLABEL: t/t_hierarchy_identifier_bad.v:47:10: End label 'generate_if_if_bad' does not match begin label 'generate_if_if' 47 | end : generate_if_if_bad | ^~~~~~~~~~~~~~~~~~ -%Warning-ENDLABEL: t/t_hierarchy_identifier_bad.v:51:10: End label 'generate_if_else_bad' does not match begin label 'generate_if_else' +%Error-ENDLABEL: t/t_hierarchy_identifier_bad.v:51:10: End label 'generate_if_else_bad' does not match begin label 'generate_if_else' 51 | end : generate_if_else_bad | ^~~~~~~~~~~~~~~~~~~~ -%Warning-ENDLABEL: t/t_hierarchy_identifier_bad.v:54:13: End label 't_bad' does not match begin label 't' +%Error-ENDLABEL: t/t_hierarchy_identifier_bad.v:54:13: End label 't_bad' does not match begin label 't' 54 | endmodule : t_bad | ^~~~~ %Error: Exiting due to