aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-06-29 23:14:13 +0000
committerwhitequark <whitequark@whitequark.org>2020-06-29 23:14:13 +0000
commita97c13f0cab8ce7b30a171676ce2752caf37487c (patch)
tree1969914d31b49060ceb5ac0d7240e29762221845
parent4160acc0b19532d50435abbc66bd2f6aab9473b6 (diff)
downloadyosys-a97c13f0cab8ce7b30a171676ce2752caf37487c.tar.gz
yosys-a97c13f0cab8ce7b30a171676ce2752caf37487c.tar.bz2
yosys-a97c13f0cab8ce7b30a171676ce2752caf37487c.zip
techmap: don't drop attributes on replaced cells.
This was introduced in 76c4ee4ea5cb6a3dc214f66237af22a1bedda010. Fixes #2204.
-rw-r--r--passes/techmap/techmap.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc
index 1cee51d06..f98d1564a 100644
--- a/passes/techmap/techmap.cc
+++ b/passes/techmap/techmap.cc
@@ -328,8 +328,9 @@ struct TechmapWorker
for (auto tpl_cell : tpl->cells())
{
IdString c_name = tpl_cell->name;
+ bool techmap_replace_cell = (c_name == ID::_TECHMAP_REPLACE_);
- if (c_name == ID::_TECHMAP_REPLACE_)
+ if (techmap_replace_cell)
c_name = orig_cell_name;
else if (tpl_cell->name.begins_with("\\_TECHMAP_REPLACE_."))
c_name = stringf("%s%s", orig_cell_name.c_str(), c_name.c_str() + strlen("\\_TECHMAP_REPLACE_"));
@@ -384,7 +385,7 @@ struct TechmapWorker
if (c->attributes.count(ID::src))
c->add_strpool_attribute(ID::src, extra_src_attrs);
- if (c_name == ID::_TECHMAP_REPLACE_)
+ if (techmap_replace_cell)
for (auto attr : cell->attributes)
if (!c->attributes.count(attr.first))
c->attributes[attr.first] = attr.second;