@@ -1604,16 +1604,29 @@ double NetCostHandler::get_net_wirelength_from_layer_bb_(ClusterNetId net_id) {
1604
1604
return ncost;
1605
1605
}
1606
1606
1607
- float NetCostHandler::get_chanz_cost_factor (const t_bb& bounding_box, float place_cost_exp) {
1607
+ float NetCostHandler::get_chanz_cost_factor (const t_bb& bounding_box) {
1608
+ float place_cost_exp = placer_opts_.place_cost_exp ;
1608
1609
int x_high = bounding_box.xmax ;
1609
1610
int x_low = bounding_box.xmin ;
1610
1611
int y_high = bounding_box.ymax ;
1611
1612
int y_low = bounding_box.ymin ;
1612
1613
1613
- int num_inter_dir_conn = acc_tile_num_inter_die_conn_[x_high][y_high] - \
1614
- acc_tile_num_inter_die_conn_[x_low-1 ][y_high] - \
1615
- acc_tile_num_inter_die_conn_[x_high][y_low-1 ] + \
1616
- acc_tile_num_inter_die_conn_[x_low-1 ][y_low-1 ];
1614
+ int num_inter_dir_conn;
1615
+
1616
+ if (x_low == 0 && y_low == 0 ) {
1617
+ num_inter_dir_conn = acc_tile_num_inter_die_conn_[x_high][y_high];
1618
+ } else if (x_low == 0 ) {
1619
+ num_inter_dir_conn = acc_tile_num_inter_die_conn_[x_high][y_high] - \
1620
+ acc_tile_num_inter_die_conn_[x_high][y_low-1 ];
1621
+ } else if (y_low == 0 ) {
1622
+ num_inter_dir_conn = acc_tile_num_inter_die_conn_[x_high][y_high] - \
1623
+ acc_tile_num_inter_die_conn_[x_low-1 ][y_high];
1624
+ } else {
1625
+ num_inter_dir_conn = acc_tile_num_inter_die_conn_[x_high][y_high] - \
1626
+ acc_tile_num_inter_die_conn_[x_low-1 ][y_high] - \
1627
+ acc_tile_num_inter_die_conn_[x_high][y_low-1 ] + \
1628
+ acc_tile_num_inter_die_conn_[x_low-1 ][y_low-1 ];
1629
+ }
1617
1630
1618
1631
int bb_num_tiles = (x_high - x_low + 1 ) * (y_high - y_low + 1 );
1619
1632
@@ -1623,7 +1636,6 @@ float NetCostHandler::get_chanz_cost_factor(const t_bb& bounding_box, float plac
1623
1636
} else {
1624
1637
z_cost_factor = bb_num_tiles / static_cast <float >(num_inter_dir_conn);
1625
1638
z_cost_factor = pow ((double )z_cost_factor, (double )place_cost_exp);
1626
-
1627
1639
}
1628
1640
1629
1641
return z_cost_factor;
0 commit comments