aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2021-07-16 00:13:16 +0000
committerGitHub <noreply@github.com>2021-07-16 00:13:16 +0000
commitc17e385e3563e918e87a4f8bafbe290dd0911a8b (patch)
treed344c8cc504849dd12e278726c012cc67d16f89b
parenta9c8ca21d583c58a38931389f90bbaae0caec0d6 (diff)
parent54b6cb645fe7ecd492521dd05072baf9086ebdb1 (diff)
downloadyosys-c17e385e3563e918e87a4f8bafbe290dd0911a8b.tar.gz
yosys-c17e385e3563e918e87a4f8bafbe290dd0911a8b.tar.bz2
yosys-c17e385e3563e918e87a4f8bafbe290dd0911a8b.zip
Merge pull request #2870 from whitequark/cxxrtl-fix-2739
cxxrtl: mark dead local wires as unused even with inlining disabled
-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);