projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
985a29f
)
Do not modify design modules while iterating over `modules()`.
author
Alberto Gonzalez
<boqwxp@airmail.cc>
Fri, 10 Apr 2020 07:19:05 +0000
(07:19 +0000)
committer
Alberto Gonzalez
<boqwxp@airmail.cc>
Thu, 14 May 2020 20:06:53 +0000
(20:06 +0000)
Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
passes/techmap/techmap.cc
patch
|
blob
|
history
diff --git
a/passes/techmap/techmap.cc
b/passes/techmap/techmap.cc
index f300c2f7217509c3c346bbcae31d66fcdb546e59..930b4c41635450d109e7e0730774523d379eebbd 100644
(file)
--- a/
passes/techmap/techmap.cc
+++ b/
passes/techmap/techmap.cc
@@
-1423,11
+1423,14
@@
struct FlattenPass : public Pass {
new_used_modules.insert(cell->type);
}
+ std::set<RTLIL::Module *> to_remove;
for (auto mod : design->modules())
if (!used_modules[mod->name] && !mod->get_blackbox_attribute(worker.ignore_wb)) {
log("Deleting now unused module %s.\n", log_id(mod));
-
design->remove
(mod);
+
to_remove.insert
(mod);
}
+ for (auto mod : to_remove)
+ design->remove(mod);
}
log_pop();