aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/verilog/verilog_lexer.l
diff options
context:
space:
mode:
authorUdi Finkelstein <github@udifink.com>2019-05-03 03:10:43 +0300
committerUdi Finkelstein <github@udifink.com>2019-05-03 03:10:43 +0300
commitac10e7d96da4965751fd60a8dd42a8998c011c39 (patch)
tree88926f01f42afee890ad8bed010977ce4b95a126 /frontends/verilog/verilog_lexer.l
parent98925f6c4be611434e75f0ccf645a7ef8adcfc63 (diff)
downloadyosys-ac10e7d96da4965751fd60a8dd42a8998c011c39.tar.gz
yosys-ac10e7d96da4965751fd60a8dd42a8998c011c39.tar.bz2
yosys-ac10e7d96da4965751fd60a8dd42a8998c011c39.zip
Initial implementation of elaboration system tasks
(IEEE1800-2017 section 20.11) This PR allows us to use $info/$warning/$error/$fatal **at elaboration time** within a generate block. This is very useful to stop a synthesis of a parametrized block when an illegal combination of parameters is chosen.
Diffstat (limited to 'frontends/verilog/verilog_lexer.l')
-rw-r--r--frontends/verilog/verilog_lexer.l5
1 files changed, 5 insertions, 0 deletions
diff --git a/frontends/verilog/verilog_lexer.l b/frontends/verilog/verilog_lexer.l
index 6ef38252a..1c6810b47 100644
--- a/frontends/verilog/verilog_lexer.l
+++ b/frontends/verilog/verilog_lexer.l
@@ -301,6 +301,11 @@ supply1 { return TOK_SUPPLY1; }
return TOK_ID;
}
+"$"(info|warning|error|fatal) {
+ frontend_verilog_yylval.string = new std::string(yytext);
+ return TOK_ELAB_TASK;
+}
+
"$signed" { return TOK_TO_SIGNED; }
"$unsigned" { return TOK_TO_UNSIGNED; }