From 2064d55ecd5d4b4ee3a681156e3443f3f3be96b2 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 29 Nov 2023 10:05:30 -0500 Subject: [PATCH 1/7] show extra routing stats only if debug_logging is enabled --- vpr/src/route/route.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vpr/src/route/route.cpp b/vpr/src/route/route.cpp index 469a0455006..f95bf96433c 100644 --- a/vpr/src/route/route.cpp +++ b/vpr/src/route/route.cpp @@ -601,9 +601,11 @@ bool route(const Netlist<>& net_list, VTR_ASSERT(router_stats.heap_pushes >= router_stats.intra_cluster_node_pushes); VTR_ASSERT(router_stats.heap_pops >= router_stats.intra_cluster_node_pops); VTR_LOG( - "Router Stats: total_nets_routed: %zu total_connections_routed: %zu total_heap_pushes: %zu total_heap_pops: %zu " + "Router Stats: total_nets_routed: %zu total_connections_routed: %zu total_heap_pushes: %zu total_heap_pops: %zu ", + router_stats.nets_routed, router_stats.connections_routed, router_stats.heap_pushes, router_stats.heap_pops); +#ifdef VTR_ENABLE_DEBUG_LOGGING + VTR_LOG( "total_internal_heap_pushes: %zu total_internal_heap_pops: %zu total_external_heap_pushes: %zu total_external_heap_pops: %zu ", - router_stats.nets_routed, router_stats.connections_routed, router_stats.heap_pushes, router_stats.heap_pops, router_stats.intra_cluster_node_pushes, router_stats.intra_cluster_node_pops, router_stats.inter_cluster_node_pushes, router_stats.inter_cluster_node_pops); for (int node_type_idx = 0; node_type_idx < t_rr_type::NUM_RR_TYPES; node_type_idx++) { @@ -619,6 +621,7 @@ bool route(const Netlist<>& net_list, VTR_LOG("total_number_of_adding_all_rt: %zu ", router_stats.add_all_rt); VTR_LOG("total_number_of_adding_high_fanout_rt: %zu ", router_stats.add_high_fanout_rt); VTR_LOG("total_number_of_adding_all_rt_from_calling_high_fanout_rt: %zu ", router_stats.add_all_rt_from_high_fanout); +#endif VTR_LOG("\n"); return success; From 3217d739c54e6f98b1d308da7aef0d63416e0b64 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 29 Nov 2023 10:09:20 -0500 Subject: [PATCH 2/7] remove total_internal/ext rt_push/pop from parsing files --- .../common/vpr.route_fixed_chan_width.txt | 53 ------------------- .../timing/vpr.route_relaxed_chan_width.txt | 39 -------------- 2 files changed, 92 deletions(-) diff --git a/vtr_flow/parse/parse_config/common/vpr.route_fixed_chan_width.txt b/vtr_flow/parse/parse_config/common/vpr.route_fixed_chan_width.txt index 4e3c11b458a..a71f259d7a8 100644 --- a/vtr_flow/parse/parse_config/common/vpr.route_fixed_chan_width.txt +++ b/vtr_flow/parse/parse_config/common/vpr.route_fixed_chan_width.txt @@ -8,59 +8,6 @@ total_nets_routed;vpr.out;Router Stats: total_nets_routed: (\d+) .* total_connections_routed;vpr.out;Router Stats: .*total_connections_routed: (\d+) .* total_heap_pushes;vpr.out;Router Stats: .*total_heap_pushes: (\d+) .* total_heap_pops;vpr.out;Router Stats: .*total_heap_pops: (\d+) -total_internal_heap_pushes;vpr.out;Router Stats: .*total_internal_heap_pushes: (\d+) .* -total_internal_heap_pops;vpr.out;Router Stats: .*total_internal_heap_pops: (\d+) .* -total_external_heap_pushes;vpr.out;Router Stats: .*total_external_heap_pushes: (\d+) .* -total_external_heap_pops;vpr.out;Router Stats: .*total_external_heap_pops: (\d+) .* -total_external_SOURCE_pushes;vpr.out;Router Stats: .*total_external_SOURCE_pushes: (\d+) .* -total_external_SOURCE_pops;vpr.out;Router Stats: .*total_external_SOURCE_pops: (\d+) .* -total_internal_SOURCE_pushes;vpr.out;Router Stats: .*total_internal_SOURCE_pushes: (\d+) .* -total_internal_SOURCE_pops;vpr.out;Router Stats: .*total_internal_SOURCE_pops: (\d+) .* -total_external_SINK_pushes;vpr.out;Router Stats: .*total_external_SINK_pushes: (\d+) .* -total_external_SINK_pops;vpr.out;Router Stats: .*total_external_SINK_pops: (\d+) .* -total_internal_SINK_pushes;vpr.out;Router Stats: .*total_internal_SINK_pushes: (\d+) .* -total_internal_SINK_pops;vpr.out;Router Stats: .*total_internal_SINK_pops: (\d+) .* -total_external_IPIN_pushes;vpr.out;Router Stats: .*total_external_IPIN_pushes: (\d+) .* -total_external_IPIN_pops;vpr.out;Router Stats: .*total_external_IPIN_pops: (\d+) .* -total_internal_IPIN_pushes;vpr.out;Router Stats: .*total_internal_IPIN_pushes: (\d+) .* -total_internal_IPIN_pops;vpr.out;Router Stats: .*total_internal_IPIN_pops: (\d+) .* -total_external_OPIN_pushes;vpr.out;Router Stats: .*total_external_OPIN_pushes: (\d+) .* -total_external_OPIN_pops;vpr.out;Router Stats: .*total_external_OPIN_pops: (\d+) .* -total_internal_OPIN_pushes;vpr.out;Router Stats: .*total_internal_OPIN_pushes: (\d+) .* -total_internal_OPIN_pops;vpr.out;Router Stats: .*total_internal_OPIN_pops: (\d+) .* -total_external_CHANX_pushes;vpr.out;Router Stats: .*total_external_CHANX_pushes: (\d+) .* -total_external_CHANX_pops;vpr.out;Router Stats: .*total_external_CHANX_pops: (\d+) .* -total_internal_CHANX_pushes;vpr.out;Router Stats: .*total_internal_CHANX_pushes: (\d+) .* -total_internal_CHANX_pops;vpr.out;Router Stats: .*total_internal_CHANX_pops: (\d+) .* -total_external_CHANY_pushes;vpr.out;Router Stats: .*total_external_CHANY_pushes: (\d+) .* -total_external_CHANY_pops;vpr.out;Router Stats: .*total_external_CHANY_pops: (\d+) .* -total_internal_CHANY_pushes;vpr.out;Router Stats: .*total_internal_CHANY_pushes: (\d+) .* -total_internal_CHANY_pops;vpr.out;Router Stats: .*total_internal_CHANY_pops: (\d+) .* - -rt_node_SOURCE_pushes;vpr.out;Router Stats: .*rt_node_SOURCE_pushes: (\d+) .* -rt_node_SINK_pushes;vpr.out;Router Stats: .*rt_node_SINK_pushes: (\d+) .* -rt_node_IPIN_pushes;vpr.out;Router Stats: .*rt_node_IPIN_pushes: (\d+) .* -rt_node_OPIN_pushes;vpr.out;Router Stats: .*rt_node_OPIN_pushes: (\d+) .* -rt_node_CHANX_pushes;vpr.out;Router Stats: .*rt_node_CHANX_pushes: (\d+) .* -rt_node_CHANY_pushes;vpr.out;Router Stats: .*rt_node_CHANY_pushes: (\d+) .* - -rt_node_SOURCE_high_fanout_pushes;vpr.out;Router Stats: .*rt_node_SOURCE_high_fanout_pushes: (\d+) .* -rt_node_SINK_high_fanout_pushes;vpr.out;Router Stats: .*rt_node_SINK_high_fanout_pushes: (\d+) .* -rt_node_IPIN_high_fanout_pushes;vpr.out;Router Stats: .*rt_node_IPIN_high_fanout_pushes: (\d+) .* -rt_node_OPIN_high_fanout_pushes;vpr.out;Router Stats: .*rt_node_OPIN_high_fanout_pushes: (\d+) .* -rt_node_CHANX_high_fanout_pushes;vpr.out;Router Stats: .*rt_node_CHANX_high_fanout_pushes: (\d+) .* -rt_node_CHANY_high_fanout_pushes;vpr.out;Router Stats: .*rt_node_CHANY_high_fanout_pushes: (\d+) .* - -rt_node_SOURCE_entire_tree_pushes;vpr.out;Router Stats: .*rt_node_SOURCE_entire_tree_pushes: (\d+) .* -rt_node_SINK_entire_tree_pushes;vpr.out;Router Stats: .*rt_node_SINK_entire_tree_pushes: (\d+) .* -rt_node_IPIN_entire_tree_pushes;vpr.out;Router Stats: .*rt_node_IPIN_entire_tree_pushes: (\d+) .* -rt_node_OPIN_entire_tree_pushes;vpr.out;Router Stats: .*rt_node_OPIN_entire_tree_pushes: (\d+) .* -rt_node_CHANX_entire_tree_pushes;vpr.out;Router Stats: .*rt_node_CHANX_entire_tree_pushes: (\d+) .* -rt_node_CHANY_entire_tree_pushes;vpr.out;Router Stats: .*rt_node_CHANY_entire_tree_pushes: (\d+) .* - -adding_all_rt;vpr.out;Router Stats: .*total_number_of_adding_all_rt: (\d+) .* -adding_high_fanout_rt;vpr.out;Router Stats: .*total_number_of_adding_high_fanout_rt: (\d+) .* -total_number_of_adding_all_rt_from_calling_high_fanout_rt;vpr.out;Router Stats: .*total_number_of_adding_all_rt_from_calling_high_fanout_rt: (\d+) .* #Area Metrics logic_block_area_total;vpr.out;\s*Total logic block area .*: (.*) diff --git a/vtr_flow/parse/parse_config/timing/vpr.route_relaxed_chan_width.txt b/vtr_flow/parse/parse_config/timing/vpr.route_relaxed_chan_width.txt index b2e2a9dd304..d13e1d74491 100644 --- a/vtr_flow/parse/parse_config/timing/vpr.route_relaxed_chan_width.txt +++ b/vtr_flow/parse/parse_config/timing/vpr.route_relaxed_chan_width.txt @@ -11,45 +11,6 @@ crit_path_total_nets_routed;vpr.crit_path.out;.* total_nets_routed: (\d+) crit_path_total_connections_routed;vpr.crit_path.out;.* total_connections_routed: (\d+) crit_path_total_heap_pushes;vpr.crit_path.out;.* total_heap_pushes: (\d+) crit_path_total_heap_pops;vpr.crit_path.out;.* total_heap_pops: (\d+) -crit_path_total_internal_heap_pushes;vpr.crit_path.out;Router Stats: .*total_internal_heap_pushes: (\d+) .* -crit_path_total_internal_heap_pops;vpr.crit_path.out;Router Stats: .*total_internal_heap_pops: (\d+) .* -crit_path_total_external_heap_pushes;vpr.crit_path.out;Router Stats: .*total_external_heap_pushes: (\d+) .* -crit_path_total_external_heap_pops;vpr.crit_path.out;Router Stats: .*total_external_heap_pops: (\d+) .* -crit_path_total_external_SOURCE_pushes;vpr.crit_path.out;Router Stats: .*total_external_SOURCE_pushes: (\d+) .* -crit_path_total_external_SOURCE_pops;vpr.crit_path.out;Router Stats: .*total_external_SOURCE_pops: (\d+) .* -crit_path_total_internal_SOURCE_pushes;vpr.crit_path.out;Router Stats: .*total_internal_SOURCE_pushes: (\d+) .* -crit_path_total_internal_SOURCE_pops;vpr.crit_path.out;Router Stats: .*total_internal_SOURCE_pops: (\d+) .* -crit_path_total_external_SINK_pushes;vpr.crit_path.out;Router Stats: .*total_external_SINK_pushes: (\d+) .* -crit_path_total_external_SINK_pops;vpr.crit_path.out;Router Stats: .*total_external_SINK_pops: (\d+) .* -crit_path_total_internal_SINK_pushes;vpr.crit_path.out;Router Stats: .*total_internal_SINK_pushes: (\d+) .* -crit_path_total_internal_SINK_pops;vpr.crit_path.out;Router Stats: .*total_internal_SINK_pops: (\d+) .* -crit_path_total_external_IPIN_pushes;vpr.crit_path.out;Router Stats: .*total_external_IPIN_pushes: (\d+) .* -crit_path_total_external_IPIN_pops;vpr.crit_path.out;Router Stats: .*total_external_IPIN_pops: (\d+) .* -crit_path_total_internal_IPIN_pushes;vpr.crit_path.out;Router Stats: .*total_internal_IPIN_pushes: (\d+) .* -crit_path_total_internal_IPIN_pops;vpr.crit_path.out;Router Stats: .*total_internal_IPIN_pops: (\d+) .* -crit_path_total_external_OPIN_pushes;vpr.crit_path.out;Router Stats: .*total_external_OPIN_pushes: (\d+) .* -crit_path_total_external_OPIN_pops;vpr.crit_path.out;Router Stats: .*total_external_OPIN_pops: (\d+) .* -crit_path_total_internal_OPIN_pushes;vpr.crit_path.out;Router Stats: .*total_internal_OPIN_pushes: (\d+) .* -crit_path_total_internal_OPIN_pops;vpr.crit_path.out;Router Stats: .*total_internal_OPIN_pops: (\d+) .* -crit_path_total_external_CHANX_pushes;vpr.crit_path.out;Router Stats: .*total_external_CHANX_pushes: (\d+) .* -crit_path_total_external_CHANX_pops;vpr.crit_path.out;Router Stats: .*total_external_CHANX_pops: (\d+) .* -crit_path_total_internal_CHANX_pushes;vpr.crit_path.out;Router Stats: .*total_internal_CHANX_pushes: (\d+) .* -crit_path_total_internal_CHANX_pops;vpr.crit_path.out;Router Stats: .*total_internal_CHANX_pops: (\d+) .* -crit_path_total_external_CHANY_pushes;vpr.crit_path.out;Router Stats: .*total_external_CHANY_pushes: (\d+) .* -crit_path_total_external_CHANY_pops;vpr.crit_path.out;Router Stats: .*total_external_CHANY_pops: (\d+) .* -crit_path_total_internal_CHANY_pushes;vpr.crit_path.out;Router Stats: .*total_internal_CHANY_pushes: (\d+) .* -crit_path_total_internal_CHANY_pops;vpr.crit_path.out;Router Stats: .*total_internal_CHANY_pops: (\d+) .* - -crit_path_rt_node_SOURCE_pushes;vpr.crit_path.out;Router Stats: .*rt_node_SOURCE_pushes: (\d+) .* -crit_path_rt_node_SINK_pushes;vpr.crit_path.out;Router Stats: .*rt_node_SINK_pushes: (\d+) .* -crit_path_rt_node_IPIN_pushes;vpr.crit_path.out;Router Stats: .*rt_node_IPIN_pushes: (\d+) .* -crit_path_rt_node_OPIN_pushes;vpr.crit_path.out;Router Stats: .*rt_node_OPIN_pushes: (\d+) .* -crit_path_rt_node_CHANX_pushes;vpr.crit_path.out;Router Stats: .*rt_node_CHANX_pushes: (\d+) .* -crit_path_rt_node_CHANY_pushes;vpr.crit_path.out;Router Stats: .*rt_node_CHANY_pushes: (\d+) .* - -crit_path_adding_all_rt;vpr.crit_path.out;Router Stats: .*total_number_of_adding_all_rt: (\d+) .* -crit_path_adding_high_fanout_rt;vpr.crit_path.out;Router Stats: .*total_number_of_adding_high_fanout_rt: (\d+) .* -crit_path_total_number_of_adding_all_rt_from_calling_high_fanout_rt;vpr.crit_path.out;Router Stats: .*total_number_of_adding_all_rt_from_calling_high_fanout_rt: (\d+) #VPR Analysis (final implementation) Metrics critical_path_delay;vpr.crit_path.out;Final critical path delay \(least slack\): (.*) ns From 56010c1d83df360424e18a7f86367dac08361c06 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 29 Nov 2023 10:58:25 -0500 Subject: [PATCH 3/7] remove recording rt node counter --- vpr/src/route/connection_router.cpp | 31 ++++++++++------------------- vpr/src/route/connection_router.h | 3 +-- vpr/src/route/route.cpp | 6 ------ vpr/src/route/router_stats.h | 11 ---------- 4 files changed, 11 insertions(+), 40 deletions(-) diff --git a/vpr/src/route/connection_router.cpp b/vpr/src/route/connection_router.cpp index 829ef935f0d..c754d409ff4 100644 --- a/vpr/src/route/connection_router.cpp +++ b/vpr/src/route/connection_router.cpp @@ -73,7 +73,7 @@ std::tuple ConnectionRouter::timing_driven_route_connection //Re-add route nodes from the existing route tree to the heap. //They need to be repushed onto the heap since each node's cost is target specific. - add_route_tree_to_heap(rt_root, sink_node, cost_params, false); + add_route_tree_to_heap(rt_root, sink_node, cost_params); heap_.build_heap(); // via sifting down everything RRNodeId source_node = rt_root.inode; @@ -137,7 +137,6 @@ std::tuple ConnectionRouter::timing_driven_route_conne // re-explore route tree from root to add any new nodes (buildheap afterwards) // route tree needs to be repushed onto the heap since each node's cost is target specific - router_stats_->add_high_fanout_rt++; t_bb high_fanout_bb = add_high_fanout_route_tree_to_heap(rt_root, sink_node, cost_params, spatial_rt_lookup, net_bounding_box); heap_.build_heap(); @@ -274,7 +273,7 @@ vtr::vector ConnectionRouter::timing_driven_find_all_sho // Add the route tree to the heap with no specific target node RRNodeId target_node = RRNodeId::INVALID(); - add_route_tree_to_heap(rt_root, target_node, cost_params, false); + add_route_tree_to_heap(rt_root, target_node, cost_params); heap_.build_heap(); // via sifting down everything auto res = timing_driven_find_all_shortest_paths_from_heap(cost_params, bounding_box); @@ -852,18 +851,11 @@ template void ConnectionRouter::add_route_tree_to_heap( const RouteTreeNode& rt_node, RRNodeId target_node, - const t_conn_cost_params cost_params, - bool from_high_fanout) { + const t_conn_cost_params cost_params) { /* Puts the entire partial routing below and including rt_node onto the heap * * (except for those parts marked as not to be expanded) by calling itself * * recursively. */ - if (from_high_fanout) { - router_stats_->add_all_rt_from_high_fanout++; - } else { - router_stats_->add_all_rt++; - } - /* Pre-order depth-first traversal */ // IPINs and SINKS are not re_expanded if (rt_node.re_expand) { @@ -883,14 +875,12 @@ void ConnectionRouter::add_route_tree_to_heap( target_node)) { add_route_tree_to_heap(child_node, target_node, - cost_params, - from_high_fanout); + cost_params); } } else { add_route_tree_to_heap(child_node, target_node, - cost_params, - from_high_fanout); + cost_params); } } } @@ -945,12 +935,9 @@ void ConnectionRouter::add_route_tree_node_to_heap( inode, true); +#ifdef VTR_ENABLE_DEBUG_LOGGING router_stats_->rt_node_pushes[rr_graph_->node_type(inode)]++; - if (is_high_fanout) { - router_stats_->rt_node_high_fanout_pushes[rr_graph_->node_type(inode)]++; - } else { - router_stats_->rt_node_entire_tree_pushes[rr_graph_->node_type(inode)]++; - } +#endif } /* Expand bb by inode's extents and clip against net_bb */ @@ -1065,7 +1052,7 @@ t_bb ConnectionRouter::add_high_fanout_route_tree_to_heap( } if (nodes_added == 0) { //If the target bin, and it's surrounding bins were empty, just add the full route tree - add_route_tree_to_heap(rt_root, target_node, cost_params, true); + add_route_tree_to_heap(rt_root, target_node, cost_params); return net_bounding_box; } else { //We found nearby routing, replace original bounding box to be localized around that routing @@ -1124,6 +1111,7 @@ static inline void update_router_stats(const DeviceContext& device_ctx, router_stats->heap_pops++; } +#ifdef VTR_ENABLE_DEBUG_LOGGING auto node_type = rr_graph->node_type(rr_node_id); VTR_ASSERT(node_type != NUM_RR_TYPES); t_physical_tile_type_ptr physical_type = device_ctx.grid.get_physical_type({rr_graph->node_xlow(rr_node_id), @@ -1150,6 +1138,7 @@ static inline void update_router_stats(const DeviceContext& device_ctx, router_stats->intra_cluster_node_type_cnt_pops[node_type]++; } } +#endif } std::unique_ptr make_connection_router(e_heap_type heap_type, diff --git a/vpr/src/route/connection_router.h b/vpr/src/route/connection_router.h index b2806f41775..259e82a77d6 100644 --- a/vpr/src/route/connection_router.h +++ b/vpr/src/route/connection_router.h @@ -239,8 +239,7 @@ class ConnectionRouter : public ConnectionRouterInterface { //used as branch-points for further routing. void add_route_tree_to_heap(const RouteTreeNode& rt_node, RRNodeId target_node, - const t_conn_cost_params cost_params, - bool from_high_fanout); + const t_conn_cost_params cost_params); // Evaluate node costs using the RCV algorith float compute_node_cost_using_rcv(const t_conn_cost_params cost_params, diff --git a/vpr/src/route/route.cpp b/vpr/src/route/route.cpp index f95bf96433c..6f36be9866e 100644 --- a/vpr/src/route/route.cpp +++ b/vpr/src/route/route.cpp @@ -614,13 +614,7 @@ bool route(const Netlist<>& net_list, VTR_LOG("total_internal_%s_pushes: %zu ", rr_node_typename[node_type_idx], router_stats.intra_cluster_node_type_cnt_pushes[node_type_idx]); VTR_LOG("total_internal_%s_pops: %zu ", rr_node_typename[node_type_idx], router_stats.intra_cluster_node_type_cnt_pops[node_type_idx]); VTR_LOG("rt_node_%s_pushes: %zu ", rr_node_typename[node_type_idx], router_stats.rt_node_pushes[node_type_idx]); - VTR_LOG("rt_node_%s_high_fanout_pushes: %zu ", rr_node_typename[node_type_idx], router_stats.rt_node_high_fanout_pushes[node_type_idx]); - VTR_LOG("rt_node_%s_entire_tree_pushes: %zu ", rr_node_typename[node_type_idx], router_stats.rt_node_entire_tree_pushes[node_type_idx]); } - - VTR_LOG("total_number_of_adding_all_rt: %zu ", router_stats.add_all_rt); - VTR_LOG("total_number_of_adding_high_fanout_rt: %zu ", router_stats.add_high_fanout_rt); - VTR_LOG("total_number_of_adding_all_rt_from_calling_high_fanout_rt: %zu ", router_stats.add_all_rt_from_high_fanout); #endif VTR_LOG("\n"); diff --git a/vpr/src/route/router_stats.h b/vpr/src/route/router_stats.h index 4f999a722d1..b1015f45ac9 100644 --- a/vpr/src/route/router_stats.h +++ b/vpr/src/route/router_stats.h @@ -45,12 +45,6 @@ struct RouterStats { // For debugging purposes size_t rt_node_pushes[t_rr_type::NUM_RR_TYPES] = {0}; - size_t rt_node_high_fanout_pushes[t_rr_type::NUM_RR_TYPES] = {0}; - size_t rt_node_entire_tree_pushes[t_rr_type::NUM_RR_TYPES] = {0}; - - size_t add_all_rt_from_high_fanout = 0; - size_t add_high_fanout_rt = 0; - size_t add_all_rt = 0; /** Add rhs's stats to mine */ void combine(RouterStats& rhs) { @@ -68,12 +62,7 @@ struct RouterStats { intra_cluster_node_type_cnt_pushes[node_type_idx] += rhs.intra_cluster_node_type_cnt_pushes[node_type_idx]; intra_cluster_node_type_cnt_pops[node_type_idx] += rhs.intra_cluster_node_type_cnt_pops[node_type_idx]; rt_node_pushes[node_type_idx] += rhs.rt_node_pushes[node_type_idx]; - rt_node_high_fanout_pushes[node_type_idx] += rhs.rt_node_high_fanout_pushes[node_type_idx]; - rt_node_entire_tree_pushes[node_type_idx] += rhs.rt_node_entire_tree_pushes[node_type_idx]; } - add_all_rt += rhs.add_all_rt; - add_all_rt_from_high_fanout += rhs.add_all_rt_from_high_fanout; - add_high_fanout_rt += rhs.add_high_fanout_rt; } }; From e5186979b9337c7018e7e822502c5ace1eace728 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 29 Nov 2023 11:18:24 -0500 Subject: [PATCH 4/7] remove an unused parameter from add_route_tree_node_to_heap --- vpr/src/route/connection_router.cpp | 8 +++----- vpr/src/route/connection_router.h | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/vpr/src/route/connection_router.cpp b/vpr/src/route/connection_router.cpp index c754d409ff4..95607c2369a 100644 --- a/vpr/src/route/connection_router.cpp +++ b/vpr/src/route/connection_router.cpp @@ -864,8 +864,7 @@ void ConnectionRouter::add_route_tree_to_heap( } add_route_tree_node_to_heap(rt_node, target_node, - cost_params, - false); + cost_params); } for (const RouteTreeNode& child_node : rt_node.child_nodes()) { @@ -893,8 +892,7 @@ template void ConnectionRouter::add_route_tree_node_to_heap( const RouteTreeNode& rt_node, RRNodeId target_node, - const t_conn_cost_params cost_params, - bool is_high_fanout) { + const t_conn_cost_params cost_params) { const auto& device_ctx = g_vpr_ctx.device(); const RRNodeId inode = rt_node.inode; float backward_path_cost = cost_params.criticality * rt_node.Tdel; @@ -1021,7 +1019,7 @@ t_bb ConnectionRouter::add_high_fanout_route_tree_to_heap( continue; } // Put the node onto the heap - add_route_tree_node_to_heap(rt_node, target_node, cost_params, true); + add_route_tree_node_to_heap(rt_node, target_node, cost_params); // Expand HF BB to include the node (clip by original BB) expand_highfanout_bounding_box(highfanout_bb, net_bounding_box, rr_node_to_add, rr_graph_); diff --git a/vpr/src/route/connection_router.h b/vpr/src/route/connection_router.h index 259e82a77d6..7a306304843 100644 --- a/vpr/src/route/connection_router.h +++ b/vpr/src/route/connection_router.h @@ -256,8 +256,7 @@ class ConnectionRouter : public ConnectionRouterInterface { void add_route_tree_node_to_heap( const RouteTreeNode& rt_node, RRNodeId target_node, - const t_conn_cost_params cost_params, - bool is_high_fanout); + const t_conn_cost_params cost_params); t_bb add_high_fanout_route_tree_to_heap( const RouteTreeNode& rt_root, From 7812addec9f010f6d7934132e20268de7554a557 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 29 Nov 2023 20:19:50 -0500 Subject: [PATCH 5/7] change update_router_stats parameter list if enable debug logging is not enabled --- vpr/src/route/connection_router.cpp | 39 ++++++++++++++++++----------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/vpr/src/route/connection_router.cpp b/vpr/src/route/connection_router.cpp index 95607c2369a..226bed70c8b 100644 --- a/vpr/src/route/connection_router.cpp +++ b/vpr/src/route/connection_router.cpp @@ -25,11 +25,17 @@ static bool relevant_node_to_target(const RRGraphView* rr_graph, RRNodeId node_to_add, RRNodeId target_node); -static void update_router_stats(const DeviceContext& device_ctx, - const RRGraphView* rr_graph, - RouterStats* router_stats, - RRNodeId rr_node_id, - bool is_push); +#ifdef VTR_ENABLE_DEBUG_LOGGING +static void update_router_stats(const RRGraphView* rr_graph, + RouterStats* router_stats, + RRNodeId rr_node_id, + bool is_push); +#else +static void update_router_stats(const RRGraphView* /*rr_graph*/, + RouterStats* router_stats, + RRNodeId /*rr_node_id*/, + bool is_push); +#endif /** return tuple */ template @@ -214,8 +220,7 @@ t_heap* ConnectionRouter::timing_driven_route_connection_from_heap(RRNodeI while (!heap_.is_empty_heap()) { // cheapest t_heap in current route tree to be expanded on cheapest = heap_.get_heap_head(); - update_router_stats(device_ctx, - rr_graph_, + update_router_stats(rr_graph_, router_stats_, cheapest->index, false); @@ -304,8 +309,7 @@ vtr::vector ConnectionRouter::timing_driven_find_all_sho while (!heap_.is_empty_heap()) { // cheapest t_heap in current route tree to be expanded on t_heap* cheapest = heap_.get_heap_head(); - update_router_stats(g_vpr_ctx.device(), - rr_graph_, + update_router_stats(rr_graph_, router_stats_, cheapest->index, false); @@ -613,8 +617,7 @@ void ConnectionRouter::timing_driven_add_to_heap(const t_conn_cost_params } heap_.add_to_heap(next_ptr); - update_router_stats(device_ctx, - rr_graph_, + update_router_stats(rr_graph_, router_stats_, to_node, true); @@ -927,8 +930,7 @@ void ConnectionRouter::add_route_tree_node_to_heap( backward_path_cost, R_upstream, rt_node.Tdel, &rcv_path_manager); } - update_router_stats(device_ctx, - rr_graph_, + update_router_stats(rr_graph_, router_stats_, inode, true); @@ -1098,11 +1100,17 @@ static inline bool relevant_node_to_target(const RRGraphView* rr_graph, return false; } -static inline void update_router_stats(const DeviceContext& device_ctx, - const RRGraphView* rr_graph, +#ifdef VTR_ENABLE_DEBUG_LOGGING +static inline void update_router_stats(const RRGraphView* rr_graph, RouterStats* router_stats, RRNodeId rr_node_id, bool is_push) { +#else +static inline void update_router_stats(const RRGraphView* /*rr_graph*/, + RouterStats* router_stats, + RRNodeId /*rr_node_id*/, + bool is_push) { +#endif if (is_push) { router_stats->heap_pushes++; } else { @@ -1110,6 +1118,7 @@ static inline void update_router_stats(const DeviceContext& device_ctx, } #ifdef VTR_ENABLE_DEBUG_LOGGING + const auto& device_ctx = g_vpr_ctx.device(); auto node_type = rr_graph->node_type(rr_node_id); VTR_ASSERT(node_type != NUM_RR_TYPES); t_physical_tile_type_ptr physical_type = device_ctx.grid.get_physical_type({rr_graph->node_xlow(rr_node_id), From 664d333588041638d6098938d3b9ac60b3c4f088 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Fri, 1 Dec 2023 17:50:25 -0500 Subject: [PATCH 6/7] change the parameter order of update_router_stats so the used parameter are first --- vpr/src/route/connection_router.cpp | 52 ++++++++++++++--------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/vpr/src/route/connection_router.cpp b/vpr/src/route/connection_router.cpp index 226bed70c8b..14436549641 100644 --- a/vpr/src/route/connection_router.cpp +++ b/vpr/src/route/connection_router.cpp @@ -26,15 +26,15 @@ static bool relevant_node_to_target(const RRGraphView* rr_graph, RRNodeId target_node); #ifdef VTR_ENABLE_DEBUG_LOGGING -static void update_router_stats(const RRGraphView* rr_graph, - RouterStats* router_stats, - RRNodeId rr_node_id, - bool is_push); +static void update_router_stats(RouterStats* router_stats, + bool is_push, + RRNodeId rr_node_id, + const RRGraphView* rr_graph); #else -static void update_router_stats(const RRGraphView* /*rr_graph*/, - RouterStats* router_stats, - RRNodeId /*rr_node_id*/, - bool is_push); +static void update_router_stats(RouterStats* router_stats, + bool is_push, + RRNodeId /*rr_node_id*/, + const RRGraphView* /*rr_graph*/); #endif /** return tuple */ @@ -220,10 +220,10 @@ t_heap* ConnectionRouter::timing_driven_route_connection_from_heap(RRNodeI while (!heap_.is_empty_heap()) { // cheapest t_heap in current route tree to be expanded on cheapest = heap_.get_heap_head(); - update_router_stats(rr_graph_, - router_stats_, + update_router_stats(router_stats_, + false, cheapest->index, - false); + rr_graph_); RRNodeId inode = cheapest->index; VTR_LOGV_DEBUG(router_debug_, " Popping node %d (cost: %g)\n", @@ -309,10 +309,10 @@ vtr::vector ConnectionRouter::timing_driven_find_all_sho while (!heap_.is_empty_heap()) { // cheapest t_heap in current route tree to be expanded on t_heap* cheapest = heap_.get_heap_head(); - update_router_stats(rr_graph_, - router_stats_, + update_router_stats(router_stats_, + false, cheapest->index, - false); + rr_graph_); RRNodeId inode = cheapest->index; VTR_LOGV_DEBUG(router_debug_, " Popping node %d (cost: %g)\n", @@ -617,10 +617,10 @@ void ConnectionRouter::timing_driven_add_to_heap(const t_conn_cost_params } heap_.add_to_heap(next_ptr); - update_router_stats(rr_graph_, - router_stats_, + update_router_stats(router_stats_, + true, to_node, - true); + rr_graph_); } else { 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()); @@ -930,10 +930,10 @@ void ConnectionRouter::add_route_tree_node_to_heap( backward_path_cost, R_upstream, rt_node.Tdel, &rcv_path_manager); } - update_router_stats(rr_graph_, - router_stats_, + update_router_stats(router_stats_, + true, inode, - true); + rr_graph_); #ifdef VTR_ENABLE_DEBUG_LOGGING router_stats_->rt_node_pushes[rr_graph_->node_type(inode)]++; @@ -1101,15 +1101,15 @@ static inline bool relevant_node_to_target(const RRGraphView* rr_graph, } #ifdef VTR_ENABLE_DEBUG_LOGGING -static inline void update_router_stats(const RRGraphView* rr_graph, - RouterStats* router_stats, +static inline void update_router_stats(RouterStats* router_stats, + bool is_push, RRNodeId rr_node_id, - bool is_push) { + const RRGraphView* rr_graph,) { #else -static inline void update_router_stats(const RRGraphView* /*rr_graph*/, - RouterStats* router_stats, +static inline void update_router_stats(RouterStats* router_stats, + bool is_push, RRNodeId /*rr_node_id*/, - bool is_push) { + const RRGraphView* /*rr_graph*/) { #endif if (is_push) { router_stats->heap_pushes++; From 024fd369627a3e27d008b0b90adff544ca157d8c Mon Sep 17 00:00:00 2001 From: amin1377 Date: Sat, 2 Dec 2023 09:58:17 -0500 Subject: [PATCH 7/7] remove redundant comma --- vpr/src/route/connection_router.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/route/connection_router.cpp b/vpr/src/route/connection_router.cpp index 14436549641..34376dc1d9d 100644 --- a/vpr/src/route/connection_router.cpp +++ b/vpr/src/route/connection_router.cpp @@ -1104,7 +1104,7 @@ static inline bool relevant_node_to_target(const RRGraphView* rr_graph, static inline void update_router_stats(RouterStats* router_stats, bool is_push, RRNodeId rr_node_id, - const RRGraphView* rr_graph,) { + const RRGraphView* rr_graph) { #else static inline void update_router_stats(RouterStats* router_stats, bool is_push,