mirror of
https://github.com/verilator/verilator.git
synced 2025-04-25 01:56:54 +00:00
Pedantic no longer disables __LINE__.
This commit is contained in:
parent
e7cbefa316
commit
ef4e52a60e
@ -1256,15 +1256,12 @@ Verilator supports $clog2.
|
||||
|
||||
Verilator partially supports the uwire keyword.
|
||||
|
||||
=head1 SYSTEMVERILOG (IEEE 1800-2005) SUPPORT
|
||||
=head1 SYSTEMVERILOG 2005 (IEEE 1800-2005) SUPPORT
|
||||
|
||||
Verilator currently has some support for SystemVerilog synthesis
|
||||
constructs. As SystemVerilog features enter common usage they are added;
|
||||
please file a bug if a feature you need is missing.
|
||||
|
||||
Verilator implements the full SystemVerilog 1800-2005 preprocessor,
|
||||
including function call-like preprocessor defines.
|
||||
|
||||
Verilator supports ==? and !=? operators, $bits, $countones, $error,
|
||||
$fatal, $info, $isunknown, $onehot, $onehot0, $unit, $warning, always_comb,
|
||||
always_ff, always_latch, bit, byte, chandle, do-while, export, final,
|
||||
@ -1276,6 +1273,12 @@ It also supports .name and .* interconnection.
|
||||
Verilator partially supports concurrent assert and cover statements; see
|
||||
the enclosed coverage tests for the syntax which is allowed.
|
||||
|
||||
=head1 SYSTEMVERILOG 2009 (IEEE 1800-2009) SUPPORT
|
||||
|
||||
Verilator implements a full SystemVerilog 2009 preprocessor, including
|
||||
function call-like preprocessor defines, default define arguments,
|
||||
`__FILE__, `__LINE__ and `undefineall.
|
||||
|
||||
=head1 SUGAR/PSL SUPPORT
|
||||
|
||||
Most future work is being directed towards improving SystemVerilog
|
||||
@ -1329,15 +1332,15 @@ or `ifdef's may break other tools.
|
||||
|
||||
=item `__FILE__
|
||||
|
||||
The __FILE__ define expands to the current filename, like C++'s __FILE__.
|
||||
This is in the draft SystemVerilog 2009 standard (but supported by
|
||||
Verilator since 2006!)
|
||||
The __FILE__ define expands to the current filename as a string, like C++'s
|
||||
__FILE__. This was incorporated into to the 1800-2009 standard (but
|
||||
supported by Verilator since 2006!)
|
||||
|
||||
=item `__LINE__
|
||||
|
||||
The __LINE__ define expands to the current line number, like C++'s
|
||||
__LINE__. This is in the draft SystemVerilog 2009 standard (but supported
|
||||
by Verilator since 2006!)
|
||||
The __LINE__ define expands to the current filename as a string, like C++'s
|
||||
__LINE__. This was incorporated into to the 1800-2009 standard (but
|
||||
supported by Verilator since 2006!)
|
||||
|
||||
=item `error I<string>
|
||||
|
||||
|
@ -113,7 +113,7 @@ class V3PreLex {
|
||||
// State to lexer
|
||||
static V3PreLex* s_currentLexp; // Current lexing point
|
||||
int m_keepComments; // Emit comments in output text
|
||||
bool m_pedantic; // Obey standard; don't Substitute `__FILE__ and `__LINE__
|
||||
bool m_pedantic; // Obey standard; don't Substitute `error
|
||||
|
||||
// State from lexer
|
||||
int m_formalLevel; // Parenthesis counting inside def formals
|
||||
|
@ -92,17 +92,14 @@ psl [p]sl
|
||||
<INITIAL>"`undefineall" { return(VP_UNDEFINEALL); }
|
||||
|
||||
/* Optional directives we recognize */
|
||||
<INITIAL>"`__FILE__" { if (!pedantic()) {
|
||||
static string rtnfile;
|
||||
rtnfile = '"'; rtnfile += LEXP->m_curFilelinep->cfilename();
|
||||
rtnfile += '"'; yytext=(char*)rtnfile.c_str(); yyleng = rtnfile.length();
|
||||
return (VP_STRING);
|
||||
} else return(VP_DEFREF); }
|
||||
<INITIAL>"`__LINE__" { if (!pedantic()) {
|
||||
static char buf[10];
|
||||
sprintf(buf, "%d",LEXP->m_curFilelinep->lineno());
|
||||
yytext = buf; yyleng = strlen(yytext); return (VP_TEXT);
|
||||
} else return(VP_DEFREF); }
|
||||
<INITIAL>"`__FILE__" { static string rtnfile;
|
||||
rtnfile = '"'; rtnfile += LEXP->m_curFilelinep->cfilename();
|
||||
rtnfile += '"'; yytext=(char*)rtnfile.c_str(); yyleng = rtnfile.length();
|
||||
return (VP_STRING); }
|
||||
<INITIAL>"`__LINE__" { static char buf[10];
|
||||
sprintf(buf, "%d",LEXP->m_curFilelinep->lineno());
|
||||
yytext = buf; yyleng = strlen(yytext);
|
||||
return (VP_TEXT); }
|
||||
<INITIAL>"`error" { if (!pedantic()) return (VP_ERROR); else return(VP_DEFREF); }
|
||||
|
||||
/* Pass-through strings */
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
// These options control how the parsing proceeds
|
||||
int keepComments() { return 2; } // Return comments, 0=no, 1=yes, 2=callback
|
||||
bool lineDirectives() { return true; } // Insert `line directives
|
||||
bool pedantic() { return false; } // Obey standard; Don't substitute `__FILE__ and `__LINE__
|
||||
bool pedantic() { return false; } // Obey standard; Don't substitute `error
|
||||
static bool optPsl();
|
||||
|
||||
// CALLBACK METHODS
|
||||
|
Loading…
Reference in New Issue
Block a user