aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-04-30 17:20:30 +0200
committerClifford Wolf <clifford@clifford.at>2017-04-30 17:20:30 +0200
commite91548b33e62169f73ee132dd174ea99a22135db (patch)
tree4d961a642b77d84d561f4d2be53bdab91054350e
parent3bbac5c1414e3b59b8d965711f2f424aff3c762a (diff)
downloadyosys-e91548b33e62169f73ee132dd174ea99a22135db.tar.gz
yosys-e91548b33e62169f73ee132dd174ea99a22135db.tar.bz2
yosys-e91548b33e62169f73ee132dd174ea99a22135db.zip
Add support for localparam in module header
-rw-r--r--frontends/verilog/verilog_parser.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y
index e84250146..26201d618 100644
--- a/frontends/verilog/verilog_parser.y
+++ b/frontends/verilog/verilog_parser.y
@@ -272,7 +272,13 @@ single_module_para:
if (astbuf1) delete astbuf1;
astbuf1 = new AstNode(AST_PARAMETER);
astbuf1->children.push_back(AstNode::mkconst_int(0, true));
- } param_signed param_integer param_range single_param_decl | single_param_decl;
+ } param_signed param_integer param_range single_param_decl |
+ TOK_LOCALPARAM {
+ if (astbuf1) delete astbuf1;
+ astbuf1 = new AstNode(AST_LOCALPARAM);
+ astbuf1->children.push_back(AstNode::mkconst_int(0, true));
+ } param_signed param_integer param_range single_param_decl |
+ single_param_decl;
module_args_opt:
'(' ')' | /* empty */ | '(' module_args optional_comma ')';