69 #define X(_name) _name = 0;
73 for (
auto &it : mod->
wires_)
75 if (!design->
selected(mod, it.second))
78 if (it.first[0] ==
'\\') {
80 num_pub_wire_bits += it.second->width;
84 num_wire_bits += it.second->width;
88 if (!design->
selected(mod, it.second))
91 num_memory_bits += it.second->width * it.second->size;
94 for (
auto &it : mod->
cells_)
96 if (!design->
selected(mod, it.second))
103 if (cell_type.
in(
"$not",
"$pos",
"$neg",
104 "$logic_not",
"$logic_and",
"$logic_or",
105 "$reduce_and",
"$reduce_or",
"$reduce_xor",
"$reduce_xnor",
"$reduce_bool",
106 "$lut",
"$and",
"$or",
"$xor",
"$xnor",
107 "$shl",
"$shr",
"$sshl",
"$sshr",
"$shift",
"$shiftx",
108 "$lt",
"$le",
"$eq",
"$ne",
"$eqx",
"$nex",
"$ge",
"$gt",
109 "$add",
"$sub",
"$mul",
"$div",
"$mod",
"$pow")) {
110 int width_a = it.second->hasPort(
"\\A") ?
GetSize(it.second->getPort(
"\\A")) : 0;
111 int width_b = it.second->hasPort(
"\\B") ?
GetSize(it.second->getPort(
"\\B")) : 0;
112 int width_y = it.second->hasPort(
"\\Y") ?
GetSize(it.second->getPort(
"\\Y")) : 0;
113 cell_type =
stringf(
"%s_%d", cell_type.c_str(), std::max<int>({width_a, width_b, width_y}));
115 else if (cell_type.
in(
"$mux",
"$pmux"))
117 else if (cell_type.
in(
"$sr",
"$dff",
"$dffsr",
"$adff",
"$dlatch",
"$dlatchsr"))
126 if (!design->
selected(mod, it.second))
const char * c_str() const
bool selected(T1 *module) const
std::string stringf(const char *fmt,...)
std::map< RTLIL::IdString, RTLIL::Wire * > wires_
std::map< RTLIL::IdString, RTLIL::Memory * > memories
bool in(T first, Args...rest)
int GetSize(RTLIL::Wire *wire)
STAT_INT_MEMBERS std::map< RTLIL::IdString, int, RTLIL::sort_by_id_str > num_cells_by_type
std::map< RTLIL::IdString, RTLIL::Process * > processes
std::map< RTLIL::IdString, RTLIL::Cell * > cells_