Fixed brojen $error()/$info/$warning() on non-generate blocks
authorUdi Finkelstein <github@udifink.com>
Mon, 10 Jun 2019 23:52:06 +0000 (02:52 +0300)
committerUdi Finkelstein <github@udifink.com>
Mon, 10 Jun 2019 23:52:06 +0000 (02:52 +0300)
(within always/initial blocks)

frontends/verilog/verilog_lexer.l
frontends/verilog/verilog_parser.y

index 3c612472dbbf8472ae12d0eed95ca325dc628a23..d3fd91473a8c145d10af4c3e24b1775206e50949 100644 (file)
@@ -313,7 +313,7 @@ supply1 { return TOK_SUPPLY1; }
 
 "$"(info|warning|error|fatal) {
        frontend_verilog_yylval.string = new std::string(yytext);
-       return TOK_ELAB_TASK;
+       return TOK_MSG_TASKS;
 }
 
 "$signed"   { return TOK_TO_SIGNED; }
index a034f960155ca59728729150c59dae164650584b..ea8e457e822271da2129157b743e6daa95d4df4d 100644 (file)
@@ -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 TOK_ELAB_TASK
+%token <string> TOK_SVA_LABEL TOK_SPECIFY_OPER TOK_MSG_TASKS
 %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
@@ -1881,6 +1881,16 @@ behavioral_stmt:
        } opt_arg_list ';'{
                ast_stack.pop_back();
        } |
+       TOK_MSG_TASKS attr {
+               AstNode *node = new AstNode(AST_TCALL);
+               node->str = *$1;
+               delete $1;
+               ast_stack.back()->children.push_back(node);
+               ast_stack.push_back(node);
+               append_attr(node, $2);
+       } opt_arg_list ';'{
+               ast_stack.pop_back();
+       } |
        attr TOK_BEGIN opt_label {
                AstNode *node = new AstNode(AST_BLOCK);
                ast_stack.back()->children.push_back(node);
@@ -2177,7 +2187,7 @@ gen_stmt:
                        delete $6;
                ast_stack.pop_back();
        } |
-       TOK_ELAB_TASK {
+       TOK_MSG_TASKS {
                AstNode *node = new AstNode(AST_TECALL);
                node->str = *$1;
                delete $1;