Skip to content

Commit

Permalink
Update peepopt_muldiv_c.pmg
Browse files Browse the repository at this point in the history
  • Loading branch information
akashlevy authored Dec 17, 2024
1 parent 0ddb3d7 commit 2375879
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions passes/pmgen/peepopt_muldiv_c.pmg
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ code
if (b_const_int_shifted % c_const_int != 0)
reject;

// Check that every single output bit of the multiplier is connected consecutively to the div operator (offset accounted for)
for (int i = 0; i < mul_y.size(); i++) {
if (sigmap(mul_y[i]) != sigmap(div_a[i + offset])) {
reject;
}
}

// Rewire to only keep multiplier
mul->setPort(\B, Const(b_const_int_shifted / c_const_int, b_const_width));
mul->setPort(\Y, div_y);
Expand Down

0 comments on commit 2375879

Please sign in to comment.