@@ -1412,7 +1412,7 @@ double NetCostHandler::get_net_cube_bb_cost_(ClusterNetId net_id, bool use_ts) {
1412
1412
1413
1413
const bool is_multi_layer = (g_vpr_ctx.device ().grid .get_num_layers () > 1 );
1414
1414
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 ());
1416
1416
1417
1417
/* Could insert a check for xmin == xmax. In that case, assume *
1418
1418
* 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) {
1429
1429
1430
1430
double ncost;
1431
1431
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;
1434
1434
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 ];
1436
1436
}
1437
1437
1438
+ ncost *= crossing;
1439
+
1438
1440
return ncost;
1439
1441
}
1440
1442
@@ -1460,7 +1462,7 @@ double NetCostHandler::get_net_per_layer_bb_cost_(ClusterNetId net_id , bool use
1460
1462
/* Adjust the bounding box half perimeter by the wirelength correction
1461
1463
* factor based on terminal count, which is 1 for the source + the number
1462
1464
* 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 );
1464
1466
1465
1467
/* Could insert a check for xmin == xmax. In that case, assume *
1466
1468
* 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
1476
1478
*/
1477
1479
1478
1480
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;
1482
1484
}
1483
1485
1484
1486
return ncost;
0 commit comments