Skip to content

Commit

Permalink
fix handling right shifts
Browse files Browse the repository at this point in the history
  • Loading branch information
nakengelhardt committed Oct 3, 2023
1 parent f597cc3 commit 0f4eff9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/celledges.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,16 @@ void shift_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell)
db->add_edge(cell, ID::B, k, ID::Y, i, -1);

if (cell->type.in(ID($shl), ID($sshl))) {
for (int k = min(i, a_width); k >= 0; k--)
for (int k = min(i, a_width-1); k >= 0; k--)
db->add_edge(cell, ID::A, k, ID::Y, i, -1);
}

if (cell->type.in(ID($shr), ID($sshr)))
for (int k = i; k < a_width; k++)
db->add_edge(cell, ID::A, k, ID::Y, i, -1);

if (cell->type == ID($sshr) && i >= a_width)
db->add_edge(cell, ID::A, a_width - 1, ID::Y, i, -1);

if (cell->type.in(ID($shift), ID($shiftx)))
for (int k = 0; k < a_width; k++)
Expand Down

0 comments on commit 0f4eff9

Please sign in to comment.