Skip to content

Commit 21c62d8

Browse files
committed
[vpr][place]make get_chanz_cost_factor a private function
1 parent df4159b commit 21c62d8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

vpr/src/place/net_cost_handler.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ double NetCostHandler::get_net_cube_bb_cost_(ClusterNetId net_id, bool use_ts) {
14901490
ncost = (bb.xmax - bb.xmin + 1) * crossing * chanx_place_cost_fac_[bb.ymax][bb.ymin - 1];
14911491
ncost += (bb.ymax - bb.ymin + 1) * crossing * chany_place_cost_fac_[bb.xmax][bb.xmin - 1];
14921492
if (is_multi_layer) {
1493-
ncost += (bb.layer_max - bb.layer_min) * crossing * get_chanz_cost_factor(bb);
1493+
ncost += (bb.layer_max - bb.layer_min) * crossing * get_chanz_cost_factor_(bb);
14941494
}
14951495

14961496
return ncost;
@@ -1593,7 +1593,7 @@ double NetCostHandler::get_net_wirelength_from_layer_bb_(ClusterNetId net_id) {
15931593
return ncost;
15941594
}
15951595

1596-
float NetCostHandler::get_chanz_cost_factor(const t_bb& bounding_box) {
1596+
float NetCostHandler::get_chanz_cost_factor_(const t_bb& bounding_box) {
15971597
float place_cost_exp = placer_opts_.place_cost_exp;
15981598
int x_high = bounding_box.xmax;
15991599
int x_low = bounding_box.xmin;
@@ -1617,12 +1617,11 @@ float NetCostHandler::get_chanz_cost_factor(const t_bb& bounding_box) {
16171617
acc_tile_num_inter_die_conn_[x_low-1][y_low-1];
16181618
}
16191619

1620-
int bb_num_tiles = (x_high - x_low + 1) * (y_high - y_low + 1);
1621-
16221620
float z_cost_factor;
16231621
if (num_inter_dir_conn == 0) {
16241622
return 1.0f;
16251623
} else {
1624+
int bb_num_tiles = (x_high - x_low + 1) * (y_high - y_low + 1);
16261625
z_cost_factor = bb_num_tiles / static_cast<float>(num_inter_dir_conn);
16271626
z_cost_factor = pow((double)z_cost_factor, (double)place_cost_exp);
16281627
}

vpr/src/place/net_cost_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,6 @@ class NetCostHandler {
513513
* @param bounding_box Bounding box of the net which chanz cost factor is to be calculated
514514
* @return ChanZ cost factor
515515
*/
516-
float get_chanz_cost_factor(const t_bb& bounding_box);
516+
float get_chanz_cost_factor_(const t_bb& bounding_box);
517517

518518
};

0 commit comments

Comments
 (0)