mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
Fixed type of sign extension in opt_const $eq/$ne handling
This commit is contained in:
parent
ed4bcd52e5
commit
0e1661f84e
3 changed files with 26 additions and 9 deletions
|
@ -940,6 +940,22 @@ void RTLIL::SigSpec::extend(int width, bool is_signed)
|
|||
optimize();
|
||||
}
|
||||
|
||||
void RTLIL::SigSpec::extend_un0(int width, bool is_signed)
|
||||
{
|
||||
if (this->width > width)
|
||||
remove(width, this->width - width);
|
||||
|
||||
if (this->width < width) {
|
||||
RTLIL::SigSpec padding = this->width > 0 ? extract(this->width - 1, 1) : RTLIL::SigSpec(RTLIL::State::S0);
|
||||
if (!is_signed)
|
||||
padding = RTLIL::SigSpec(RTLIL::State::S0);
|
||||
while (this->width < width)
|
||||
append(padding);
|
||||
}
|
||||
|
||||
optimize();
|
||||
}
|
||||
|
||||
void RTLIL::SigSpec::check() const
|
||||
{
|
||||
int w = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue