@@ -379,12 +379,11 @@ void ConnectionRouter<Heap>::timing_driven_expand_cheapest(t_heap* cheapest,
379
379
VTR_LOGV_DEBUG (router_debug_, " Better cost to %d\n " , inode);
380
380
VTR_LOGV_DEBUG (router_debug_, " New total cost: %g\n " , new_total_cost);
381
381
VTR_LOGV_DEBUG (router_debug_, " New back cost: %g\n " , new_back_cost);
382
- VTR_LOGV_DEBUG (router_debug_ && (rr_nodes_.node_type (RRNodeId (cheapest->index )) != t_rr_type::SOURCE) &&
383
- (rr_nodes_.node_type (RRNodeId (cheapest->index )) != t_rr_type::OPIN),
384
- " Setting path costs for associated node %d (from %d edge %zu)\n " ,
385
- cheapest->index ,
386
- static_cast <size_t >(rr_graph_->edge_src_node (cheapest->prev_edge ())),
387
- static_cast <size_t >(cheapest->prev_edge ()));
382
+ VTR_LOGV_DEBUG (router_debug_ && (cheapest->prev_edge () != RREdgeId::INVALID ()),
383
+ " Setting path costs for associated node %d (from %d edge %zu)\n " ,
384
+ cheapest->index ,
385
+ static_cast <size_t >(rr_graph_->edge_src_node (cheapest->prev_edge ())),
386
+ static_cast <size_t >(cheapest->prev_edge ()));
388
387
389
388
update_cheapest (cheapest, route_inf);
390
389
@@ -979,19 +978,22 @@ t_bb ConnectionRouter<Heap>::add_high_fanout_route_tree_to_heap(
979
978
int target_bin_x = grid_to_bin_x (rr_graph_->node_xlow (target_node), spatial_rt_lookup);
980
979
int target_bin_y = grid_to_bin_y (rr_graph_->node_ylow (target_node), spatial_rt_lookup);
981
980
981
+ auto target_layer = rr_graph_->node_layer (target_node);
982
+
982
983
int chan_nodes_added = 0 ;
983
984
984
985
t_bb highfanout_bb;
985
986
highfanout_bb.xmin = rr_graph_->node_xlow (target_node);
986
987
highfanout_bb.xmax = rr_graph_->node_xhigh (target_node);
987
988
highfanout_bb.ymin = rr_graph_->node_ylow (target_node);
988
989
highfanout_bb.ymax = rr_graph_->node_yhigh (target_node);
989
- highfanout_bb.layer_min = rr_graph_-> node_layer (target_node) ;
990
- highfanout_bb.layer_max = rr_graph_-> node_layer (target_node) ;
990
+ highfanout_bb.layer_min = target_layer ;
991
+ highfanout_bb.layer_max = target_layer ;
991
992
992
993
// Add existing routing starting from the target bin.
993
994
// If the target's bin has insufficient existing routing add from the surrounding bins
994
995
bool done = false ;
996
+ bool found_node_on_same_layer = false ;
995
997
for (int dx : {0 , -1 , +1 }) {
996
998
size_t bin_x = target_bin_x + dx;
997
999
@@ -1017,6 +1019,10 @@ t_bb ConnectionRouter<Heap>::add_high_fanout_route_tree_to_heap(
1017
1019
if (!inside_bb (rr_node_to_add, net_bounding_box))
1018
1020
continue ;
1019
1021
1022
+ auto rt_node_layer_num = rr_graph_->node_layer (rr_node_to_add);
1023
+ if (rt_node_layer_num == target_layer)
1024
+ found_node_on_same_layer = true ;
1025
+
1020
1026
// Put the node onto the heap
1021
1027
add_route_tree_node_to_heap (rt_node, target_node, cost_params, net_bounding_box);
1022
1028
@@ -1029,7 +1035,7 @@ t_bb ConnectionRouter<Heap>::add_high_fanout_route_tree_to_heap(
1029
1035
}
1030
1036
1031
1037
constexpr int SINGLE_BIN_MIN_NODES = 2 ;
1032
- if (dx == 0 && dy == 0 && chan_nodes_added > SINGLE_BIN_MIN_NODES) {
1038
+ if (dx == 0 && dy == 0 && chan_nodes_added > SINGLE_BIN_MIN_NODES && found_node_on_same_layer ) {
1033
1039
// Target bin contained at least minimum amount of routing
1034
1040
//
1035
1041
// We require at least SINGLE_BIN_MIN_NODES to be added.
@@ -1043,7 +1049,7 @@ t_bb ConnectionRouter<Heap>::add_high_fanout_route_tree_to_heap(
1043
1049
if (done) break ;
1044
1050
}
1045
1051
1046
- if (chan_nodes_added == 0 ) { // If the target bin, and it's surrounding bins were empty, just add the full route tree
1052
+ if (chan_nodes_added == 0 || !found_node_on_same_layer ) { // If the target bin, and it's surrounding bins were empty, just add the full route tree
1047
1053
add_route_tree_to_heap (rt_root, target_node, cost_params, net_bounding_box);
1048
1054
return net_bounding_box;
1049
1055
} else {
0 commit comments