Added SigPool::check(bit)
authorClifford Wolf <clifford@clifford.at>
Sun, 27 Jul 2014 13:38:02 +0000 (15:38 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 27 Jul 2014 13:38:02 +0000 (15:38 +0200)
kernel/sigtools.h
passes/opt/opt_clean.cc

index 7035db73dd21e09bd161c1a2ae685088e82f33b2..52e4aa0fb453ce56cf1b3b2c678d6e1e19c88329 100644 (file)
@@ -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)
index 76a905b2c8685d8a36675b869f9632bca80c6da1..6c20bddbbfd5589d12de67401262d6f4336bda10 100644 (file)
@@ -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)