@@ -196,6 +196,29 @@ t_heap* ConnectionRouter<Heap>::timing_driven_route_connection_from_heap(RRNodeI
196
196
const auto & device_ctx = g_vpr_ctx.device ();
197
197
auto & route_ctx = g_vpr_ctx.mutable_routing ();
198
198
199
+ // Get bounding box for sink node used in timing_driven_expand_neighbour
200
+ VTR_ASSERT_SAFE (sink_node != RRNodeId::INVALID ());
201
+
202
+ t_bb target_bb;
203
+ if (rr_graph_->node_type (sink_node) == SINK) { // We need to get a bounding box for the sink's entire tile
204
+ vtr::Rect <int > tile_bb = grid_.get_tile_bb ({rr_graph_->node_xlow (sink_node),
205
+ rr_graph_->node_ylow (sink_node),
206
+ rr_graph_->node_layer (sink_node)});
207
+
208
+ target_bb.xmin = tile_bb.xmin ();
209
+ target_bb.ymin = tile_bb.ymin ();
210
+ target_bb.xmax = tile_bb.xmax ();
211
+ target_bb.ymax = tile_bb.ymax ();
212
+ } else {
213
+ target_bb.xmin = rr_graph_->node_xlow (sink_node);
214
+ target_bb.ymin = rr_graph_->node_ylow (sink_node);
215
+ target_bb.xmax = rr_graph_->node_xhigh (sink_node);
216
+ target_bb.ymax = rr_graph_->node_yhigh (sink_node);
217
+ }
218
+
219
+ target_bb.layer_min = rr_graph_->node_layer (RRNodeId (sink_node));
220
+ target_bb.layer_max = rr_graph_->node_layer (RRNodeId (sink_node));
221
+
199
222
t_heap* cheapest = nullptr ;
200
223
while (!heap_.is_empty_heap ()) {
201
224
// cheapest t_heap in current route tree to be expanded on
@@ -225,7 +248,8 @@ t_heap* ConnectionRouter<Heap>::timing_driven_route_connection_from_heap(RRNodeI
225
248
timing_driven_expand_cheapest (cheapest,
226
249
sink_node,
227
250
cost_params,
228
- bounding_box);
251
+ bounding_box,
252
+ target_bb);
229
253
230
254
rcv_path_manager.free_path_struct (cheapest->path_data );
231
255
heap_.free (cheapest);
@@ -308,7 +332,8 @@ vtr::vector<RRNodeId, t_heap> ConnectionRouter<Heap>::timing_driven_find_all_sho
308
332
timing_driven_expand_cheapest (cheapest,
309
333
target_node,
310
334
cost_params,
311
- bounding_box);
335
+ bounding_box,
336
+ t_bb ());
312
337
313
338
if (cheapest_paths[inode].index == RRNodeId::INVALID () || cheapest_paths[inode].cost >= cheapest->cost ) {
314
339
VTR_LOGV_DEBUG (router_debug_, " Better cost to node %d: %g (was %g)\n " , inode, cheapest->cost , cheapest_paths[inode].cost );
@@ -328,7 +353,8 @@ template<typename Heap>
328
353
void ConnectionRouter<Heap>::timing_driven_expand_cheapest(t_heap* cheapest,
329
354
RRNodeId target_node,
330
355
const t_conn_cost_params& cost_params,
331
- const t_bb& bounding_box) {
356
+ const t_bb& bounding_box,
357
+ const t_bb& target_bb) {
332
358
RRNodeId inode = cheapest->index ;
333
359
334
360
t_rr_node_route_inf* route_inf = &rr_node_route_inf_[inode];
@@ -360,7 +386,7 @@ void ConnectionRouter<Heap>::timing_driven_expand_cheapest(t_heap* cheapest,
360
386
update_cheapest (cheapest, route_inf);
361
387
362
388
timing_driven_expand_neighbours (cheapest, cost_params, bounding_box,
363
- target_node);
389
+ target_node, target_bb );
364
390
} else {
365
391
// Post-heap prune, do not re-explore from the current/new partial path as it
366
392
// has worse cost than the best partial path to this node found so far
@@ -376,31 +402,10 @@ template<typename Heap>
376
402
void ConnectionRouter<Heap>::timing_driven_expand_neighbours(t_heap* current,
377
403
const t_conn_cost_params& cost_params,
378
404
const t_bb& bounding_box,
379
- RRNodeId target_node) {
405
+ RRNodeId target_node,
406
+ const t_bb& target_bb) {
380
407
/* Puts all the rr_nodes adjacent to current on the heap. */
381
408
382
- t_bb target_bb;
383
- if (target_node != RRNodeId::INVALID ()) {
384
- if (rr_graph_->node_type (target_node) == SINK) { // We need to get a bounding box for the sink's entire tile
385
- vtr::Rect <int > tile_bb = grid_.get_tile_bb ({rr_graph_->node_xlow (target_node),
386
- rr_graph_->node_ylow (target_node),
387
- rr_graph_->node_layer (target_node)});
388
-
389
- target_bb.xmin = tile_bb.xmin ();
390
- target_bb.ymin = tile_bb.ymin ();
391
- target_bb.xmax = tile_bb.xmax ();
392
- target_bb.ymax = tile_bb.ymax ();
393
- } else {
394
- target_bb.xmin = rr_graph_->node_xlow (target_node);
395
- target_bb.ymin = rr_graph_->node_ylow (target_node);
396
- target_bb.xmax = rr_graph_->node_xhigh (target_node);
397
- target_bb.ymax = rr_graph_->node_yhigh (target_node);
398
- }
399
-
400
- target_bb.layer_min = rr_graph_->node_layer (RRNodeId (target_node));
401
- target_bb.layer_max = rr_graph_->node_layer (RRNodeId (target_node));
402
- }
403
-
404
409
// For each node associated with the current heap element, expand all of it's neighbors
405
410
RRNodeId from_node = current->index ;
406
411
auto edges = rr_nodes_.edge_range (from_node);
0 commit comments