Support optional argument to and .

git-svn-id: file://localhost/svn/verilator/trunk/verilator@1034 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
Wilson Snyder 2008-04-24 14:32:39 +00:00
parent 215bdfccc2
commit e137e93f94
4 changed files with 10 additions and 2 deletions

View File

@ -11,6 +11,8 @@ indicates the contributor was also the author of the fix; Thanks!
**** Allow defines terminated in EOF, though against spec. [Stefan Thiede]
**** Support optional argument to $finish and $stop. [by Stefan Thiede]
**** Fix "always @ ((a) or (b))" syntax error. [by Niranjan Prabhu]
**** Fix "output reg name=expr;" syntax error. [Martin Scharrer]

View File

@ -1548,6 +1548,10 @@ argument (as with C's printf), you cannot simply list variables standalone.
The sized display functions are rarely used and so not supported. Replace
them with a $write with the appropriate format specifier.
=item $finish, $stop
The rarely used optional exit code to finish and stop is ignored.
=item $fopen, $fclose, $fdisplay, $fwrite
File descriptors passed to the file PLI calls must be file descriptors, not

View File

@ -897,7 +897,9 @@ stmt: ';' { $$ = NULL; }
| yD_C '(' cStrList ')' ';' { $$ = (v3Global.opt.ignc() ? NULL : new AstUCStmt($1,$3)); }
| yD_FCLOSE '(' varRefDotBit ')' ';' { $$ = new AstFClose($1, $3); }
| yD_FINISH parenE ';' { $$ = new AstFinish($1); }
| yD_FINISH '(' expr ')' ';' { $$ = new AstFinish($1); }
| yD_STOP parenE ';' { $$ = new AstStop($1); }
| yD_STOP '(' expr ')' ';' { $$ = new AstStop($1); }
| yVL_COVER_OFF { $$ = new AstPragma($1,AstPragmaType::COVERAGE_BLOCK_OFF); }
| stateCaseForIf { $$ = $1; }
| taskRef ';' { $$ = $1; }

View File

@ -23,7 +23,7 @@ module t;
$fclose(file);
`ifdef verilator
if (file != 0) $stop;
if (file != 0) $stop(1); // Also test arguments to stop
$fwrite(file, "Never printed, file closed\n");
`endif
@ -39,6 +39,6 @@ module t;
end
$write("*-* All Finished *-*\n");
$finish;
$finish(0); // Test arguments to finish
end
endmodule