#include "kernel/yosys.h"
#include "kernel/sigtools.h"
#include <string>
#include <map>
#include <set>
Go to the source code of this file.
Definition at line 19 of file stubnets.cc.
25 std::map<RTLIL::SigBit, int> bit_usage_count;
33 for (
auto &cell_iter : module->
cells_)
34 for (
auto &conn : cell_iter.second->connections())
43 bit_usage_count[bit]++;
47 for (
auto &wire_iter : module->
wires_)
56 int usage_offset = wire->
port_id > 0 ? 1 : 0;
59 std::set<int> stub_bits;
66 for (
int i = 0; i <
GetSize(sig); i++)
67 if (sig[i].wire !=
NULL && (bit_usage_count[sig[i]] + usage_offset) < 2)
71 if (stub_bits.size() == 0)
82 for (
int bit : stub_bits)
83 log(
"%s%d", bit == *stub_bits.begin() ?
"" :
", ", bit);
93 log(
" found %d stub wires or wires with stub bits.\n", line_count);
95 log(
" found %d stub wires.\n", line_count);
bool selected(T1 *module) const
std::map< RTLIL::IdString, RTLIL::Wire * > wires_
int GetSize(RTLIL::Wire *wire)
static const char * id2cstr(const RTLIL::IdString &str)
std::map< RTLIL::IdString, RTLIL::Cell * > cells_
void log(const char *format,...)