Fix handling of src attributes in flatten

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-03-10 13:55:30 +01:00
parent 3545c0fffb
commit a74f805ba0
1 changed files with 2 additions and 7 deletions

View File

@ -171,18 +171,15 @@ struct TechmapWorker
} }
std::string orig_cell_name; std::string orig_cell_name;
pool<string> extra_src_attrs; pool<string> extra_src_attrs = cell->get_strpool_attribute("\\src");
if (!flatten_mode) if (!flatten_mode) {
{
for (auto &it : tpl->cells_) for (auto &it : tpl->cells_)
if (it.first == "\\_TECHMAP_REPLACE_") { if (it.first == "\\_TECHMAP_REPLACE_") {
orig_cell_name = cell->name.str(); orig_cell_name = cell->name.str();
module->rename(cell, stringf("$techmap%d", autoidx++) + cell->name.str()); module->rename(cell, stringf("$techmap%d", autoidx++) + cell->name.str());
break; break;
} }
extra_src_attrs = cell->get_strpool_attribute("\\src");
} }
dict<IdString, IdString> memory_renames; dict<IdString, IdString> memory_renames;
@ -340,8 +337,6 @@ struct TechmapWorker
RTLIL::Cell *c = module->addCell(c_name, it.second); RTLIL::Cell *c = module->addCell(c_name, it.second);
design->select(module, c); design->select(module, c);
c->set_src_attribute(cell->get_src_attribute());
if (!flatten_mode && c->type.substr(0, 2) == "\\$") if (!flatten_mode && c->type.substr(0, 2) == "\\$")
c->type = c->type.substr(1); c->type = c->type.substr(1);