Merge branch 'master' into struct
authorPeter Crozier <peter@crozier.com>
Wed, 3 Jun 2020 16:19:28 +0000 (17:19 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Jun 2020 16:19:28 +0000 (17:19 +0100)
1  2 
frontends/ast/genrtlil.cc
frontends/ast/simplify.cc
frontends/verilog/verilog_lexer.l
frontends/verilog/verilog_parser.y

Simple merge
Simple merge
Simple merge
index e72d09524d251de8c67b562f19e1c34b6f6a8dc0,c8223f41d5d6f9c06a81ca889eb507c8717e42ac..c4867356c7e4b730bde7fa82b1a92b6cd0b0e38d
@@@ -885,8 -841,31 +885,20 @@@ task_func_port
                }
                albuf = $1;
                astbuf1 = $2;
 -              astbuf2 = $3;
 -              if (astbuf1->range_left >= 0 && astbuf1->range_right >= 0) {
 -                      if (astbuf2) {
 -                              frontend_verilog_yyerror("integer/genvar types cannot have packed dimensions (task/function arguments)");
 -                      } else {
 -                              astbuf2 = new AstNode(AST_RANGE);
 -                              astbuf2->children.push_back(AstNode::mkconst_int(astbuf1->range_left, true));
 -                              astbuf2->children.push_back(AstNode::mkconst_int(astbuf1->range_right, true));
 -                      }
 -              }
 -              if (astbuf2 && astbuf2->children.size() != 2)
 -                      frontend_verilog_yyerror("task/function argument range must be of the form: [<expr>:<expr>], [<expr>+:<expr>], or [<expr>-:<expr>]");
 +              astbuf2 = checkRange(astbuf1, $3);
-       } wire_name | wire_name;
+       } wire_name |
+       {
+               if (!astbuf1) {
+                       if (!sv_mode)
+                               frontend_verilog_yyerror("task/function argument direction missing");
+                       albuf = new dict<IdString, AstNode*>;
+                       astbuf1 = new AstNode(AST_WIRE);
+                       current_wire_rand = false;
+                       current_wire_const = false;
+                       astbuf1->is_input = true;
+                       astbuf2 = NULL;
+               }
+       } wire_name;
  
  task_func_body:
        task_func_body behavioral_stmt |