aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-02-01 02:14:19 -0800
committerEddie Hung <eddie@fpgeh.com>2020-02-01 02:14:19 -0800
commit136842b1ef18b850b518705ff3e6df3958f28e0c (patch)
treeabcdddaf53bafd5e34e9aa278ffbe3d001b60cc4 /frontends/ast
parent705e520a527864dc32f1934bb4b2b94d75f8f0ec (diff)
parenta1c840ca5d6e8b580e21ae48550570aa9665741a (diff)
downloadyosys-136842b1ef18b850b518705ff3e6df3958f28e0c.tar.gz
yosys-136842b1ef18b850b518705ff3e6df3958f28e0c.tar.bz2
yosys-136842b1ef18b850b518705ff3e6df3958f28e0c.zip
Merge branch 'master' into eddie/submod_po
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/simplify.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 44fd32cdc..b94a8d710 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -1198,6 +1198,14 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
varbuf = new AstNode(AST_LOCALPARAM, varbuf);
varbuf->str = init_ast->children[0]->str;
+ auto resolved = current_scope.at(init_ast->children[0]->str);
+ if (resolved->range_valid) {
+ varbuf->range_left = resolved->range_left;
+ varbuf->range_right = resolved->range_right;
+ varbuf->range_swapped = resolved->range_swapped;
+ varbuf->range_valid = resolved->range_valid;
+ }
+
AstNode *backup_scope_varbuf = current_scope[varbuf->str];
current_scope[varbuf->str] = varbuf;
@@ -2998,6 +3006,14 @@ void AstNode::expand_genblock(std::string index_var, std::string prefix, std::ma
current_ast_mod->children.push_back(p);
str = p->str;
id2ast = p;
+
+ auto resolved = current_scope.at(index_var);
+ if (resolved->range_valid) {
+ p->range_left = resolved->range_left;
+ p->range_right = resolved->range_right;
+ p->range_swapped = resolved->range_swapped;
+ p->range_valid = resolved->range_valid;
+ }
}
}