In errors, single quote signals and other from-user data.

This commit is contained in:
Wilson Snyder 2019-07-11 22:36:32 -04:00
parent 0f857ce423
commit a7e5cccf33
9 changed files with 12 additions and 12 deletions

View File

@ -1666,7 +1666,7 @@ void EmitCStmts::displayNode(AstNode* nodep, AstScopeName* scopenamep,
break;
}
default:
nodep->v3error("Unknown $display-like format code: %"<<pos[0]);
nodep->v3error("Unknown $display-like format code: '%"<<pos[0]<<"'");
break;
}
}

View File

@ -287,7 +287,7 @@ private:
break;
default: // Most operators, just move to next argument
if (!V3Number::displayedFmtLegal(ch)) {
nodep->v3error("Unknown $display-like format code: %"<<ch);
nodep->v3error("Unknown $display-like format code: '%"<<ch<<"'");
} else {
if (!argp) {
nodep->v3error("Missing arguments for $display-like format");

View File

@ -329,7 +329,7 @@ void V3PreProcImp::define(FileLine* fl, const string& name, const string& value,
UINFO(4,"DEFINE '"<<name<<"' as '"<<value<<"' params '"<<params<<"'"<<endl);
if (defExists(name)) {
if (!(defValue(name)==value && defParams(name)==params)) { // Duplicate defs are OK
fl->v3warn(REDEFMACRO, "Redefining existing define: "<<name<<", with different value: "
fl->v3warn(REDEFMACRO, "Redefining existing define: '"<<name<<"', with different value: "
<<value<<(params=="" ? "":" ")<<params);
defFileline(name)->v3warn(REDEFMACRO, "Previous definition is here, with value: "
<<defValue(name)

View File

@ -2513,7 +2513,7 @@ private:
// We've resolved parameters and hit a module that we couldn't resolve. It's
// finally time to report it.
// Note only here in V3Width as this is first visitor after V3Dead.
nodep->v3error("Cannot find file containing module: "<<nodep->modName());
nodep->v3error("Cannot find file containing module: '"<<nodep->modName()<<"'");
v3Global.opt.filePathLookedMsg(nodep->fileline(), nodep->modName());
}
if (nodep->rangep()) {

View File

@ -214,8 +214,8 @@ int V3ParseGrammar::s_modTypeImpNum = 0;
static void ERRSVKWD(FileLine* fileline, const string& tokname) {
static int toldonce = 0;
fileline->v3error(string("Unexpected \"")+tokname+"\": \""+tokname
+"\" is a SystemVerilog keyword misused as an identifier."
fileline->v3error(string("Unexpected '")+tokname+"': '"+tokname
+"' is a SystemVerilog keyword misused as an identifier."
+(!toldonce++
? "\n"+V3Error::warnMore()
+"... Suggest modify the Verilog-2001 code to avoid SV keywords,"

View File

@ -1,3 +1,3 @@
%Error: t/t_display_bad.v:10: Missing arguments for $display-like format
%Error: t/t_display_bad.v:12: Unknown $display-like format code: %q
%Error: t/t_display_bad.v:12: Unknown $display-like format code: '%q'
%Error: Exiting due to

View File

@ -1,4 +1,4 @@
%Error: t/t_gen_missing.v:42: Cannot find file containing module: foo_not_needed
%Error: t/t_gen_missing.v:42: Cannot find file containing module: 'foo_not_needed'
... Looked in:
t/foo_not_needed
t/foo_not_needed.v

View File

@ -1,6 +1,6 @@
%Warning-REDEFMACRO: t/t_pp_dupdef.v:10: Redefining existing define: DUP, with different value: barney
%Warning-REDEFMACRO: t/t_pp_dupdef.v:10: Redefining existing define: 'DUP', with different value: barney
... Use "/* verilator lint_off REDEFMACRO */" and lint_on around source to disable this message.
%Warning-REDEFMACRO: t/t_pp_dupdef.v:10: Previous definition is here, with value: fred
%Warning-REDEFMACRO: t/t_pp_dupdef.v:13: Redefining existing define: DUPP, with different value: paramed(x,z) (x*z)
%Warning-REDEFMACRO: t/t_pp_dupdef.v:13: Redefining existing define: 'DUPP', with different value: paramed(x,z) (x*z)
%Warning-REDEFMACRO: t/t_pp_dupdef.v:13: Previous definition is here, with value: paramed(x) (x)
%Error: Exiting due to

View File

@ -1,5 +1,5 @@
%Error: t/t_var_bad_sv.v:7: Unexpected "do": "do" is a SystemVerilog keyword misused as an identifier.
%Error: t/t_var_bad_sv.v:7: 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.
%Error: t/t_var_bad_sv.v:8: Unexpected "do": "do" is a SystemVerilog keyword misused as an identifier.
%Error: t/t_var_bad_sv.v:8: Unexpected 'do': 'do' is a SystemVerilog keyword misused as an identifier.
%Error: t/t_var_bad_sv.v:8: syntax error, unexpected '(', expecting ')'
%Error: Exiting due to