summaryrefslogtreecommitdiff
path: root/frontends/verilog
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-11-20 10:51:32 +0100
committerClifford Wolf <clifford@clifford.at>2013-11-20 10:51:32 +0100
commit19dba2561ece488543e1728ba800386943abb77c (patch)
tree1388ba1895b2caba3f832ac0646c1224cfe1e619 /frontends/verilog
parentd248419fe0ec1f35d2f18b4f4aaf2c9525588fac (diff)
Implemented part/bit select on memory read
Diffstat (limited to 'frontends/verilog')
-rw-r--r--frontends/verilog/parser.y14
1 files changed, 12 insertions, 2 deletions
diff --git a/frontends/verilog/parser.y b/frontends/verilog/parser.y
index 24c84514..c4f386ce 100644
--- a/frontends/verilog/parser.y
+++ b/frontends/verilog/parser.y
@@ -105,7 +105,7 @@ static void free_attr(std::map<std::string, AstNode*> *al)
%token TOK_SYNOPSYS_FULL_CASE TOK_SYNOPSYS_PARALLEL_CASE
%token TOK_SUPPLY0 TOK_SUPPLY1 TOK_TO_SIGNED TOK_TO_UNSIGNED
-%type <ast> wire_type range expr basic_expr concat_list rvalue lvalue lvalue_concat_list
+%type <ast> wire_type range non_opt_range expr basic_expr concat_list rvalue lvalue lvalue_concat_list
%type <string> opt_label tok_prim_wrapper hierarchical_id
%type <boolean> opt_signed
%type <al> attr
@@ -330,7 +330,7 @@ wire_type_token:
astbuf3->is_signed = true;
};
-range:
+non_opt_range:
'[' expr ':' expr ']' {
$$ = new AstNode(AST_RANGE);
$$->children.push_back($2);
@@ -339,6 +339,11 @@ range:
'[' expr ']' {
$$ = new AstNode(AST_RANGE);
$$->children.push_back($2);
+ };
+
+range:
+ non_opt_range {
+ $$ = $1;
} |
/* empty */ {
$$ = NULL;
@@ -893,6 +898,11 @@ rvalue:
$$ = new AstNode(AST_IDENTIFIER, $2);
$$->str = *$1;
delete $1;
+ } |
+ hierarchical_id non_opt_range non_opt_range {
+ $$ = new AstNode(AST_IDENTIFIER, $2, $3);
+ $$->str = *$1;
+ delete $1;
};
lvalue: