mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
Respect \A_SIGNED for $shift
This reflects the behaviour of $shr/$shl, which sign-extend their A operands to the size of their output, then do a logical shift (shift in 0-bits).
This commit is contained in:
parent
22765ef0a5
commit
928fd40c2e
7 changed files with 61 additions and 65 deletions
|
@ -522,7 +522,7 @@ bool SatGen::importCell(RTLIL::Cell *cell, int timestep)
|
|||
|
||||
int extend_bit = ez->CONST_FALSE;
|
||||
|
||||
if (!cell->type.in(ID($shift), ID($shiftx)) && cell->parameters[ID::A_SIGNED].as_bool())
|
||||
if (cell->parameters[ID::A_SIGNED].as_bool())
|
||||
extend_bit = a.back();
|
||||
|
||||
while (y.size() < a.size())
|
||||
|
@ -555,7 +555,7 @@ bool SatGen::importCell(RTLIL::Cell *cell, int timestep)
|
|||
std::vector<int> undef_a_shifted;
|
||||
|
||||
extend_bit = cell->type == ID($shiftx) ? ez->CONST_TRUE : ez->CONST_FALSE;
|
||||
if (!cell->type.in(ID($shift), ID($shiftx)) && cell->parameters[ID::A_SIGNED].as_bool())
|
||||
if (cell->parameters[ID::A_SIGNED].as_bool())
|
||||
extend_bit = undef_a.back();
|
||||
|
||||
while (undef_y.size() < undef_a.size())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue