From 0c86d6106c3ff4cd7628b1206281eb6080f8bf51 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 27 Jul 2014 15:38:02 +0200 Subject: [PATCH] Added SigPool::check(bit) --- kernel/sigtools.h | 5 +++++ passes/opt/opt_clean.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sigtools.h b/kernel/sigtools.h index 7035db73d..52e4aa0fb 100644 --- a/kernel/sigtools.h +++ b/kernel/sigtools.h @@ -93,6 +93,11 @@ struct SigPool return result; } + bool check(RTLIL::SigBit bit) + { + return bit.wire != NULL && bits.count(bit); + } + bool check_any(RTLIL::SigSpec sig) { for (auto &bit : sig) diff --git a/passes/opt/opt_clean.cc b/passes/opt/opt_clean.cc index 76a905b2c..6c20bddbb 100644 --- a/passes/opt/opt_clean.cc +++ b/passes/opt/opt_clean.cc @@ -251,10 +251,10 @@ static void rmunused_module_signals(RTLIL::Module *module, bool purge_mode, bool for (int i = 0; i < SIZE(sig); i++) { if (sig[i].wire == NULL) continue; - if (!used_signals_nodrivers.check_any(sig[i])) { + if (!used_signals_nodrivers.check(sig[i])) { if (!unused_bits.empty()) unused_bits += " "; - unused_bits += stringf("%zd", i); + unused_bits += stringf("%d", i); } } if (unused_bits.empty() || wire->port_id != 0) -- 2.30.2