diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-06-07 12:08:42 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-06-07 12:08:42 +0200 |
commit | a3bbc5365bc8ed411ab437a6baea5596531933a8 (patch) | |
tree | b4baf6d5eb444c6e462d874aa21601e5654e3c3c /frontends/verilog | |
parent | 169de05f3be779dd936ed5e0efea6a6055d5b187 (diff) | |
parent | ac10e7d96da4965751fd60a8dd42a8998c011c39 (diff) | |
download | yosys-a3bbc5365bc8ed411ab437a6baea5596531933a8.tar.gz yosys-a3bbc5365bc8ed411ab437a6baea5596531933a8.tar.bz2 yosys-a3bbc5365bc8ed411ab437a6baea5596531933a8.zip |
Merge branch 'pr_elab_sys_tasks' of https://github.com/udif/yosys into clifford/pr983
Diffstat (limited to 'frontends/verilog')
-rw-r--r-- | frontends/verilog/verilog_lexer.l | 5 | ||||
-rw-r--r-- | frontends/verilog/verilog_parser.y | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/frontends/verilog/verilog_lexer.l b/frontends/verilog/verilog_lexer.l index 9558bbfb9..3c612472d 100644 --- a/frontends/verilog/verilog_lexer.l +++ b/frontends/verilog/verilog_lexer.l @@ -311,6 +311,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; } diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index 6d3afed0e..a034f9601 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -133,7 +133,7 @@ struct specify_rise_fall { } %token <string> TOK_STRING TOK_ID TOK_CONSTVAL TOK_REALVAL TOK_PRIMITIVE -%token <string> TOK_SVA_LABEL TOK_SPECIFY_OPER +%token <string> TOK_SVA_LABEL TOK_SPECIFY_OPER TOK_ELAB_TASK %token TOK_ASSERT TOK_ASSUME TOK_RESTRICT TOK_COVER TOK_FINAL %token ATTR_BEGIN ATTR_END DEFATTR_BEGIN DEFATTR_END %token TOK_MODULE TOK_ENDMODULE TOK_PARAMETER TOK_LOCALPARAM TOK_DEFPARAM @@ -2176,6 +2176,15 @@ gen_stmt: if ($6 != NULL) delete $6; ast_stack.pop_back(); + } | + TOK_ELAB_TASK { + AstNode *node = new AstNode(AST_TECALL); + node->str = *$1; + delete $1; + ast_stack.back()->children.push_back(node); + ast_stack.push_back(node); + } opt_arg_list ';'{ + ast_stack.pop_back(); }; gen_stmt_block: |