Skip to content

Commit 7f6c496

Browse files
weigh congestion cost along x/y axis with the length of bb along that dimension
1 parent fab92c1 commit 7f6c496

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

vpr/src/place/net_cost_handler.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -1423,14 +1423,19 @@ double NetCostHandler::get_net_cube_bb_cost_(ClusterNetId net_id, bool use_ts) {
14231423
}
14241424

14251425
double NetCostHandler::get_net_cube_cong_cost_(ClusterNetId net_id, bool use_ts) {
1426-
auto [x_chan_cong, y_chan_cong] = use_ts ? ts_avg_chann_util_new_[net_id] : avg_chann_util_[net_id];
1426+
const auto [x_chan_util, y_chan_util] = use_ts ? ts_avg_chann_util_new_[net_id] : avg_chann_util_[net_id];
1427+
1428+
const t_bb& bb = use_ts ? ts_bb_coord_new_[net_id] : bb_coords_[net_id];
1429+
1430+
int distance_x = bb.xmax - bb.xmin + 1;
1431+
int distance_y = bb.ymax - bb.ymin + 1;
14271432

14281433
const float threshold = placer_opts_.congestion_chan_util_threshold;
14291434

1430-
x_chan_cong = (x_chan_cong < threshold) ? 0.0f : x_chan_cong - threshold;
1431-
y_chan_cong = (y_chan_cong < threshold) ? 0.0f : y_chan_cong - threshold;
1435+
float x_chan_cong = (x_chan_util < threshold) ? 0.0f : x_chan_util - threshold;
1436+
float y_chan_cong = (y_chan_util < threshold) ? 0.0f : y_chan_util - threshold;
14321437

1433-
return x_chan_cong + y_chan_cong;
1438+
return (distance_x * x_chan_cong) + (distance_y * y_chan_cong);
14341439
}
14351440

14361441
double NetCostHandler::get_net_per_layer_bb_cost_(ClusterNetId net_id, bool use_ts) {

0 commit comments

Comments
 (0)