Internals: Pass unconnected drive in parser token stream.

This commit is contained in:
Wilson Snyder 2020-06-07 12:08:12 -04:00
parent 140671300c
commit b5e4917405
2 changed files with 9 additions and 3 deletions

View File

@ -953,7 +953,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
"`noremove_gatenames" { FL_FWD; FL_BRK; } // Verilog-XL compatibility
"`noremove_netnames" { FL_FWD; FL_BRK; } // Verilog-XL compatibility
"`nosuppress_faults" { FL_FWD; FL_BRK; } // Verilog-XL compatibility
"`nounconnected_drive" { FL_FWD; PARSEP->unconnectedDrive(VOptionBool::OPT_DEFAULT_FALSE); FL_BRK; }
"`nounconnected_drive" { FL; return yaT_NOUNCONNECTED; }
"`portcoerce" { FL_FWD; FL_BRK; }
"`pragma"{ws}*[^\n\r]* { FL_FWD; FL_BRK; } // Verilog 2005
"`protect" { FL_FWD; FL_BRK; }
@ -965,8 +965,8 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
"`timescale"{ws}+[^\n\r]* { FL; PARSEP->timescalePreproc(yylval.fl,
yytext + strlen("`timescale"));
FL_BRK; }
"`unconnected_drive"{ws}+"pull0" { FL_FWD; PARSEP->unconnectedDrive(VOptionBool::OPT_FALSE); FL_BRK; }
"`unconnected_drive"{ws}+"pull1" { FL_FWD; PARSEP->unconnectedDrive(VOptionBool::OPT_TRUE); FL_BRK; }
"`unconnected_drive"{ws}+"pull0" { FL; return yaT_UNCONNECTED_PULL0; }
"`unconnected_drive"{ws}+"pull1" { FL; return yaT_UNCONNECTED_PULL1; }
"`unconnected_drive" { FL; yylval.fl->v3error("Bad `unconnected_drive syntax"); FL_BRK; }
"`uselib"{ws}+[^\n\r]* { FL_FWD; FL_BRK; } // Verilog-XL compatibility

View File

@ -401,7 +401,10 @@ class AstSenTree;
%token<strp> yaD_PLI "${pli-system}"
%token<fl> yaT_NOUNCONNECTED "`nounconnecteddrive"
%token<fl> yaT_RESETALL "`resetall"
%token<fl> yaT_UNCONNECTED_PULL0 "`unconnected_drive pull0"
%token<fl> yaT_UNCONNECTED_PULL1 "`unconnected_drive pull1"
// <fl> is the fileline, abbreviated to shorten "$<fl>1" references
%token<fl> '!'
@ -1018,6 +1021,9 @@ description: // ==IEEE: description
// unsupported // IEEE: config_declaration
// // Verilator only
| yaT_RESETALL { } // Else, under design, and illegal based on IEEE 22.3
| yaT_NOUNCONNECTED { PARSEP->unconnectedDrive(VOptionBool::OPT_DEFAULT_FALSE); }
| yaT_UNCONNECTED_PULL0 { PARSEP->unconnectedDrive(VOptionBool::OPT_FALSE); }
| yaT_UNCONNECTED_PULL1 { PARSEP->unconnectedDrive(VOptionBool::OPT_TRUE); }
| vltItem { }
| error { }
;