aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-09-23 07:56:17 +0200
committerClifford Wolf <clifford@clifford.at>2015-09-23 07:56:17 +0200
commit089c1e176f8f0e6a38cecaadf2381bdd34e74518 (patch)
tree3e26e194865046e62e6e26703757a426fdec31b4 /frontends/ast
parent559929e341a9416ab68ce1d0ef94068cd57512f9 (diff)
downloadyosys-089c1e176f8f0e6a38cecaadf2381bdd34e74518.tar.gz
yosys-089c1e176f8f0e6a38cecaadf2381bdd34e74518.tar.bz2
yosys-089c1e176f8f0e6a38cecaadf2381bdd34e74518.zip
Bugfix in handling of multi-dimensional memories
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/simplify.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 2abb48a58..d9a466e04 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -760,10 +760,10 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
if (i == 0)
index_expr = new_index_expr;
else
- index_expr = new AstNode(AST_ADD, new AstNode(AST_MUL, index_expr, AstNode::mkconst_int(id2ast->multirange_dimensions[2*i-1], true)), new_index_expr);
+ index_expr = new AstNode(AST_ADD, new AstNode(AST_MUL, index_expr, AstNode::mkconst_int(id2ast->multirange_dimensions[2*i+1], true)), new_index_expr);
}
- for (int i = GetSize(id2ast->multirange_dimensions)/1; i < GetSize(children[0]->children); i++)
+ for (int i = GetSize(id2ast->multirange_dimensions)/2; i < GetSize(children[0]->children); i++)
children.push_back(children[0]->children[i]->clone());
delete children[0];