aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap/abc9.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-09-29 19:39:12 -0700
committerEddie Hung <eddie@fpgeh.com>2019-09-29 19:39:12 -0700
commit1123c09588a6dd3964605de229c6bc4ac158b50e (patch)
tree6f6b950cfc30c4db0963a90fe065964489fa292b /passes/techmap/abc9.cc
parent18ebb86edbade4a94833dead59d69fddd980f5bd (diff)
parentd5f0794a531b36976d2c4d181b1c3921b801bbfa (diff)
downloadyosys-1123c09588a6dd3964605de229c6bc4ac158b50e.tar.gz
yosys-1123c09588a6dd3964605de229c6bc4ac158b50e.tar.bz2
yosys-1123c09588a6dd3964605de229c6bc4ac158b50e.zip
Merge remote-tracking branch 'origin/master' into xaig_dff
Diffstat (limited to 'passes/techmap/abc9.cc')
-rw-r--r--passes/techmap/abc9.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/passes/techmap/abc9.cc b/passes/techmap/abc9.cc
index ce27f7eea..1847186bf 100644
--- a/passes/techmap/abc9.cc
+++ b/passes/techmap/abc9.cc
@@ -553,7 +553,6 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *current_module, std::stri
existing_cell = module->cell(mapped_cell->name);
log_assert(existing_cell);
cell = module->addCell(remap_name(mapped_cell->name), mapped_cell->type);
- module->swap_names(cell, existing_cell);
}
if (markgroups) cell->attributes[ID(abcgroup)] = map_autoidx;
@@ -594,8 +593,22 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *current_module, std::stri
}
}
- for (auto cell : boxes)
- module->remove(cell);
+ for (auto existing_cell : boxes) {
+ Cell *cell = module->cell(remap_name(existing_cell->name));
+ if (cell) {
+ for (auto &conn : existing_cell->connections()) {
+ if (!conn.second.is_wire())
+ continue;
+ Wire *wire = conn.second.as_wire();
+ if (!wire->get_bool_attribute(ID(abc_padding)))
+ continue;
+ cell->unsetPort(conn.first);
+ log_debug("Dropping padded port connection for %s (%s) .%s (%s )\n", log_id(cell), cell->type.c_str(), log_id(conn.first), log_signal(conn.second));
+ }
+ module->swap_names(cell, existing_cell);
+ }
+ module->remove(existing_cell);
+ }
// Copy connections (and rename) from mapped_mod to module
for (auto conn : mapped_mod->connections()) {