From 176b4a4d12be2ff059c59167c4efb46b669b7a4d Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 16 Oct 2024 08:59:35 -0400 Subject: [PATCH 1/6] [vpr][CLI] change has_choking_spot to router_opt_choke_points --- vpr/src/base/SetupVPR.cpp | 2 +- vpr/src/base/read_options.cpp | 10 +++++----- vpr/src/base/read_options.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vpr/src/base/SetupVPR.cpp b/vpr/src/base/SetupVPR.cpp index 7e9b7177c4..db9880eb25 100644 --- a/vpr/src/base/SetupVPR.cpp +++ b/vpr/src/base/SetupVPR.cpp @@ -510,7 +510,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts) RouterOpts->max_logged_overused_rr_nodes = Options.max_logged_overused_rr_nodes; RouterOpts->generate_rr_node_overuse_report = Options.generate_rr_node_overuse_report; RouterOpts->flat_routing = Options.flat_routing; - RouterOpts->has_choking_spot = Options.has_choking_spot; + RouterOpts->has_choking_spot = Options.router_opt_choke_points; RouterOpts->custom_3d_sb_fanin_fanout = Options.custom_3d_sb_fanin_fanout; RouterOpts->with_timing_analysis = Options.timing_analysis; } diff --git a/vpr/src/base/read_options.cpp b/vpr/src/base/read_options.cpp index fa7084a9b0..97b3c9baba 100644 --- a/vpr/src/base/read_options.cpp +++ b/vpr/src/base/read_options.cpp @@ -2491,13 +2491,13 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio .default_value("off") .show_in(argparse::ShowIn::HELP_ONLY); - route_grp.add_argument(args.has_choking_spot, "--has_choking_spot") + route_grp.add_argument(args.router_opt_choke_points, "--router_opt_choke_points") .help( "" - "Some FPGA architectures, due to the lack of full connectivity inside the cluster, may have" - " a choking spot inside the cluster. Thus, if routing doesn't converge, enabling this option may" - " help it.") - .default_value("false") + "Some FPGA architectures with limited fan-out options within a cluster (e.g. fracturable LUTs with shared pins) do" + " not converge well in routing unless these fan-out choke points are discovered and optimized for during net routing." + " This option helps router convergence for such architectures.") + .default_value("on") .show_in(argparse::ShowIn::HELP_ONLY); diff --git a/vpr/src/base/read_options.h b/vpr/src/base/read_options.h index c07762350d..12f8e69104 100644 --- a/vpr/src/base/read_options.h +++ b/vpr/src/base/read_options.h @@ -218,7 +218,7 @@ struct t_options { argparse::ArgValue reorder_rr_graph_nodes_threshold; argparse::ArgValue reorder_rr_graph_nodes_seed; argparse::ArgValue flat_routing; - argparse::ArgValue has_choking_spot; + argparse::ArgValue router_opt_choke_points; argparse::ArgValue route_verbosity; argparse::ArgValue custom_3d_sb_fanin_fanout; From 66f4e7270905e37fac6783d7f13540bc6ecf5549 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 16 Oct 2024 09:20:32 -0400 Subject: [PATCH 2/6] [vpr][route] rename has_choking_spot to has_choke_point --- vpr/src/base/SetupVPR.cpp | 4 ++-- vpr/src/base/ShowSetup.cpp | 2 +- vpr/src/base/place_and_route.cpp | 2 +- vpr/src/base/read_route.cpp | 2 +- vpr/src/base/vpr_types.h | 2 +- vpr/src/route/route.cpp | 4 ++-- vpr/src/route/route_net.tpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vpr/src/base/SetupVPR.cpp b/vpr/src/base/SetupVPR.cpp index db9880eb25..77fb495014 100644 --- a/vpr/src/base/SetupVPR.cpp +++ b/vpr/src/base/SetupVPR.cpp @@ -318,7 +318,7 @@ void SetupVPR(const t_options* options, vtr::ScopedStartFinishTimer timer("Allocate intra-cluster resources"); // The following two functions should be called when the data structured related to t_pb_graph_node, t_pb_type, // and t_pb_graph_edge are initialized - alloc_and_load_intra_cluster_resources(routerOpts->has_choking_spot); + alloc_and_load_intra_cluster_resources(routerOpts->has_choke_point); add_intra_tile_switches(); } @@ -510,7 +510,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts) RouterOpts->max_logged_overused_rr_nodes = Options.max_logged_overused_rr_nodes; RouterOpts->generate_rr_node_overuse_report = Options.generate_rr_node_overuse_report; RouterOpts->flat_routing = Options.flat_routing; - RouterOpts->has_choking_spot = Options.router_opt_choke_points; + RouterOpts->has_choke_point = Options.router_opt_choke_points; RouterOpts->custom_3d_sb_fanin_fanout = Options.custom_3d_sb_fanin_fanout; RouterOpts->with_timing_analysis = Options.timing_analysis; } diff --git a/vpr/src/base/ShowSetup.cpp b/vpr/src/base/ShowSetup.cpp index f288be8f86..c65939de27 100644 --- a/vpr/src/base/ShowSetup.cpp +++ b/vpr/src/base/ShowSetup.cpp @@ -256,7 +256,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) { } VTR_LOG("RouterOpts.has_choking_spot: "); - if (RouterOpts.has_choking_spot) { + if (RouterOpts.has_choke_point) { VTR_LOG("true\n"); } else { VTR_LOG("false\n"); diff --git a/vpr/src/base/place_and_route.cpp b/vpr/src/base/place_and_route.cpp index f95ff2b9b0..66d0208031 100644 --- a/vpr/src/base/place_and_route.cpp +++ b/vpr/src/base/place_and_route.cpp @@ -398,7 +398,7 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list, init_route_structs(router_net_list, router_opts.bb_factor, - router_opts.has_choking_spot, + router_opts.has_choke_point, is_flat); restore_routing(best_routing, diff --git a/vpr/src/base/read_route.cpp b/vpr/src/base/read_route.cpp index 269b273ab8..b137c00732 100644 --- a/vpr/src/base/read_route.cpp +++ b/vpr/src/base/read_route.cpp @@ -109,7 +109,7 @@ bool read_route(const char* route_file, const t_router_opts& router_opts, bool v const Netlist<>& router_net_list = (flat_router) ? (const Netlist<>&)g_vpr_ctx.atom().nlist : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist; init_route_structs(router_net_list, router_opts.bb_factor, - router_opts.has_choking_spot, + router_opts.has_choke_point, flat_router); /*Check dimensions*/ diff --git a/vpr/src/base/vpr_types.h b/vpr/src/base/vpr_types.h index 98f17e898a..d2bc5f03da 100644 --- a/vpr/src/base/vpr_types.h +++ b/vpr/src/base/vpr_types.h @@ -1339,7 +1339,7 @@ struct t_router_opts { bool generate_rr_node_overuse_report; bool flat_routing; - bool has_choking_spot; + bool has_choke_point; int custom_3d_sb_fanin_fanout = 1; diff --git a/vpr/src/route/route.cpp b/vpr/src/route/route.cpp index 1816f610f9..ffc430f6fc 100644 --- a/vpr/src/route/route.cpp +++ b/vpr/src/route/route.cpp @@ -71,7 +71,7 @@ bool route(const Netlist<>& net_list, init_route_structs(net_list, router_opts.bb_factor, - router_opts.has_choking_spot, + router_opts.has_choke_point, is_flat); IntraLbPbPinLookup intra_lb_pb_pin_lookup(device_ctx.logical_block_types); @@ -80,7 +80,7 @@ bool route(const Netlist<>& net_list, auto choking_spots = set_nets_choking_spots(net_list, route_ctx.net_terminal_groups, route_ctx.net_terminal_group_num, - router_opts.has_choking_spot, + router_opts.has_choke_point, is_flat); //Initially, the router runs normally trying to reduce congestion while diff --git a/vpr/src/route/route_net.tpp b/vpr/src/route/route_net.tpp index 95df1a8346..d3742ac716 100644 --- a/vpr/src/route/route_net.tpp +++ b/vpr/src/route/route_net.tpp @@ -436,7 +436,7 @@ inline NetResultFlags route_sink(ConnectionRouter& router, bool sink_critical = (cost_params.criticality > HIGH_FANOUT_CRITICALITY_THRESHOLD); bool net_is_clock = route_ctx.is_clock_net[net_id] != 0; - bool has_choking_spot = ((int)choking_spots[target_pin].size() != 0) && router_opts.has_choking_spot; + bool has_choking_spot = ((int)choking_spots[target_pin].size() != 0) && router_opts.has_choke_point; ConnectionParameters conn_params(net_id, target_pin, has_choking_spot, choking_spots[target_pin]); //We normally route high fanout nets by only adding spatially close-by routing to the heap (reduces run-time). From 7464e58dd1d05ce223e881f108cca9a88c4332a0 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 16 Oct 2024 09:23:52 -0400 Subject: [PATCH 3/6] [vtr_flow] fix CLI for choke point usage --- .../vtr_reg_qor_large_depop_run_flat/config/config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_depop_run_flat/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_depop_run_flat/config/config.txt index 3cf7343527..4bdba8414a 100755 --- a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_depop_run_flat/config/config.txt +++ b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_depop_run_flat/config/config.txt @@ -29,4 +29,4 @@ qor_parse_file=qor_standard.txt pass_requirements_file=pass_requirements.txt #Script parameters -script_params=-track_memory_usage --max_router_iterations 300 --flat_routing on --has_choking_spot true +script_params=-track_memory_usage --max_router_iterations 300 --flat_routing on --router_opt_choke_points true From 002451fe52e4d2ecc8b5ff40f2972d2171c7459c Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 16 Oct 2024 09:31:30 -0400 Subject: [PATCH 4/6] [vpr][route] renaming remaining has_choke_points --- libs/libarchfpga/src/physical_types.h | 2 +- vpr/src/base/ShowSetup.cpp | 2 +- vpr/src/route/connection_router.cpp | 2 +- vpr/src/route/route_net.tpp | 4 ++-- vpr/src/route/route_utils.cpp | 4 ++-- vpr/src/route/route_utils.h | 6 +++--- vpr/src/route/router_stats.h | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libs/libarchfpga/src/physical_types.h b/libs/libarchfpga/src/physical_types.h index 3742795ed4..1f2dc44c7c 100644 --- a/libs/libarchfpga/src/physical_types.h +++ b/libs/libarchfpga/src/physical_types.h @@ -1382,7 +1382,7 @@ class t_pb_graph_pin { float tco_max = std::numeric_limits::quiet_NaN(); /* For sequential logic elements the maximum clock to output time */ t_pb_graph_pin* associated_clock_pin = nullptr; /* For sequentail elements, the associated clock */ - /* This member is used when flat-routing and has_choking_spot are enabled. + /* This member is used when flat-routing and router_opt_choke_points are enabled. * It is used to identify choke points. * This is only valid for IPINs, and it only contain the pins that are reachable to the pin by a forwarding path. * It doesn't take into account feed-back connection. diff --git a/vpr/src/base/ShowSetup.cpp b/vpr/src/base/ShowSetup.cpp index c65939de27..f45c145283 100644 --- a/vpr/src/base/ShowSetup.cpp +++ b/vpr/src/base/ShowSetup.cpp @@ -255,7 +255,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) { VTR_LOG("false\n"); } - VTR_LOG("RouterOpts.has_choking_spot: "); + VTR_LOG("RouterOpts.router_opt_choke_points: "); if (RouterOpts.has_choke_point) { VTR_LOG("true\n"); } else { diff --git a/vpr/src/route/connection_router.cpp b/vpr/src/route/connection_router.cpp index 5409d5ec49..210783648a 100644 --- a/vpr/src/route/connection_router.cpp +++ b/vpr/src/route/connection_router.cpp @@ -775,7 +775,7 @@ void ConnectionRouter::evaluate_timing_driven_node_costs(t_heap* to, //cost. cong_cost = 0.; } - if (conn_params_->has_choking_spot_ && is_flat_ && rr_graph_->node_type(to_node) == IPIN) { + if (conn_params_->router_opt_choke_points_ && is_flat_ && rr_graph_->node_type(to_node) == IPIN) { auto find_res = conn_params_->connection_choking_spots_.find(to_node); if (find_res != conn_params_->connection_choking_spots_.end()) { cong_cost = cong_cost / pow(2, (float)find_res->second); diff --git a/vpr/src/route/route_net.tpp b/vpr/src/route/route_net.tpp index d3742ac716..7004dbb4d5 100644 --- a/vpr/src/route/route_net.tpp +++ b/vpr/src/route/route_net.tpp @@ -436,8 +436,8 @@ inline NetResultFlags route_sink(ConnectionRouter& router, bool sink_critical = (cost_params.criticality > HIGH_FANOUT_CRITICALITY_THRESHOLD); bool net_is_clock = route_ctx.is_clock_net[net_id] != 0; - bool has_choking_spot = ((int)choking_spots[target_pin].size() != 0) && router_opts.has_choke_point; - ConnectionParameters conn_params(net_id, target_pin, has_choking_spot, choking_spots[target_pin]); + bool router_opt_choke_points = ((int)choking_spots[target_pin].size() != 0) && router_opts.has_choke_point; + ConnectionParameters conn_params(net_id, target_pin, router_opt_choke_points, choking_spots[target_pin]); //We normally route high fanout nets by only adding spatially close-by routing to the heap (reduces run-time). //However, if the current sink is 'critical' from a timing perspective, we put the entire route tree back onto diff --git a/vpr/src/route/route_utils.cpp b/vpr/src/route/route_utils.cpp index bb89d89fde..a25a73495d 100644 --- a/vpr/src/route/route_utils.cpp +++ b/vpr/src/route/route_utils.cpp @@ -391,7 +391,7 @@ vtr::vector>> set_net std::vector>>& net_terminal_groups, const vtr::vector>& net_terminal_group_num, - bool has_choking_spot, + bool router_opt_choke_points, bool is_flat) { vtr::vector>> choking_spots(net_list.nets().size()); for (const auto& net_id : net_list.nets()) { @@ -399,7 +399,7 @@ vtr::vector>> set_net } // Return if the architecture doesn't have any potential choke points - if (!has_choking_spot) { + if (!router_opt_choke_points) { return choking_spots; } diff --git a/vpr/src/route/route_utils.h b/vpr/src/route/route_utils.h index 9148180a94..c7d79a61fb 100644 --- a/vpr/src/route/route_utils.h +++ b/vpr/src/route/route_utils.h @@ -121,14 +121,14 @@ void print_router_criticality_histogram(const Netlist<>& net_list, void prune_unused_non_configurable_nets(CBRR& connections_inf, const Netlist<>& net_list); -/** If flat_routing and has_choking_spot are true, there are some choke points inside the cluster which would increase the convergence time of routing. +/** If flat_routing and router_opt_choke_points are true, there are some choke points inside the cluster which would increase the convergence time of routing. * To address this issue, the congestion cost of those choke points needs to decrease. This function identify those choke points for each net, * and since the amount of congestion reduction is dependant on the number sinks reachable from that choke point, it also store the number of reachable sinks * for each choke point. * @param net_list * @param net_terminal_groups [Net_id][group_id] -> rr_node_id of the pins in the group * @param net_terminal_group_num [Net_id][pin_id] -> group_id - * @param has_choking_spot is true if the given architecture has choking spots inside the cluster + * @param router_opt_choke_points is true if the given architecture has choking spots inside the cluster * @param is_flat is true if flat_routing is enabled * @return [Net_id][pin_id] -> [choke_point_rr_node_id, number of sinks reachable by this choke point] */ vtr::vector>> set_nets_choking_spots(const Netlist<>& net_list, @@ -136,7 +136,7 @@ vtr::vector>> set_net std::vector>>& net_terminal_groups, const vtr::vector>& net_terminal_group_num, - bool has_choking_spot, + bool router_opt_choke_points, bool is_flat); /** Wrapper for create_rr_graph() with extra checks */ diff --git a/vpr/src/route/router_stats.h b/vpr/src/route/router_stats.h index b1015f45ac..4336d41908 100644 --- a/vpr/src/route/router_stats.h +++ b/vpr/src/route/router_stats.h @@ -9,11 +9,11 @@ struct ConnectionParameters { ConnectionParameters(ParentNetId net_id, int target_pin_num, - bool has_choking_spot, + bool router_opt_choke_points, const std::unordered_map& connection_choking_spots) : net_id_(net_id) , target_pin_num_(target_pin_num) - , has_choking_spot_(has_choking_spot) + , router_opt_choke_points_(router_opt_choke_points) , connection_choking_spots_(connection_choking_spots) {} // Net id of the connection @@ -24,7 +24,7 @@ struct ConnectionParameters { // Show whether for the given connection, router should expect a choking point // If this is true, it would increase the routing time since the router has to // take some measures to solve the congestion - bool has_choking_spot_; + bool router_opt_choke_points_; const std::unordered_map& connection_choking_spots_; }; From 592384c62e2fb06a3f2e37c68e720727f8864dff Mon Sep 17 00:00:00 2001 From: amin1377 Date: Thu, 17 Oct 2024 12:25:57 -0400 Subject: [PATCH 5/6] [vpr][cli] fix choke point msg --- vpr/src/base/ShowSetup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vpr/src/base/ShowSetup.cpp b/vpr/src/base/ShowSetup.cpp index f45c145283..3af8faa871 100644 --- a/vpr/src/base/ShowSetup.cpp +++ b/vpr/src/base/ShowSetup.cpp @@ -255,11 +255,11 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) { VTR_LOG("false\n"); } - VTR_LOG("RouterOpts.router_opt_choke_points: "); + VTR_LOG("RouterOpts.choke_points: "); if (RouterOpts.has_choke_point) { - VTR_LOG("true\n"); + VTR_LOG("on\n"); } else { - VTR_LOG("false\n"); + VTR_LOG("off\n"); } VTR_ASSERT(GLOBAL == RouterOpts.route_type || DETAILED == RouterOpts.route_type); From 53f3b3be0aea5d4def2c4fde12591aa1c6a75ec4 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Thu, 17 Oct 2024 17:51:40 -0400 Subject: [PATCH 6/6] [vpr][route] return from set_nets_choking_spots if flat router is not selected --- vpr/src/route/route_utils.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/vpr/src/route/route_utils.cpp b/vpr/src/route/route_utils.cpp index a25a73495d..b67b544b47 100644 --- a/vpr/src/route/route_utils.cpp +++ b/vpr/src/route/route_utils.cpp @@ -398,14 +398,11 @@ vtr::vector>> set_net choking_spots[net_id].resize(net_list.net_pins(net_id).size()); } - // Return if the architecture doesn't have any potential choke points - if (!router_opt_choke_points) { + // Return if the architecture doesn't have any potential choke points or flat router is not enabled + if (!router_opt_choke_points || !is_flat) { return choking_spots; } - // We only identify choke points if flat_routing is enabled. - VTR_ASSERT(is_flat); - const auto& device_ctx = g_vpr_ctx.device(); const auto& rr_graph = device_ctx.rr_graph; const auto& route_ctx = g_vpr_ctx.routing();