Skip to content

Commit 464dd62

Browse files
multiply crossing at the end
1 parent 5de882b commit 464dd62

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

vpr/src/place/net_cost_handler.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ double NetCostHandler::get_net_cube_bb_cost_(ClusterNetId net_id, bool use_ts) {
14121412

14131413
const bool is_multi_layer = (g_vpr_ctx.device().grid.get_num_layers() > 1);
14141414

1415-
double crossing = wirelength_crossing_count(cluster_ctx.clb_nlist.net_pins(net_id).size());
1415+
const double crossing = wirelength_crossing_count(cluster_ctx.clb_nlist.net_pins(net_id).size());
14161416

14171417
/* Could insert a check for xmin == xmax. In that case, assume *
14181418
* connection will be made with no bends and hence no x-cost. *
@@ -1429,12 +1429,14 @@ double NetCostHandler::get_net_cube_bb_cost_(ClusterNetId net_id, bool use_ts) {
14291429

14301430
double ncost;
14311431
const auto [chanx_cost_fac, chany_cost_fac] = get_chan_place_fac_(bb);
1432-
ncost = (bb.xmax - bb.xmin + 1) * crossing * chanx_cost_fac;
1433-
ncost += (bb.ymax - bb.ymin + 1) * crossing * chany_cost_fac;
1432+
ncost = (bb.xmax - bb.xmin + 1) * chanx_cost_fac;
1433+
ncost += (bb.ymax - bb.ymin + 1) * chany_cost_fac;
14341434
if (is_multi_layer) {
1435-
ncost += (bb.layer_max - bb.layer_min) * crossing * chanz_place_cost_fac_[bb.xmax][bb.ymax][bb.xmin][bb.ymin];
1435+
ncost += (bb.layer_max - bb.layer_min) * chanz_place_cost_fac_[bb.xmax][bb.ymax][bb.xmin][bb.ymin];
14361436
}
14371437

1438+
ncost *= crossing;
1439+
14381440
return ncost;
14391441
}
14401442

@@ -1460,7 +1462,7 @@ double NetCostHandler::get_net_per_layer_bb_cost_(ClusterNetId net_id , bool use
14601462
/* Adjust the bounding box half perimeter by the wirelength correction
14611463
* factor based on terminal count, which is 1 for the source + the number
14621464
* of sinks on this layer. */
1463-
double crossing = wirelength_crossing_count(layer_pin_sink_count[layer_num] + 1);
1465+
const double crossing = wirelength_crossing_count(layer_pin_sink_count[layer_num] + 1);
14641466

14651467
/* Could insert a check for xmin == xmax. In that case, assume *
14661468
* connection will be made with no bends and hence no x-cost. *
@@ -1476,9 +1478,9 @@ double NetCostHandler::get_net_per_layer_bb_cost_(ClusterNetId net_id , bool use
14761478
*/
14771479

14781480
const auto[chanx_cost_fac, chany_cost_fac] = get_chan_place_fac_(bb[layer_num]);
1479-
ncost += (bb[layer_num].xmax - bb[layer_num].xmin + 1) * crossing * chanx_cost_fac;
1480-
1481-
ncost += (bb[layer_num].ymax - bb[layer_num].ymin + 1) * crossing * chany_cost_fac;
1481+
ncost += (bb[layer_num].xmax - bb[layer_num].xmin + 1) * chanx_cost_fac;
1482+
ncost += (bb[layer_num].ymax - bb[layer_num].ymin + 1) * chany_cost_fac;
1483+
ncost *= crossing;
14821484
}
14831485

14841486
return ncost;

0 commit comments

Comments
 (0)