@@ -25,11 +25,17 @@ static bool relevant_node_to_target(const RRGraphView* rr_graph,
25
25
RRNodeId node_to_add,
26
26
RRNodeId target_node);
27
27
28
- static void update_router_stats ( const DeviceContext& device_ctx,
29
- const RRGraphView* rr_graph ,
30
- RouterStats* router_stats ,
28
+ # ifdef VTR_ENABLE_DEBUG_LOGGING
29
+ static void update_router_stats (RouterStats* router_stats ,
30
+ bool is_push ,
31
31
RRNodeId rr_node_id,
32
- bool is_push);
32
+ const RRGraphView* rr_graph);
33
+ #else
34
+ static void update_router_stats (RouterStats* router_stats,
35
+ bool is_push,
36
+ RRNodeId /* rr_node_id*/ ,
37
+ const RRGraphView* /* rr_graph*/ );
38
+ #endif
33
39
34
40
/* * return tuple <found_path, retry_with_full_bb, cheapest> */
35
41
template <typename Heap>
@@ -73,7 +79,7 @@ std::tuple<bool, t_heap*> ConnectionRouter<Heap>::timing_driven_route_connection
73
79
// Re-add route nodes from the existing route tree to the heap.
74
80
// They need to be repushed onto the heap since each node's cost is target specific.
75
81
76
- add_route_tree_to_heap (rt_root, sink_node, cost_params, false );
82
+ add_route_tree_to_heap (rt_root, sink_node, cost_params);
77
83
heap_.build_heap (); // via sifting down everything
78
84
79
85
RRNodeId source_node = rt_root.inode ;
@@ -137,7 +143,6 @@ std::tuple<bool, bool, t_heap> ConnectionRouter<Heap>::timing_driven_route_conne
137
143
138
144
// re-explore route tree from root to add any new nodes (buildheap afterwards)
139
145
// route tree needs to be repushed onto the heap since each node's cost is target specific
140
- router_stats_->add_high_fanout_rt ++;
141
146
t_bb high_fanout_bb = add_high_fanout_route_tree_to_heap (rt_root, sink_node, cost_params, spatial_rt_lookup, net_bounding_box);
142
147
heap_.build_heap ();
143
148
@@ -215,11 +220,10 @@ t_heap* ConnectionRouter<Heap>::timing_driven_route_connection_from_heap(RRNodeI
215
220
while (!heap_.is_empty_heap ()) {
216
221
// cheapest t_heap in current route tree to be expanded on
217
222
cheapest = heap_.get_heap_head ();
218
- update_router_stats (device_ctx,
219
- rr_graph_,
220
- router_stats_,
223
+ update_router_stats (router_stats_,
224
+ false ,
221
225
cheapest->index ,
222
- false );
226
+ rr_graph_ );
223
227
224
228
RRNodeId inode = cheapest->index ;
225
229
VTR_LOGV_DEBUG (router_debug_, " Popping node %d (cost: %g)\n " ,
@@ -274,7 +278,7 @@ vtr::vector<RRNodeId, t_heap> ConnectionRouter<Heap>::timing_driven_find_all_sho
274
278
275
279
// Add the route tree to the heap with no specific target node
276
280
RRNodeId target_node = RRNodeId::INVALID ();
277
- add_route_tree_to_heap (rt_root, target_node, cost_params, false );
281
+ add_route_tree_to_heap (rt_root, target_node, cost_params);
278
282
heap_.build_heap (); // via sifting down everything
279
283
280
284
auto res = timing_driven_find_all_shortest_paths_from_heap (cost_params, bounding_box);
@@ -305,11 +309,10 @@ vtr::vector<RRNodeId, t_heap> ConnectionRouter<Heap>::timing_driven_find_all_sho
305
309
while (!heap_.is_empty_heap ()) {
306
310
// cheapest t_heap in current route tree to be expanded on
307
311
t_heap* cheapest = heap_.get_heap_head ();
308
- update_router_stats (g_vpr_ctx.device (),
309
- rr_graph_,
310
- router_stats_,
312
+ update_router_stats (router_stats_,
313
+ false ,
311
314
cheapest->index ,
312
- false );
315
+ rr_graph_ );
313
316
314
317
RRNodeId inode = cheapest->index ;
315
318
VTR_LOGV_DEBUG (router_debug_, " Popping node %d (cost: %g)\n " ,
@@ -614,11 +617,10 @@ void ConnectionRouter<Heap>::timing_driven_add_to_heap(const t_conn_cost_params
614
617
}
615
618
616
619
heap_.add_to_heap (next_ptr);
617
- update_router_stats (device_ctx,
618
- rr_graph_,
619
- router_stats_,
620
+ update_router_stats (router_stats_,
621
+ true ,
620
622
to_node,
621
- true );
623
+ rr_graph_ );
622
624
623
625
} else {
624
626
VTR_LOGV_DEBUG (router_debug_, " Didn't expand to %d (%s)\n " , to_node, describe_rr_node (device_ctx.rr_graph , device_ctx.grid , device_ctx.rr_indexed_data , to_node, is_flat_).c_str ());
@@ -852,18 +854,11 @@ template<typename Heap>
852
854
void ConnectionRouter<Heap>::add_route_tree_to_heap(
853
855
const RouteTreeNode& rt_node,
854
856
RRNodeId target_node,
855
- const t_conn_cost_params cost_params,
856
- bool from_high_fanout) {
857
+ const t_conn_cost_params cost_params) {
857
858
/* Puts the entire partial routing below and including rt_node onto the heap *
858
859
* (except for those parts marked as not to be expanded) by calling itself *
859
860
* recursively. */
860
861
861
- if (from_high_fanout) {
862
- router_stats_->add_all_rt_from_high_fanout ++;
863
- } else {
864
- router_stats_->add_all_rt ++;
865
- }
866
-
867
862
/* Pre-order depth-first traversal */
868
863
// IPINs and SINKS are not re_expanded
869
864
if (rt_node.re_expand ) {
@@ -872,8 +867,7 @@ void ConnectionRouter<Heap>::add_route_tree_to_heap(
872
867
}
873
868
add_route_tree_node_to_heap (rt_node,
874
869
target_node,
875
- cost_params,
876
- false );
870
+ cost_params);
877
871
}
878
872
879
873
for (const RouteTreeNode& child_node : rt_node.child_nodes ()) {
@@ -883,14 +877,12 @@ void ConnectionRouter<Heap>::add_route_tree_to_heap(
883
877
target_node)) {
884
878
add_route_tree_to_heap (child_node,
885
879
target_node,
886
- cost_params,
887
- from_high_fanout);
880
+ cost_params);
888
881
}
889
882
} else {
890
883
add_route_tree_to_heap (child_node,
891
884
target_node,
892
- cost_params,
893
- from_high_fanout);
885
+ cost_params);
894
886
}
895
887
}
896
888
}
@@ -903,8 +895,7 @@ template<typename Heap>
903
895
void ConnectionRouter<Heap>::add_route_tree_node_to_heap(
904
896
const RouteTreeNode& rt_node,
905
897
RRNodeId target_node,
906
- const t_conn_cost_params cost_params,
907
- bool is_high_fanout) {
898
+ const t_conn_cost_params cost_params) {
908
899
const auto & device_ctx = g_vpr_ctx.device ();
909
900
const RRNodeId inode = rt_node.inode ;
910
901
float backward_path_cost = cost_params.criticality * rt_node.Tdel ;
@@ -939,18 +930,14 @@ void ConnectionRouter<Heap>::add_route_tree_node_to_heap(
939
930
backward_path_cost, R_upstream, rt_node.Tdel , &rcv_path_manager);
940
931
}
941
932
942
- update_router_stats (device_ctx,
943
- rr_graph_,
944
- router_stats_,
933
+ update_router_stats (router_stats_,
934
+ true ,
945
935
inode,
946
- true );
936
+ rr_graph_ );
947
937
938
+ #ifdef VTR_ENABLE_DEBUG_LOGGING
948
939
router_stats_->rt_node_pushes [rr_graph_->node_type (inode)]++;
949
- if (is_high_fanout) {
950
- router_stats_->rt_node_high_fanout_pushes [rr_graph_->node_type (inode)]++;
951
- } else {
952
- router_stats_->rt_node_entire_tree_pushes [rr_graph_->node_type (inode)]++;
953
- }
940
+ #endif
954
941
}
955
942
956
943
/* Expand bb by inode's extents and clip against net_bb */
@@ -1034,7 +1021,7 @@ t_bb ConnectionRouter<Heap>::add_high_fanout_route_tree_to_heap(
1034
1021
continue ;
1035
1022
}
1036
1023
// Put the node onto the heap
1037
- add_route_tree_node_to_heap (rt_node, target_node, cost_params, true );
1024
+ add_route_tree_node_to_heap (rt_node, target_node, cost_params);
1038
1025
1039
1026
// Expand HF BB to include the node (clip by original BB)
1040
1027
expand_highfanout_bounding_box (highfanout_bb, net_bounding_box, rr_node_to_add, rr_graph_);
@@ -1065,7 +1052,7 @@ t_bb ConnectionRouter<Heap>::add_high_fanout_route_tree_to_heap(
1065
1052
}
1066
1053
1067
1054
if (nodes_added == 0 ) { // If the target bin, and it's surrounding bins were empty, just add the full route tree
1068
- add_route_tree_to_heap (rt_root, target_node, cost_params, true );
1055
+ add_route_tree_to_heap (rt_root, target_node, cost_params);
1069
1056
return net_bounding_box;
1070
1057
} else {
1071
1058
// We found nearby routing, replace original bounding box to be localized around that routing
@@ -1113,17 +1100,25 @@ static inline bool relevant_node_to_target(const RRGraphView* rr_graph,
1113
1100
return false ;
1114
1101
}
1115
1102
1116
- static inline void update_router_stats ( const DeviceContext& device_ctx,
1117
- const RRGraphView* rr_graph ,
1118
- RouterStats* router_stats ,
1103
+ # ifdef VTR_ENABLE_DEBUG_LOGGING
1104
+ static inline void update_router_stats (RouterStats* router_stats ,
1105
+ bool is_push ,
1119
1106
RRNodeId rr_node_id,
1120
- bool is_push) {
1107
+ const RRGraphView* rr_graph) {
1108
+ #else
1109
+ static inline void update_router_stats (RouterStats* router_stats,
1110
+ bool is_push,
1111
+ RRNodeId /* rr_node_id*/ ,
1112
+ const RRGraphView* /* rr_graph*/ ) {
1113
+ #endif
1121
1114
if (is_push) {
1122
1115
router_stats->heap_pushes ++;
1123
1116
} else {
1124
1117
router_stats->heap_pops ++;
1125
1118
}
1126
1119
1120
+ #ifdef VTR_ENABLE_DEBUG_LOGGING
1121
+ const auto & device_ctx = g_vpr_ctx.device ();
1127
1122
auto node_type = rr_graph->node_type (rr_node_id);
1128
1123
VTR_ASSERT (node_type != NUM_RR_TYPES);
1129
1124
t_physical_tile_type_ptr physical_type = device_ctx.grid .get_physical_type ({rr_graph->node_xlow (rr_node_id),
@@ -1150,6 +1145,7 @@ static inline void update_router_stats(const DeviceContext& device_ctx,
1150
1145
router_stats->intra_cluster_node_type_cnt_pops [node_type]++;
1151
1146
}
1152
1147
}
1148
+ #endif
1153
1149
}
1154
1150
1155
1151
std::unique_ptr<ConnectionRouterInterface> make_connection_router (e_heap_type heap_type,
0 commit comments