@@ -4111,9 +4111,10 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
4111
4111
const auto & device_ctx = g_vpr_ctx.device ();
4112
4112
const auto & rr_graph = device_ctx.rr_graph ;
4113
4113
const int num_tiles = device_ctx.grid .height () * device_ctx.grid .width ();
4114
- vtr::NdMatrix<float , 3 > tile_num_inter_die_conn ({device_ctx.grid .width (),
4115
- device_ctx.grid .height (),
4116
- static_cast <size_t >(device_ctx.grid .get_num_layers ())}, 0 );
4114
+ vtr::NdMatrix<float , 3 > tile_num_inter_die_conn ({static_cast <size_t >(device_ctx.grid .get_num_layers ()),
4115
+ device_ctx.grid .width (),
4116
+ device_ctx.grid .height ()}, 0 );
4117
+ int total_number_inter_die_conn = 0 ;
4117
4118
4118
4119
for (const auto & src_rr_node : rr_graph.nodes ()) {
4119
4120
for (const auto & rr_edge_idx : rr_graph.configurable_edges (src_rr_node)) {
@@ -4124,7 +4125,8 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
4124
4125
VTR_ASSERT (rr_graph.node_xlow (src_rr_node) == src_x && rr_graph.node_ylow (src_rr_node) == src_y);
4125
4126
4126
4127
int src_layer = rr_graph.node_layer (src_rr_node);
4127
- tile_num_inter_die_conn[src_x][src_y][src_layer]++;
4128
+ tile_num_inter_die_conn[src_layer][src_x][src_y]++;
4129
+ total_number_inter_die_conn++;
4128
4130
}
4129
4131
}
4130
4132
@@ -4136,12 +4138,14 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
4136
4138
int src_y = rr_graph.node_yhigh (src_rr_node);
4137
4139
VTR_ASSERT (rr_graph.node_ylow (src_rr_node) == src_y && rr_graph.node_ylow (src_rr_node) == src_y);
4138
4140
int src_layer = rr_graph.node_layer (src_rr_node);
4139
- tile_num_inter_die_conn[src_x][src_y][src_layer]++;
4141
+ tile_num_inter_die_conn[src_layer][src_x][src_y]++;
4142
+ total_number_inter_die_conn++;
4140
4143
}
4141
4144
}
4142
4145
}
4143
4146
4144
4147
chanz_place_cost_fac[0 ][0 ][0 ][0 ][0 ][0 ] = tile_num_inter_die_conn[0 ][0 ][0 ];
4148
+ float avg_num_inter_die_conn_per_tile = static_cast <float >(total_number_inter_die_conn) / num_tiles;
4145
4149
4146
4150
for (int layer_high_num = 1 ; layer_high_num < device_ctx.grid .get_num_layers (); layer_high_num++) {
4147
4151
for (int x_high = 1 ; x_high < (int )device_ctx.grid .width (); x_high++) {
@@ -4153,12 +4157,12 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
4153
4157
for (int layer_num = layer_low_num; layer_num <= layer_high_num; layer_num++) {
4154
4158
for (int x = x_low; x <= x_high; x++) {
4155
4159
for (int y = y_low; y <= y_high; y++) {
4156
- num_inter_die_conn += tile_num_inter_die_conn[x][y][layer_num ];
4160
+ num_inter_die_conn += tile_num_inter_die_conn[layer_num][x][y ];
4157
4161
}
4158
4162
}
4159
4163
}
4160
4164
chanz_place_cost_fac[layer_high_num][x_high][y_high][layer_low_num][x_low][y_low] =
4161
- (static_cast < float >(num_inter_die_conn) / num_tiles );
4165
+ (avg_num_inter_die_conn_per_tile / num_inter_die_conn );
4162
4166
4163
4167
chanz_place_cost_fac[layer_high_num][x_high][y_high][layer_low_num][x_low][y_low] = pow (
4164
4168
(double )chanz_place_cost_fac[layer_high_num][x_high][y_high][layer_low_num][x_low][y_low],
0 commit comments