@@ -4136,9 +4136,10 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
4136
4136
const auto & device_ctx = g_vpr_ctx.device ();
4137
4137
const auto & rr_graph = device_ctx.rr_graph ;
4138
4138
const int num_tiles = device_ctx.grid .height () * device_ctx.grid .width ();
4139
- vtr::NdMatrix<float , 3 > tile_num_inter_die_conn ({device_ctx.grid .width (),
4140
- device_ctx.grid .height (),
4141
- static_cast <size_t >(device_ctx.grid .get_num_layers ())}, 0 );
4139
+ vtr::NdMatrix<float , 3 > tile_num_inter_die_conn ({static_cast <size_t >(device_ctx.grid .get_num_layers ()),
4140
+ device_ctx.grid .width (),
4141
+ device_ctx.grid .height ()}, 0 );
4142
+ int total_number_inter_die_conn = 0 ;
4142
4143
4143
4144
for (const auto & src_rr_node : rr_graph.nodes ()) {
4144
4145
for (const auto & rr_edge_idx : rr_graph.configurable_edges (src_rr_node)) {
@@ -4149,7 +4150,8 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
4149
4150
VTR_ASSERT (rr_graph.node_xlow (src_rr_node) == src_x && rr_graph.node_ylow (src_rr_node) == src_y);
4150
4151
4151
4152
int src_layer = rr_graph.node_layer (src_rr_node);
4152
- tile_num_inter_die_conn[src_x][src_y][src_layer]++;
4153
+ tile_num_inter_die_conn[src_layer][src_x][src_y]++;
4154
+ total_number_inter_die_conn++;
4153
4155
}
4154
4156
}
4155
4157
@@ -4161,12 +4163,14 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
4161
4163
int src_y = rr_graph.node_yhigh (src_rr_node);
4162
4164
VTR_ASSERT (rr_graph.node_ylow (src_rr_node) == src_y && rr_graph.node_ylow (src_rr_node) == src_y);
4163
4165
int src_layer = rr_graph.node_layer (src_rr_node);
4164
- tile_num_inter_die_conn[src_x][src_y][src_layer]++;
4166
+ tile_num_inter_die_conn[src_layer][src_x][src_y]++;
4167
+ total_number_inter_die_conn++;
4165
4168
}
4166
4169
}
4167
4170
}
4168
4171
4169
4172
chanz_place_cost_fac[0 ][0 ][0 ][0 ][0 ][0 ] = tile_num_inter_die_conn[0 ][0 ][0 ];
4173
+ float avg_num_inter_die_conn_per_tile = static_cast <float >(total_number_inter_die_conn) / num_tiles;
4170
4174
4171
4175
for (int layer_high_num = 1 ; layer_high_num < device_ctx.grid .get_num_layers (); layer_high_num++) {
4172
4176
for (int x_high = 1 ; x_high < (int )device_ctx.grid .width (); x_high++) {
@@ -4178,12 +4182,12 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
4178
4182
for (int layer_num = layer_low_num; layer_num <= layer_high_num; layer_num++) {
4179
4183
for (int x = x_low; x <= x_high; x++) {
4180
4184
for (int y = y_low; y <= y_high; y++) {
4181
- num_inter_die_conn += tile_num_inter_die_conn[x][y][layer_num ];
4185
+ num_inter_die_conn += tile_num_inter_die_conn[layer_num][x][y ];
4182
4186
}
4183
4187
}
4184
4188
}
4185
4189
chanz_place_cost_fac[layer_high_num][x_high][y_high][layer_low_num][x_low][y_low] =
4186
- (static_cast < float >(num_inter_die_conn) / num_tiles );
4190
+ (avg_num_inter_die_conn_per_tile / num_inter_die_conn );
4187
4191
4188
4192
chanz_place_cost_fac[layer_high_num][x_high][y_high][layer_low_num][x_low][y_low] = pow (
4189
4193
(double )chanz_place_cost_fac[layer_high_num][x_high][y_high][layer_low_num][x_low][y_low],
0 commit comments