summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-27 15:38:02 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-27 15:38:02 +0200
commit0c86d6106c3ff4cd7628b1206281eb6080f8bf51 (patch)
treec5f0b406e7b77434b97fb704c90377892bb1b059
parentddd31a0b66259a458f7bfb3475f53c30aa859bc8 (diff)
Added SigPool::check(bit)
-rw-r--r--kernel/sigtools.h5
-rw-r--r--passes/opt/opt_clean.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/kernel/sigtools.h b/kernel/sigtools.h
index 7035db73..52e4aa0f 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 76a905b2..6c20bddb 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)