diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-05-27 13:24:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-27 13:24:19 +0200 |
commit | 2a9c68e2d6e0d58ac9e1ef8e8eb4c21eb979b380 (patch) | |
tree | e68672f6a6b667fc1561905ed1f0078c08cc81b7 /passes/opt | |
parent | da140dd2602a049a94473f5f262189b22e19c185 (diff) | |
parent | e3f9ccf56d65ba72dfa625e9716d1182f36a381e (diff) | |
download | yosys-2a9c68e2d6e0d58ac9e1ef8e8eb4c21eb979b380.tar.gz yosys-2a9c68e2d6e0d58ac9e1ef8e8eb4c21eb979b380.tar.bz2 yosys-2a9c68e2d6e0d58ac9e1ef8e8eb4c21eb979b380.zip |
Merge pull request #1026 from YosysHQ/clifford/fix1023
Keep zero-width wires in opt_clean if and only if they are ports
Diffstat (limited to 'passes/opt')
-rw-r--r-- | passes/opt/opt_clean.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/passes/opt/opt_clean.cc b/passes/opt/opt_clean.cc index bf8020169..7011d4602 100644 --- a/passes/opt/opt_clean.cc +++ b/passes/opt/opt_clean.cc @@ -319,8 +319,9 @@ bool rmunused_module_signals(RTLIL::Module *module, bool purge_mode, bool verbos wire->attributes.erase("\\init"); if (GetSize(wire) == 0) { - // delete zero-width wires - goto delete_this_wire; + // delete zero-width wires, unless they are module ports + if (wire->port_id == 0) + goto delete_this_wire; } else 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 |