@@ -155,7 +155,7 @@ NetCostHandler::NetCostHandler(const t_placer_opts& placer_opts,
155
155
}
156
156
157
157
void NetCostHandler::alloc_and_load_chan_w_factors_for_place_cost_ () {
158
- float place_cost_exp = placer_opts_.place_cost_exp ;
158
+ const double place_cost_exp = static_cast < double >( placer_opts_.place_cost_exp ) ;
159
159
auto & device_ctx = g_vpr_ctx.device ();
160
160
161
161
const int grid_height = device_ctx.grid .height ();
@@ -197,7 +197,7 @@ void NetCostHandler::alloc_and_load_chan_w_factors_for_place_cost_() {
197
197
}
198
198
199
199
chanx_place_cost_fac_[high][low] = (high - low + 1 .) / chanx_place_cost_fac_[high][low];
200
- chanx_place_cost_fac_[high][low] = pow ((double )chanx_place_cost_fac_[high][low], ( double ) place_cost_exp);
200
+ chanx_place_cost_fac_[high][low] = pow ((double )chanx_place_cost_fac_[high][low], place_cost_exp);
201
201
}
202
202
}
203
203
@@ -227,7 +227,7 @@ void NetCostHandler::alloc_and_load_chan_w_factors_for_place_cost_() {
227
227
}
228
228
229
229
chany_place_cost_fac_[high][low] = (high - low + 1 .) / chany_place_cost_fac_[high][low];
230
- chany_place_cost_fac_[high][low] = pow ((double )chany_place_cost_fac_[high][low], ( double ) place_cost_exp);
230
+ chany_place_cost_fac_[high][low] = pow ((double )chany_place_cost_fac_[high][low], place_cost_exp);
231
231
}
232
232
}
233
233
@@ -268,22 +268,27 @@ void NetCostHandler::alloc_and_load_for_fast_vertical_cost_update_() {
268
268
* the block on the lower left connection of the block is added twice, that part needs to be removed.
269
269
*/
270
270
for (const auto & src_rr_node : rr_graph.nodes ()) {
271
- for (auto edge_range: {rr_graph.configurable_edges (src_rr_node), rr_graph.non_configurable_edges (src_rr_node)}) {
272
- for (const auto & rr_edge_idx : edge_range) {
273
- const auto & sink_rr_node = rr_graph.edge_sink_node (src_rr_node, rr_edge_idx);
274
- if (rr_graph.node_layer (src_rr_node) != rr_graph.node_layer (sink_rr_node)) {
275
- // We assume that the nodes driving the inter-layer connection or being driven by it
276
- // are not stretched across multiple tiles
277
- int src_x = rr_graph.node_xhigh (src_rr_node);
278
- int src_y = rr_graph.node_yhigh (src_rr_node);
279
- VTR_ASSERT (rr_graph.node_xlow (src_rr_node) == src_x && rr_graph.node_ylow (src_rr_node) == src_y);
280
-
281
- tile_num_inter_die_conn[src_x][src_y]++;
282
- }
271
+ for (const auto & rr_edge_idx : rr_graph.edges (src_rr_node)) {
272
+ const auto & sink_rr_node = rr_graph.edge_sink_node (src_rr_node, rr_edge_idx);
273
+ if (rr_graph.node_layer (src_rr_node) != rr_graph.node_layer (sink_rr_node)) {
274
+ // We assume that the nodes driving the inter-layer connection or being driven by it
275
+ // are not stretched across multiple tiles
276
+ int src_x = rr_graph.node_xhigh (src_rr_node);
277
+ int src_y = rr_graph.node_yhigh (src_rr_node);
278
+ VTR_ASSERT (rr_graph.node_xlow (src_rr_node) == src_x && rr_graph.node_ylow (src_rr_node) == src_y);
279
+
280
+ tile_num_inter_die_conn[src_x][src_y]++;
283
281
}
284
282
}
285
283
}
286
284
285
+ int num_layers = device_ctx.grid .get_num_layers ();
286
+ for (size_t x = 0 ; x < device_ctx.grid .width (); x++) {
287
+ for (size_t y = 0 ; y < device_ctx.grid .height (); y++) {
288
+ tile_num_inter_die_conn[x][y] /= (num_layers-1 );
289
+ }
290
+ }
291
+
287
292
// Step 2: Calculate prefix sum of the inter-die connectivity up to and including the channel at (x, y).
288
293
acc_tile_num_inter_die_conn_[0 ][0 ] = tile_num_inter_die_conn[0 ][0 ];
289
294
// Initialize the first row and column
0 commit comments