172 if (cell->
type.
in(
"$mux",
"$pmux"))
181 if (cell->
type.
in(
"$not",
"$pos",
"$neg",
"$and",
"$or",
"$xor",
"$add",
"$sub")) {
182 max_port_a_size = std::min(max_port_a_size,
GetSize(cell->
getPort(
"\\Y")));
183 max_port_b_size = std::min(max_port_b_size,
GetSize(cell->
getPort(
"\\Y")));
186 bool port_a_signed =
false;
187 bool port_b_signed =
false;
189 if (max_port_a_size >= 0 && cell->
type !=
"$shiftx")
192 if (max_port_b_size >= 0)
200 int bits_removed = 0;
201 if (port_a_signed && cell->
type ==
"$shr") {
208 if (info->is_output ||
GetSize(info->ports) > 1)
216 if (cell->
type.
in(
"$pos",
"$add",
"$mul",
"$and",
"$or",
"$xor"))
220 int a_size = 0, b_size = 0;
224 int max_y_size = std::max(a_size, b_size);
226 if (cell->
type ==
"$add")
229 if (cell->
type ==
"$mul")
230 max_y_size = a_size + b_size;
246 log(
"Removed top %d bits (of %d) from port Y of cell %s.%s (%s).\n",
249 did_something =
true;
void fixup_parameters(bool set_a_signed=false, bool set_b_signed=false)
void setPort(RTLIL::IdString portname, RTLIL::SigSpec signal)
void remove(const RTLIL::SigSpec &pattern)
bool in(T first, Args...rest)
USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN bool did_something
std::set< IdString > supported_cell_types
void connect(const RTLIL::SigSig &conn)
RTLIL_ATTRIBUTE_MEMBERS bool hasPort(RTLIL::IdString portname) const
void run_cell(Cell *cell)
const RTLIL::SigSpec & getPort(RTLIL::IdString portname) const
int GetSize(RTLIL::Wire *wire)
SigBitInfo * query(RTLIL::SigBit bit)
void run_cell_mux(Cell *cell)
void run_reduce_inport(Cell *cell, char port, int max_port_size, bool &port_signed, bool &did_something)
void remove(const std::set< RTLIL::Wire * > &wires)
void log(const char *format,...)
const RTLIL::Const & getParam(RTLIL::IdString paramname) const
const char * log_id(RTLIL::IdString str)