Support free-form `(end)cell_define and `reset_all directives.
Also use VLerror for reporting errors.
This commit is contained in:
parent
0dc64b99f3
commit
52f269649a
|
|
@ -0,0 +1,22 @@
|
||||||
|
// This is just a syntax test.
|
||||||
|
|
||||||
|
/* comment */ `resetall /* comment */ // comment
|
||||||
|
/* comment */ `celldefine /* comment */ // comment
|
||||||
|
module cell1;
|
||||||
|
endmodule
|
||||||
|
/* comment */ `endcelldefine /* comment */ // comment
|
||||||
|
|
||||||
|
/* comment */`resetall/*
|
||||||
|
comment */
|
||||||
|
/* comment */`celldefine/*
|
||||||
|
comment */
|
||||||
|
module cell2;
|
||||||
|
endmodule
|
||||||
|
/* comment */`endcelldefine/*
|
||||||
|
comment */
|
||||||
|
|
||||||
|
module test;
|
||||||
|
|
||||||
|
initial $display("PASSED");
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
@ -350,6 +350,7 @@ br_gh632c normal ivltests
|
||||||
br_gh674 normal ivltests
|
br_gh674 normal ivltests
|
||||||
br_gh732 normal ivltests gold=br_gh732.gold
|
br_gh732 normal ivltests gold=br_gh732.gold
|
||||||
br_gh782c normal ivltests
|
br_gh782c normal ivltests
|
||||||
|
br_gh782d normal ivltests
|
||||||
br_gh788 normal,-gno-io-range-error,-Wno-anachronisms ivltests gold=br_gh788.gold
|
br_gh788 normal,-gno-io-range-error,-Wno-anachronisms ivltests gold=br_gh788.gold
|
||||||
br_gh793 normal ivltests
|
br_gh793 normal ivltests
|
||||||
br_ml20150315 normal ivltests gold=br_ml_20150315.gold
|
br_ml20150315 normal ivltests gold=br_ml_20150315.gold
|
||||||
|
|
|
||||||
18
lexor.lex
18
lexor.lex
|
|
@ -640,22 +640,18 @@ TU [munpf]
|
||||||
|
|
||||||
/* Notice and handle the `celldefine and `endcelldefine directives. */
|
/* Notice and handle the `celldefine and `endcelldefine directives. */
|
||||||
|
|
||||||
^{W}?`celldefine{W}? { in_celldefine = true; }
|
`celldefine { in_celldefine = true; }
|
||||||
^{W}?`endcelldefine{W}? { in_celldefine = false; }
|
`endcelldefine { in_celldefine = false; }
|
||||||
|
|
||||||
/* Notice and handle the resetall directive. */
|
/* Notice and handle the resetall directive. */
|
||||||
|
|
||||||
^{W}?`resetall{W}? {
|
`resetall {
|
||||||
if (in_module) {
|
if (in_module) {
|
||||||
cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
|
VLerror(yylloc, "error: `resetall directive cannot be inside a "
|
||||||
"`resetall directive can not be inside a module "
|
"module definition.");
|
||||||
"definition." << endl;
|
|
||||||
error_count += 1;
|
|
||||||
} else if (in_UDP) {
|
} else if (in_UDP) {
|
||||||
cerr << yylloc.text << ":" << yylloc.first_line << ": error: "
|
VLerror(yylloc, "error: `resetall directive cannot be inside a "
|
||||||
"`resetall directive can not be inside a UDP "
|
"UDP definition.");
|
||||||
"definition." << endl;
|
|
||||||
error_count += 1;
|
|
||||||
} else {
|
} else {
|
||||||
reset_all();
|
reset_all();
|
||||||
} }
|
} }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue