summaryrefslogtreecommitdiff
path: root/passes/cmds/delete.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-25 15:05:18 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-25 17:56:19 +0200
commit2bec47a4045d23d46e7d300cbf80b2dce1a549a9 (patch)
tree991a75afe9b009486a57834fefee075ec695a28c /passes/cmds/delete.cc
parent5826670009e1018734de49aaf1554cb8a43d09d7 (diff)
Use only module->addCell() and module->remove() to create and delete cells
Diffstat (limited to 'passes/cmds/delete.cc')
-rw-r--r--passes/cmds/delete.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/passes/cmds/delete.cc b/passes/cmds/delete.cc
index 7fe95b0a..79b7c3c3 100644
--- a/passes/cmds/delete.cc
+++ b/passes/cmds/delete.cc
@@ -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) {