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