Skip to content

Commit 70c0645

Browse files
committed
Merge branch 'bounding_box_3d_height' of https://github.com/verilog-to-routing/vtr-verilog-to-routing into 3d_track_to_track_conn
2 parents 240ae79 + d439ff8 commit 70c0645

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

vpr/src/place/place.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4136,9 +4136,10 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
41364136
const auto& device_ctx = g_vpr_ctx.device();
41374137
const auto& rr_graph = device_ctx.rr_graph;
41384138
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;
41424143

41434144
for (const auto& src_rr_node : rr_graph.nodes()) {
41444145
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)
41494150
VTR_ASSERT(rr_graph.node_xlow(src_rr_node) == src_x && rr_graph.node_ylow(src_rr_node) == src_y);
41504151

41514152
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++;
41534155
}
41544156
}
41554157

@@ -4161,12 +4163,14 @@ static void alloc_and_load_for_fast_vertical_cost_update (float place_cost_exp)
41614163
int src_y = rr_graph.node_yhigh(src_rr_node);
41624164
VTR_ASSERT(rr_graph.node_ylow(src_rr_node) == src_y && rr_graph.node_ylow(src_rr_node) == src_y);
41634165
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++;
41654168
}
41664169
}
41674170
}
41684171

41694172
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;
41704174

41714175
for (int layer_high_num = 1; layer_high_num < device_ctx.grid.get_num_layers(); layer_high_num++) {
41724176
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)
41784182
for (int layer_num = layer_low_num; layer_num <= layer_high_num; layer_num++) {
41794183
for (int x = x_low; x <= x_high; x++) {
41804184
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];
41824186
}
41834187
}
41844188
}
41854189
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);
41874191

41884192
chanz_place_cost_fac[layer_high_num][x_high][y_high][layer_low_num][x_low][y_low] = pow(
41894193
(double)chanz_place_cost_fac[layer_high_num][x_high][y_high][layer_low_num][x_low][y_low],

0 commit comments

Comments
 (0)