aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorAlberto Gonzalez <boqwxp@airmail.cc>2020-03-27 09:46:40 +0000
committerAlberto Gonzalez <boqwxp@airmail.cc>2020-03-27 09:46:40 +0000
commit60405939943cd812e146b84848be8bc9307702db (patch)
tree431021e7a72d9ee3c318b07538d16b60dcb5a633 /frontends
parenteb30d66d01d132f8f1fd388d4fe67aaee4e9c1c5 (diff)
downloadyosys-60405939943cd812e146b84848be8bc9307702db.tar.gz
yosys-60405939943cd812e146b84848be8bc9307702db.tar.bz2
yosys-60405939943cd812e146b84848be8bc9307702db.zip
Revert over-aggressive change to a more modest cleanup.
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/ast.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc
index 57d51fbba..46801d691 100644
--- a/frontends/ast/ast.cc
+++ b/frontends/ast/ast.cc
@@ -1456,10 +1456,12 @@ RTLIL::IdString AstModule::derive(RTLIL::Design *design, dict<RTLIL::IdString, R
RTLIL::Module* mod = design->module(modname);
// Now that the interfaces have been exploded, we can delete the dummy port related to every interface.
- pool<RTLIL::Wire*> to_remove;
for(auto &intf : interfaces) {
if(mod->wire(intf.first) != nullptr) {
+ pool<RTLIL::Wire*> to_remove;
to_remove.insert(mod->wire(intf.first));
+ mod->remove(to_remove);
+ mod->fixup_ports();
// We copy the cell of the interface to the sub-module such that it can further be found if it is propagated
// down to sub-sub-modules etc.
RTLIL::Cell * new_subcell = mod->addCell(intf.first, intf.second->name);
@@ -1469,7 +1471,6 @@ RTLIL::IdString AstModule::derive(RTLIL::Design *design, dict<RTLIL::IdString, R
log_error("No port with matching name found (%s) in %s. Stopping\n", log_id(intf.first), modname.c_str());
}
}
- mod->remove(to_remove);
mod->fixup_ports();
// If any interfaces were replaced, set the attribute 'interfaces_replaced_in_module':