diff --git a/src/V3HierBlock.cpp b/src/V3HierBlock.cpp index 0140a82ef..8c234cac2 100644 --- a/src/V3HierBlock.cpp +++ b/src/V3HierBlock.cpp @@ -338,7 +338,7 @@ void V3HierBlockPlan::createPlan(AstNetlist* nodep) { if (modp->hierBlock()) { modp->v3warn(HIERBLOCK, "Top module illegally marked hierarchical block, ignoring marking\n" - + V3Error::warnMore() + + modp->warnMore() + "... Suggest remove verilator hier_block on this module"); modp->hierBlock(false); } diff --git a/src/V3LinkCells.cpp b/src/V3LinkCells.cpp index 2c118c6f2..f6db23721 100644 --- a/src/V3LinkCells.cpp +++ b/src/V3LinkCells.cpp @@ -82,7 +82,7 @@ void LinkCellsGraph::loopsMessageCb(V3GraphVertex* vertexp) { "Unsupported: Recursive multiple modules (module instantiates " "something leading back to itself): " << vvertexp->modp()->prettyNameQ() << '\n' - << V3Error::warnMore() + << vvertexp->modp()->warnMore() << "... note: self-recursion (module instantiating itself " "directly) is supported."); V3Error::abortIfErrors(); diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 44cbd5ed6..2785a939b 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -803,18 +803,17 @@ void V3Options::notify() { // We always call protect() on names, we don't check if public or not // Hence any external references wouldn't be able to find the refed public object. cmdfl->v3warn(E_UNSUPPORTED, "Unsupported: Using --protect-ids with --public\n" // - + V3Error::warnMore() - + "... Suggest remove --public."); + + cmdfl->warnMore() + "... Suggest remove --public."); } if (trace()) { cmdfl->v3warn(INSECURE, "Using --protect-ids with --trace may expose private design details\n" - + V3Error::warnMore() + "... Suggest remove --trace."); + + cmdfl->warnMore() + "... Suggest remove --trace."); } if (vpi()) { cmdfl->v3warn(INSECURE, "Using --protect-ids with --vpi may expose private design details\n" - + V3Error::warnMore() + "... Suggest remove --vpi."); + + cmdfl->warnMore() + "... Suggest remove --vpi."); } } diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 3d46627bd..500d8e6dc 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -1094,7 +1094,7 @@ private: if (bdtypep->isDpiBitVec() && portp->width() > 32) { portp->v3error("DPI function may not return a > 32 bits wide type " "other than basic types.\n" - + V3Error::warnMore() + + portp->warnMore() + "... Suggest make it an output argument instead?"); } if (bdtypep->isDpiLogicVec()) { @@ -1106,7 +1106,7 @@ private: if (portp->isWide()) { nodep->v3warn(E_UNSUPPORTED, "Unsupported: Public functions with return > 64 bits wide.\n" - + V3Error::warnMore() + + nodep->warnMore() + "... Suggest make it an output argument instead?"); } } diff --git a/src/verilog.y b/src/verilog.y index 96e24572c..02d00cb37 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -343,7 +343,7 @@ static void ERRSVKWD(FileLine* fileline, const string& tokname) { fileline->v3error( std::string{"Unexpected '"} + tokname + "': '" + tokname + "' is a SystemVerilog keyword misused as an identifier." - + (!toldonce++ ? "\n" + V3Error::warnMore() + + (!toldonce++ ? "\n" + fileline->warnMore() + "... Suggest modify the Verilog-2001 code to avoid SV keywords," + " or use `begin_keywords or --language." : "")); diff --git a/test_regress/t/t_dpi_result_type_bad.out b/test_regress/t/t_dpi_result_type_bad.out index b95b58dc6..4c3e82ffe 100644 --- a/test_regress/t/t_dpi_result_type_bad.out +++ b/test_regress/t/t_dpi_result_type_bad.out @@ -1,65 +1,65 @@ %Error: t/t_dpi_result_type_bad.v:79:40: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 79 | import "DPI-C" function bit [ 32:0] i_array_2_state_33(); | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:80:40: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 80 | import "DPI-C" function bit [ 63:0] i_array_2_state_64(); | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:81:40: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 81 | import "DPI-C" function bit [ 64:0] i_array_2_state_65(); | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:82:40: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 82 | import "DPI-C" function bit [127:0] i_array_2_state_128(); | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:85:48: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 85 | import "DPI-C" function array_2_state_33_t i_array_2_state_33_t(); | ^~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:86:48: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 86 | import "DPI-C" function array_2_state_64_t i_array_2_state_64_t(); | ^~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:87:48: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 87 | import "DPI-C" function array_2_state_65_t i_array_2_state_65_t(); | ^~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:88:48: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 88 | import "DPI-C" function array_2_state_128_t i_array_2_state_128_t(); | ^~~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:91:47: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 91 | import "DPI-C" function struct_2_state_33 i_struct_2_state_33(); | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:92:47: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 92 | import "DPI-C" function struct_2_state_64 i_struct_2_state_64(); | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:93:47: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 93 | import "DPI-C" function struct_2_state_65 i_struct_2_state_65(); | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:94:47: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 94 | import "DPI-C" function struct_2_state_128 i_struct_2_state_128(); | ^~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:97:46: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 97 | import "DPI-C" function union_2_state_33 i_union_2_state_33(); | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:98:46: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 98 | import "DPI-C" function union_2_state_64 i_union_2_state_64(); | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:99:46: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 99 | import "DPI-C" function union_2_state_65 i_union_2_state_65(); | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:100:46: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 100 | import "DPI-C" function union_2_state_128 i_union_2_state_128(); | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:103:36: DPI function may not return a 4-state type other than a single 'logic' (IEEE 1800-2017 35.5.5) @@ -198,67 +198,67 @@ 155 | import "DPI-C" function union_4_state_128 i_union_4_state_128(); | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:245:25: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 245 | function bit [ 32:0] e_array_2_state_33(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:246:25: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 246 | function bit [ 63:0] e_array_2_state_64(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:247:25: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 247 | function bit [ 64:0] e_array_2_state_65(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:248:25: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 248 | function bit [127:0] e_array_2_state_128(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:251:33: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 251 | function array_2_state_33_t e_array_2_state_33_t(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:252:33: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 252 | function array_2_state_64_t e_array_2_state_64_t(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:253:33: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 253 | function array_2_state_65_t e_array_2_state_65_t(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:254:33: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 254 | function array_2_state_128_t e_array_2_state_128_t(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:257:32: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 257 | function struct_2_state_33 e_struct_2_state_33(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:258:32: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 258 | function struct_2_state_64 e_struct_2_state_64(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:259:32: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 259 | function struct_2_state_65 e_struct_2_state_65(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:260:32: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 260 | function struct_2_state_128 e_struct_2_state_128(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:263:31: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 263 | function union_2_state_33 e_union_2_state_33(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:264:31: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 264 | function union_2_state_64 e_union_2_state_64(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:265:31: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 265 | function union_2_state_65 e_union_2_state_65(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:266:31: DPI function may not return a > 32 bits wide type other than basic types. - ... Suggest make it an output argument instead? + : ... Suggest make it an output argument instead? 266 | function union_2_state_128 e_union_2_state_128(); return 0; endfunction | ^~~~~~~~~~~~~~~~~~~ %Error: t/t_dpi_result_type_bad.v:269:21: DPI function may not return a 4-state type other than a single 'logic' (IEEE 1800-2017 35.5.5) diff --git a/test_regress/t/t_hier_block1_bad.out b/test_regress/t/t_hier_block1_bad.out index 84af5a79c..cdc8f49b2 100644 --- a/test_regress/t/t_hier_block1_bad.out +++ b/test_regress/t/t_hier_block1_bad.out @@ -1,6 +1,6 @@ %Warning-HIERBLOCK: t/t_hier_block1_bad.v:15:8: Top module illegally marked hierarchical block, ignoring marking : ... In instance t - ... Suggest remove verilator hier_block on this module + : ... Suggest remove verilator hier_block on this module 15 | module t ( | ^ ... For warning description see https://verilator.org/warn/HIERBLOCK?v=latest diff --git a/test_regress/t/t_inst_recurse_bad.out b/test_regress/t/t_inst_recurse_bad.out index c9bbe810a..eb83d4b29 100644 --- a/test_regress/t/t_inst_recurse_bad.out +++ b/test_regress/t/t_inst_recurse_bad.out @@ -1,5 +1,5 @@ %Error-UNSUPPORTED: t/t_inst_recurse_bad.v:18:8: Unsupported: Recursive multiple modules (module instantiates something leading back to itself): 'looped' - ... note: self-recursion (module instantiating itself directly) is supported. + : ... note: self-recursion (module instantiating itself directly) is supported. 18 | module looped ( ); | ^~~~~~ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest diff --git a/test_regress/t/t_var_bad_sv.out b/test_regress/t/t_var_bad_sv.out index 7a5ff2358..9309d1ec0 100644 --- a/test_regress/t/t_var_bad_sv.out +++ b/test_regress/t/t_var_bad_sv.out @@ -1,5 +1,5 @@ %Error: t/t_var_bad_sv.v:8:8: Unexpected 'do': 'do' is a SystemVerilog keyword misused as an identifier. - ... Suggest modify the Verilog-2001 code to avoid SV keywords, or use `begin_keywords or --language. + : ... Suggest modify the Verilog-2001 code to avoid SV keywords, or use `begin_keywords or --language. 8 | reg do; | ^~ %Error: t/t_var_bad_sv.v:9:14: Unexpected 'do': 'do' is a SystemVerilog keyword misused as an identifier.