From e7fd8912f041462bf044b6c93aa4b4db786d01c7 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 14 May 2020 16:09:41 -0700 Subject: [PATCH 1/3] tests: attributes before task enable --- tests/verilog/task_attr.ys | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/verilog/task_attr.ys diff --git a/tests/verilog/task_attr.ys b/tests/verilog/task_attr.ys new file mode 100644 index 000000000..d6e75f85f --- /dev/null +++ b/tests/verilog/task_attr.ys @@ -0,0 +1,28 @@ +read_verilog < Date: Thu, 14 May 2020 16:10:11 -0700 Subject: [PATCH 2/3] verilog: attributes before task enable (but 13 s/r conflicts) --- frontends/verilog/verilog_parser.y | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index db9a130cf..fd4ff68a9 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -2217,23 +2217,23 @@ behavioral_stmt: defattr | assert | wire_decl | param_decl | localparam_decl | typedef_decl | non_opt_delay behavioral_stmt | simple_behavioral_stmt ';' | ';' | - hierarchical_id attr { + attr hierarchical_id { AstNode *node = new AstNode(AST_TCALL); - node->str = *$1; - delete $1; + node->str = *$2; + delete $2; ast_stack.back()->children.push_back(node); ast_stack.push_back(node); - append_attr(node, $2); + append_attr(node, $1); } opt_arg_list ';'{ ast_stack.pop_back(); } | - TOK_MSG_TASKS attr { + attr TOK_MSG_TASKS { AstNode *node = new AstNode(AST_TCALL); - node->str = *$1; - delete $1; + node->str = *$2; + delete $2; ast_stack.back()->children.push_back(node); ast_stack.push_back(node); - append_attr(node, $2); + append_attr(node, $1); } opt_arg_list ';'{ ast_stack.pop_back(); } | @@ -2330,8 +2330,6 @@ behavioral_stmt: ast_stack.pop_back(); }; - ; - unique_case_attr: /* empty */ { $$ = false; From 38e858af8d5f61677d9686c022c864857f729d58 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 21 May 2020 09:10:56 -0700 Subject: [PATCH 3/3] Update frontends/verilog/verilog_parser.y Co-authored-by: Alberto Gonzalez <61295559+boqwxp@users.noreply.github.com> --- frontends/verilog/verilog_parser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index fd4ff68a9..ae7a3f4aa 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -2216,7 +2216,7 @@ simple_behavioral_stmt: behavioral_stmt: defattr | assert | wire_decl | param_decl | localparam_decl | typedef_decl | non_opt_delay behavioral_stmt | - simple_behavioral_stmt ';' | ';' | + attr simple_behavioral_stmt ';' | ';' | attr hierarchical_id { AstNode *node = new AstNode(AST_TCALL); node->str = *$2;