Skip to content

Commit

Permalink
Merge pull request #2797 from verilog-to-routing/temp_remove_floor_me…
Browse files Browse the repository at this point in the history
…dian_move_gen

Remove calls to floor() in median move generators
  • Loading branch information
vaughnbetz authored Nov 5, 2024
2 parents 1415193 + e01f92e commit 30b4927
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions vpr/src/place/median_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ e_create_move MedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved& blocks_
std::stable_sort(place_move_ctx.Y_coord.begin(), place_move_ctx.Y_coord.end());
std::stable_sort(place_move_ctx.layer_coord.begin(), place_move_ctx.layer_coord.end());

limit_coords.xmin = place_move_ctx.X_coord[floor((place_move_ctx.X_coord.size() - 1) / 2)];
limit_coords.xmax = place_move_ctx.X_coord[floor((place_move_ctx.X_coord.size() - 1) / 2) + 1];
limit_coords.xmin = place_move_ctx.X_coord[((place_move_ctx.X_coord.size() - 1) / 2)];
limit_coords.xmax = place_move_ctx.X_coord[((place_move_ctx.X_coord.size() - 1) / 2) + 1];

limit_coords.ymin = place_move_ctx.Y_coord[floor((place_move_ctx.Y_coord.size() - 1) / 2)];
limit_coords.ymax = place_move_ctx.Y_coord[floor((place_move_ctx.Y_coord.size() - 1) / 2) + 1];
limit_coords.ymin = place_move_ctx.Y_coord[((place_move_ctx.Y_coord.size() - 1) / 2)];
limit_coords.ymax = place_move_ctx.Y_coord[((place_move_ctx.Y_coord.size() - 1) / 2) + 1];

limit_coords.layer_min = place_move_ctx.layer_coord[floor((place_move_ctx.layer_coord.size() - 1) / 2)];
limit_coords.layer_max = place_move_ctx.layer_coord[floor((place_move_ctx.layer_coord.size() - 1) / 2) + 1];
limit_coords.layer_min = place_move_ctx.layer_coord[((place_move_ctx.layer_coord.size() - 1) / 2)];
limit_coords.layer_max = place_move_ctx.layer_coord[((place_move_ctx.layer_coord.size() - 1) / 2) + 1];

//arrange the different range limiters
t_range_limiters range_limiters{rlim,
Expand Down
12 changes: 6 additions & 6 deletions vpr/src/place/weighted_median_move_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,24 @@ e_create_move WeightedMedianMoveGenerator::propose_move(t_pl_blocks_to_be_moved&
limit_coords.xmin = place_move_ctx.X_coord[0];
limit_coords.xmax = limit_coords.xmin;
} else {
limit_coords.xmin = place_move_ctx.X_coord[floor((place_move_ctx.X_coord.size() - 1) / 2)];
limit_coords.xmax = place_move_ctx.X_coord[floor((place_move_ctx.X_coord.size() - 1) / 2) + 1];
limit_coords.xmin = place_move_ctx.X_coord[((place_move_ctx.X_coord.size() - 1) / 2)];
limit_coords.xmax = place_move_ctx.X_coord[((place_move_ctx.X_coord.size() - 1) / 2) + 1];
}

if (place_move_ctx.Y_coord.size() == 1) {
limit_coords.ymin = place_move_ctx.Y_coord[0];
limit_coords.ymax = limit_coords.ymin;
} else {
limit_coords.ymin = place_move_ctx.Y_coord[floor((place_move_ctx.Y_coord.size() - 1) / 2)];
limit_coords.ymax = place_move_ctx.Y_coord[floor((place_move_ctx.Y_coord.size() - 1) / 2) + 1];
limit_coords.ymin = place_move_ctx.Y_coord[((place_move_ctx.Y_coord.size() - 1) / 2)];
limit_coords.ymax = place_move_ctx.Y_coord[((place_move_ctx.Y_coord.size() - 1) / 2) + 1];
}

if (place_move_ctx.layer_coord.size() == 1) {
limit_coords.layer_min = place_move_ctx.layer_coord[0];
limit_coords.layer_max = limit_coords.layer_min;
} else {
limit_coords.layer_min = place_move_ctx.layer_coord[floor((place_move_ctx.layer_coord.size() - 1) / 2)];
limit_coords.layer_max = place_move_ctx.layer_coord[floor((place_move_ctx.layer_coord.size() - 1) / 2) + 1];
limit_coords.layer_min = place_move_ctx.layer_coord[((place_move_ctx.layer_coord.size() - 1) / 2)];
limit_coords.layer_max = place_move_ctx.layer_coord[((place_move_ctx.layer_coord.size() - 1) / 2) + 1];
}

t_range_limiters range_limiters{rlim,
Expand Down

0 comments on commit 30b4927

Please sign in to comment.