case AST_TO_UNSIGNED: {
RTLIL::SigSpec sig = children[0]->genRTLIL();
if (sig.width < width_hint)
- sig.extend(width_hint, sign_hint);
+ sig.extend_u0(width_hint, sign_hint);
is_signed = sign_hint;
return sig;
}
}
}
if (sig.width < width_hint)
- sig.extend(width_hint, false);
+ sig.extend_u0(width_hint, false);
return sig;
}
for (int i = 0; i < count; i++)
sig.append(right);
if (sig.width < width_hint)
- sig.extend(width_hint, false);
+ sig.extend_u0(width_hint, false);
is_signed = false;
return sig;
}
widthExtend(this, val1, width, is_signed);
widthExtend(this, val2, width, is_signed);
- return mux2rtlil(this, cond, val1, val2);
+ RTLIL::SigSpec sig = mux2rtlil(this, cond, val1, val2);
+
+ if (sig.width < width_hint)
+ sig.extend_u0(width_hint, sign_hint);
+ return sig;
}
// generate $memrd cells for memory read ports
optimize();
}
-void RTLIL::SigSpec::extend_un0(int width, bool is_signed)
+void RTLIL::SigSpec::extend_u0(int width, bool is_signed)
{
if (this->width > width)
remove(width, this->width - width);
void append(const RTLIL::SigSpec &signal);
bool combine(RTLIL::SigSpec signal, RTLIL::State freeState = RTLIL::State::Sz, bool override = false);
void extend(int width, bool is_signed = false);
- void extend_un0(int width, bool is_signed = false);
+ void extend_u0(int width, bool is_signed = false);
void check() const;
bool operator <(const RTLIL::SigSpec &other) const;
bool operator ==(const RTLIL::SigSpec &other) const;
if (cell->parameters["\\A_WIDTH"].as_int() != cell->parameters["\\B_WIDTH"].as_int()) {
int width = std::max(cell->parameters["\\A_WIDTH"].as_int(), cell->parameters["\\B_WIDTH"].as_int());
- a.extend_un0(width, cell->parameters["\\A_SIGNED"].as_bool() && cell->parameters["\\B_SIGNED"].as_bool());
- b.extend_un0(width, cell->parameters["\\A_SIGNED"].as_bool() && cell->parameters["\\B_SIGNED"].as_bool());
+ a.extend_u0(width, cell->parameters["\\A_SIGNED"].as_bool() && cell->parameters["\\B_SIGNED"].as_bool());
+ b.extend_u0(width, cell->parameters["\\A_SIGNED"].as_bool() && cell->parameters["\\B_SIGNED"].as_bool());
}
RTLIL::SigSpec new_a, new_b;