From a74f805ba0e3d1611d0a9904ab3a66c5d7bd38f3 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 10 Mar 2018 13:55:30 +0100 Subject: [PATCH] Fix handling of src attributes in flatten Signed-off-by: Clifford Wolf --- passes/techmap/techmap.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc index d7756e2cd..02d0d47e8 100644 --- a/passes/techmap/techmap.cc +++ b/passes/techmap/techmap.cc @@ -171,18 +171,15 @@ struct TechmapWorker } std::string orig_cell_name; - pool extra_src_attrs; + pool extra_src_attrs = cell->get_strpool_attribute("\\src"); - if (!flatten_mode) - { + if (!flatten_mode) { for (auto &it : tpl->cells_) if (it.first == "\\_TECHMAP_REPLACE_") { orig_cell_name = cell->name.str(); module->rename(cell, stringf("$techmap%d", autoidx++) + cell->name.str()); break; } - - extra_src_attrs = cell->get_strpool_attribute("\\src"); } dict memory_renames; @@ -340,8 +337,6 @@ struct TechmapWorker RTLIL::Cell *c = module->addCell(c_name, it.second); design->select(module, c); - c->set_src_attribute(cell->get_src_attribute()); - if (!flatten_mode && c->type.substr(0, 2) == "\\$") c->type = c->type.substr(1); -- 2.30.2