aboutsummaryrefslogtreecommitdiffstats
path: root/passes/opt/opt_clean.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-06-26 17:54:17 +0200
committerClifford Wolf <clifford@clifford.at>2019-06-26 17:54:17 +0200
commit0b7d648c6a71594f8a17e78aef8f62b6f6448390 (patch)
tree8db2ada1fd751b8fc0b44a1f59f91666f68f5289 /passes/opt/opt_clean.cc
parent1b49380f6bd79cb037fb36a3d06adf386968dc47 (diff)
downloadyosys-0b7d648c6a71594f8a17e78aef8f62b6f6448390.tar.gz
yosys-0b7d648c6a71594f8a17e78aef8f62b6f6448390.tar.bz2
yosys-0b7d648c6a71594f8a17e78aef8f62b6f6448390.zip
Improve opt_clean handling of unused public wires
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'passes/opt/opt_clean.cc')
-rw-r--r--passes/opt/opt_clean.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/passes/opt/opt_clean.cc b/passes/opt/opt_clean.cc
index 5f75288e2..a8a8e0bc7 100644
--- a/passes/opt/opt_clean.cc
+++ b/passes/opt/opt_clean.cc
@@ -326,8 +326,8 @@ bool rmunused_module_signals(RTLIL::Module *module, bool purge_mode, bool verbos
if (wire->port_id != 0 || wire->get_bool_attribute("\\keep") || !initval.is_fully_undef()) {
// do not delete anything with "keep" or module ports or initialized wires
} else
- if (!purge_mode && check_public_name(wire->name)) {
- // do not get rid of public names unless in purge mode
+ if (!purge_mode && check_public_name(wire->name) && (raw_used_signals.check_any(s1) || used_signals.check_any(s2) || s1 != s2)) {
+ // do not get rid of public names unless in purge mode or if the wire is entirely unused, not even aliased
} else
if (!raw_used_signals.check_any(s1)) {
// delete wires that aren't used by anything directly