From b7665a88dbab6c47b26489999854d577dff78b87 Mon Sep 17 00:00:00 2001 From: Stefan Wallentowitz Date: Mon, 30 Dec 2019 19:15:43 +0100 Subject: [PATCH] Rename msg to rule in configuration files (#2080) Rename the -msg switch to -rule in configuration files as it is more clear. resolves #2068 --- bin/verilator | 13 ++++++++----- src/verilog.l | 1 + src/verilog.y | 9 +++++++++ test_regress/t/t_vlt_warn.v | 2 +- test_regress/t/t_vlt_warn.vlt | 8 ++++---- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/bin/verilator b/bin/verilator index 1a99f5b3f..d2be5ea29 100755 --- a/bin/verilator +++ b/bin/verilator @@ -2737,8 +2737,8 @@ controlled by configuration files, typically named with the .vlt extension. An example: `verilator_config - lint_off -msg WIDTH - lint_off -msg CASEX -file "silly_vendor_code.v" + lint_off -rule WIDTH + lint_off -rule CASEX -file "silly_vendor_code.v" This disables WIDTH warnings globally, and CASEX for a specific file. @@ -2767,9 +2767,9 @@ Enable/disable coverage for the specified filename (or wildcard with '*' or omitted). Often used to ignore an entire module for coverage analysis purposes. -=item lint_on [-msg ] [-file "" [-lines [ - ]]] +=item lint_on [-rule ] [-file "" [-lines [ - ]]] -=item lint_off [-msg ] [-file "" [-lines [ - ]]] +=item lint_off [-rule ] [-file "" [-lines [ - ]]] Enable/disables the specified lint warning, in the specified filename (or wildcard with '*' or '?', or all files if omitted) and range of line @@ -2778,10 +2778,13 @@ numbers (or all lines if omitted). With lint_off using '*' will override any lint_on directives in the source, i.e. the warning will still not be printed. -If the -msg is omitted, all lint warnings (see list in -Wno-lint) are +If the -rule is omitted, all lint warnings (see list in -Wno-lint) are enabled/disabled. This will override all later lint warning enables for the specified region. +In previous versions -rule was named -msg. The latter is deprecated, but +still works with a deprecation info, it may be removed in future versions. + =item tracing_on [-file "" [-lines [ - ]]] =item tracing_off [-file "" [-lines [ - ]]] diff --git a/src/verilog.l b/src/verilog.l index defc5430d..733b41491 100644 --- a/src/verilog.l +++ b/src/verilog.l @@ -145,6 +145,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5} -?"-file" { FL; return yVLT_D_FILE; } -?"-lines" { FL; return yVLT_D_LINES; } -?"-msg" { FL; return yVLT_D_MSG; } + -?"-rule" { FL; return yVLT_D_RULE; } } /************************************************************************/ diff --git a/src/verilog.y b/src/verilog.y index e2031c2e1..d51d675f1 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -283,6 +283,7 @@ class AstSenTree; %token yVLT_D_FILE "--file" %token yVLT_D_LINES "--lines" %token yVLT_D_MSG "--msg" +%token yVLT_D_RULE "--rule" %token yaD_IGNORE "${ignored-bbox-sys}" %token yaD_DPI "${dpi-sys}" @@ -5596,6 +5597,10 @@ vltOffFront: | yVLT_TRACING_OFF { $$ = V3ErrorCode::I_TRACING; } | yVLT_LINT_OFF { $$ = V3ErrorCode::I_LINT; } | yVLT_LINT_OFF yVLT_D_MSG yaID__ETC + { $$ = V3ErrorCode((*$3).c_str()); + if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<v3info("Deprecated -msg in configuration files, use -rule instead."<v3error("Unknown Error Code: "<<*$3<: | yVLT_TRACING_ON { $$ = V3ErrorCode::I_TRACING; } | yVLT_LINT_ON { $$ = V3ErrorCode::I_LINT; } | yVLT_LINT_ON yVLT_D_MSG yaID__ETC + { $$ = V3ErrorCode((*$3).c_str()); + if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<v3info("Deprecated -msg in configuration files, use -rule instead."<v3error("Unknown Error Code: "<<*$3<