aboutsummaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2021-07-15 22:27:27 +0000
committerwhitequark <whitequark@whitequark.org>2021-07-15 22:27:27 +0000
commit54b6cb645fe7ecd492521dd05072baf9086ebdb1 (patch)
tree09294ba1b8809fbd77756206352ea23e4b864dde /backends
parent1aab608cffa19332dc5cf722def7413b16f5ee54 (diff)
downloadyosys-54b6cb645fe7ecd492521dd05072baf9086ebdb1.tar.gz
yosys-54b6cb645fe7ecd492521dd05072baf9086ebdb1.tar.bz2
yosys-54b6cb645fe7ecd492521dd05072baf9086ebdb1.zip
cxxrtl: mark dead local wires as unused even with inlining disabled.
Fixes #2739.
Diffstat (limited to 'backends')
-rw-r--r--backends/cxxrtl/cxxrtl_backend.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc
index 70a3add5d..26c534bec 100644
--- a/backends/cxxrtl/cxxrtl_backend.cc
+++ b/backends/cxxrtl/cxxrtl_backend.cc
@@ -2733,12 +2733,14 @@ struct CxxrtlWorker {
for (auto wire : module->wires()) {
auto &wire_type = wire_types[wire];
if (!wire_type.is_local()) continue;
- if (!wire->name.isPublic() && !inline_internal) continue;
- if (wire->name.isPublic() && !inline_public) continue;
-
if (live_wires[wire].empty()) {
wire_type = {WireType::UNUSED}; // wire never used
- } else if (flow.is_inlinable(wire, live_wires[wire])) {
+ continue;
+ }
+
+ if (!wire->name.isPublic() && !inline_internal) continue;
+ if (wire->name.isPublic() && !inline_public) continue;
+ if (flow.is_inlinable(wire, live_wires[wire])) {
if (flow.wire_comb_defs[wire].size() > 1)
log_cmd_error("Wire %s.%s has multiple drivers!\n", log_id(module), log_id(wire));
log_assert(flow.wire_comb_defs[wire].size() == 1);