3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-24 14:53:42 +00:00

Use only module->addCell() and module->remove() to create and delete cells

This commit is contained in:
Clifford Wolf 2014-07-25 15:05:18 +02:00
parent 5826670009
commit 2bec47a404
35 changed files with 259 additions and 582 deletions

View file

@ -107,7 +107,7 @@ struct DeletePass : public Pass {
}
std::set<std::string> delete_wires;
std::set<std::string> delete_cells;
std::set<RTLIL::Cell*> delete_cells;
std::set<std::string> delete_procs;
std::set<std::string> delete_mems;
@ -121,10 +121,10 @@ struct DeletePass : public Pass {
for (auto &it : module->cells) {
if (design->selected(module, it.second))
delete_cells.insert(it.first);
delete_cells.insert(it.second);
if ((it.second->type == "$memrd" || it.second->type == "$memwr") &&
delete_mems.count(it.second->parameters.at("\\MEMID").decode_string()) != 0)
delete_cells.insert(it.first);
delete_cells.insert(it.second);
}
for (auto &it : module->processes)
@ -147,8 +147,7 @@ struct DeletePass : public Pass {
}
for (auto &it : delete_cells) {
delete module->cells.at(it);
module->cells.erase(it);
module->remove(it);
}
for (auto &it : delete_procs) {