From 49859393bbddfe9445757f3df0ff573c9072a594 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 24 Apr 2015 22:04:05 +0200 Subject: Improved attributes API and handling of "src" attributes --- passes/techmap/techmap.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'passes/techmap/techmap.cc') diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc index 46215e9d7..c404eb9db 100644 --- a/passes/techmap/techmap.cc +++ b/passes/techmap/techmap.cc @@ -170,7 +170,10 @@ struct TechmapWorker } std::string orig_cell_name; + pool extra_src_attrs; + if (!flatten_mode) + { for (auto &it : tpl->cells_) if (it.first == "\\_TECHMAP_REPLACE_") { orig_cell_name = cell->name.str(); @@ -178,6 +181,9 @@ struct TechmapWorker break; } + extra_src_attrs = cell->get_strpool_attribute("\\src"); + } + dict memory_renames; for (auto &it : tpl->memories) { @@ -189,6 +195,8 @@ struct TechmapWorker m->start_offset = it.second->start_offset; m->size = it.second->size; m->attributes = it.second->attributes; + if (m->attributes.count("\\src")) + m->add_strpool_attribute("\\src", extra_src_attrs); module->memories[m->name] = m; memory_renames[it.first] = m->name; design->select(module, m); @@ -207,6 +215,8 @@ struct TechmapWorker w->port_id = 0; if (it.second->get_bool_attribute("\\_techmap_special_")) w->attributes.clear(); + if (w->attributes.count("\\src")) + w->add_strpool_attribute("\\src", extra_src_attrs); design->select(module, w); } @@ -281,6 +291,9 @@ struct TechmapWorker log_assert(memory_renames.count(memid)); c->setParam("\\MEMID", Const(memory_renames[memid].str())); } + + if (c->attributes.count("\\src")) + c->add_strpool_attribute("\\src", extra_src_attrs); } for (auto &it : tpl->connections()) { -- cgit v1.2.3