aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-08-21 13:36:01 -0700
committerEddie Hung <eddie@fpgeh.com>2019-08-21 13:36:01 -0700
commita6776ee35ee5404ca7d5b63fd2daccc46354112c (patch)
tree2925a1aa432fcb6cdb78037a9cf72dd2b803c4bd /frontends/ast
parent7d8db1c0538552d1893849ff8c9c60b2025ec267 (diff)
downloadyosys-a6776ee35ee5404ca7d5b63fd2daccc46354112c.tar.gz
yosys-a6776ee35ee5404ca7d5b63fd2daccc46354112c.tar.bz2
yosys-a6776ee35ee5404ca7d5b63fd2daccc46354112c.zip
mem2reg to preserve user attributes and src
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/simplify.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 54b9efaad..8493aa513 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -150,6 +150,10 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
reg->str = stringf("%s[%d]", node->str.c_str(), i);
reg->is_reg = true;
reg->is_signed = node->is_signed;
+ for (auto &it : node->attributes)
+ reg->attributes.emplace(it.first, it.second->clone());
+ reg->filename = node->filename;
+ reg->linenum = node->linenum;
children.push_back(reg);
while (reg->simplify(true, false, false, 1, -1, false, false)) { }
}