Skip to content

Commit 56f6d8b

Browse files
enum class e_cost_methods
1 parent 9bfb2a0 commit 56f6d8b

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

vpr/src/place/move_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,8 @@ e_block_move_result record_macro_self_swaps(t_pl_blocks_to_be_moved& blocks_affe
467467

468468
//Fit the displaced blocks into the empty locations
469469
auto loc_itr = empty_locs.begin();
470-
for (auto blk : non_macro_displaced_blocks) {
471-
outcome = blocks_affected.record_block_move(blk, *loc_itr, place_locs_vars);
470+
for (ClusterBlockId blk : non_macro_displaced_blocks) {
471+
outcome = blocks_affected.record_block_move(blk, *loc_itr, place_loc_vars);
472472
++loc_itr;
473473
}
474474

vpr/src/place/net_cost_handler.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@ double comp_bb_cost(e_cost_methods method) {
19501950
if (!cluster_ctx.clb_nlist.net_is_ignored(net_id)) { /* Do only if not ignored. */
19511951
/* Small nets don't use incremental updating on their bounding boxes, *
19521952
* so they can use a fast bounding box calculator. */
1953-
if (cluster_ctx.clb_nlist.net_sinks(net_id).size() >= SMALL_NET && method == NORMAL) {
1953+
if (cluster_ctx.clb_nlist.net_sinks(net_id).size() >= SMALL_NET && method == e_cost_methods::NORMAL) {
19541954
get_bb_from_scratch(net_id,
19551955
place_move_ctx.bb_coords[net_id],
19561956
place_move_ctx.bb_num_on_edges[net_id],
@@ -1963,12 +1963,12 @@ double comp_bb_cost(e_cost_methods method) {
19631963

19641964
pl_net_cost.net_cost[net_id] = get_net_cost(net_id, place_move_ctx.bb_coords[net_id]);
19651965
cost += pl_net_cost.net_cost[net_id];
1966-
if (method == CHECK)
1966+
if (method == e_cost_methods::CHECK)
19671967
expected_wirelength += get_net_wirelength_estimate(net_id, place_move_ctx.bb_coords[net_id]);
19681968
}
19691969
}
19701970

1971-
if (method == CHECK) {
1971+
if (method == e_cost_methods::CHECK) {
19721972
VTR_LOG("\n");
19731973
VTR_LOG("BB estimate of min-dist (placement) wire length: %.0f\n",
19741974
expected_wirelength);
@@ -1987,7 +1987,7 @@ double comp_layer_bb_cost(e_cost_methods method) {
19871987
if (!cluster_ctx.clb_nlist.net_is_ignored(net_id)) { /* Do only if not ignored. */
19881988
/* Small nets don't use incremental updating on their bounding boxes, *
19891989
* so they can use a fast bounding box calculator. */
1990-
if (cluster_ctx.clb_nlist.net_sinks(net_id).size() >= SMALL_NET && method == NORMAL) {
1990+
if (cluster_ctx.clb_nlist.net_sinks(net_id).size() >= SMALL_NET && method == e_cost_methods::NORMAL) {
19911991
get_layer_bb_from_scratch(net_id,
19921992
place_move_ctx.layer_bb_num_on_edges[net_id],
19931993
place_move_ctx.layer_bb_coords[net_id],
@@ -2002,14 +2002,14 @@ double comp_layer_bb_cost(e_cost_methods method) {
20022002
place_move_ctx.layer_bb_coords[net_id],
20032003
place_move_ctx.num_sink_pin_layer[size_t(net_id)]);
20042004
cost += pl_net_cost.net_cost[net_id];
2005-
if (method == CHECK)
2005+
if (method == e_cost_methods::CHECK)
20062006
expected_wirelength += get_net_wirelength_from_layer_bb(net_id,
20072007
place_move_ctx.layer_bb_coords[net_id],
20082008
place_move_ctx.num_sink_pin_layer[size_t(net_id)]);
20092009
}
20102010
}
20112011

2012-
if (method == CHECK) {
2012+
if (method == e_cost_methods::CHECK) {
20132013
VTR_LOG("\n");
20142014
VTR_LOG("BB estimate of min-dist (placement) wire length: %.0f\n",
20152015
expected_wirelength);

vpr/src/place/net_cost_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ constexpr double ERROR_TOL = .01;
2222
* NORMAL: Compute cost efficiently using incremental techniques.
2323
* CHECK: Brute-force cost computation; useful to validate the more complex incremental cost update code.
2424
*/
25-
enum e_cost_methods {
25+
enum class e_cost_methods {
2626
NORMAL,
2727
CHECK
2828
};

vpr/src/place/place.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,10 @@ void try_place(const Netlist<>& net_list,
493493

494494
if (placer_opts.place_algorithm.is_timing_driven()) {
495495
if (cube_bb) {
496-
costs.bb_cost = comp_bb_cost(NORMAL);
496+
costs.bb_cost = comp_bb_cost(e_cost_methods::NORMAL);
497497
} else {
498498
VTR_ASSERT_SAFE(!cube_bb);
499-
costs.bb_cost = comp_layer_bb_cost(NORMAL);
499+
costs.bb_cost = comp_layer_bb_cost(e_cost_methods::NORMAL);
500500
}
501501

502502
first_crit_exponent = placer_opts.td_place_exp_first; /*this will be modified when rlim starts to change */
@@ -574,10 +574,10 @@ void try_place(const Netlist<>& net_list,
574574

575575
/* Total cost is the same as wirelength cost normalized*/
576576
if (cube_bb) {
577-
costs.bb_cost = comp_bb_cost(NORMAL);
577+
costs.bb_cost = comp_bb_cost(e_cost_methods::NORMAL);
578578
} else {
579579
VTR_ASSERT_SAFE(!cube_bb);
580-
costs.bb_cost = comp_layer_bb_cost(NORMAL);
580+
costs.bb_cost = comp_layer_bb_cost(e_cost_methods::NORMAL);
581581
}
582582
costs.bb_cost_norm = 1 / costs.bb_cost;
583583

@@ -2026,10 +2026,10 @@ static int check_placement_costs(const t_placer_costs& costs,
20262026
const bool cube_bb = g_vpr_ctx.placement().cube_bb;
20272027

20282028
if (cube_bb) {
2029-
bb_cost_check = comp_bb_cost(CHECK);
2029+
bb_cost_check = comp_bb_cost(e_cost_methods::CHECK);
20302030
} else {
20312031
VTR_ASSERT_SAFE(!cube_bb);
2032-
bb_cost_check = comp_layer_bb_cost(CHECK);
2032+
bb_cost_check = comp_layer_bb_cost(e_cost_methods::CHECK);
20332033
}
20342034

20352035
if (fabs(bb_cost_check - costs.bb_cost) > costs.bb_cost * ERROR_TOL) {

0 commit comments

Comments
 (0)