diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-04-24 22:04:05 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-04-24 22:04:05 +0200 |
commit | 49859393bbddfe9445757f3df0ff573c9072a594 (patch) | |
tree | b6aa1b32b1ae03c5427fcf3463c11ad274848568 /passes/techmap/techmap.cc | |
parent | 687f5a5b12b41c4e26c9e5b8d3815c268a7ff7be (diff) | |
download | yosys-49859393bbddfe9445757f3df0ff573c9072a594.tar.gz yosys-49859393bbddfe9445757f3df0ff573c9072a594.tar.bz2 yosys-49859393bbddfe9445757f3df0ff573c9072a594.zip |
Improved attributes API and handling of "src" attributes
Diffstat (limited to 'passes/techmap/techmap.cc')
-rw-r--r-- | passes/techmap/techmap.cc | 13 |
1 files changed, 13 insertions, 0 deletions
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<string> 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<IdString, IdString> 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()) { |