From 2ebc288a37a06fa75c48fcb2f5c6220796dfad8e Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 28 Nov 2023 09:59:48 -0500 Subject: [PATCH 1/6] change flat_routing option form true/false to on/off --- vpr/src/base/read_options.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vpr/src/base/read_options.cpp b/vpr/src/base/read_options.cpp index 0764b76f947..06176eac52f 100644 --- a/vpr/src/base/read_options.cpp +++ b/vpr/src/base/read_options.cpp @@ -2441,9 +2441,9 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg .default_value("1") .show_in(argparse::ShowIn::HELP_ONLY); - route_grp.add_argument(args.flat_routing, "--flat_routing") + route_grp.add_argument(args.flat_routing, "--flat_routing") .help("Enable VPR's flat routing (routing the nets from the source primitive to the destination primitive)") - .default_value("false") + .default_value("OFF") .show_in(argparse::ShowIn::HELP_ONLY); route_grp.add_argument(args.has_choking_spot, "--has_choking_spot") From 3c1ba00faed73881d78873721d4bb3dd88ecf7eb Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 28 Nov 2023 10:03:16 -0500 Subject: [PATCH 2/6] update run-flat CI tests parameters --- .../titan_other_run_flat/config/config.txt | 2 +- .../verify_router_lookahead_run_flat/config/config.txt | 2 +- .../verify_rr_graph_run_flat/config/config.txt | 2 +- .../vtr_reg_qor_large_depop_run_flat/config/config.txt | 2 +- .../vtr_reg_qor_large_run_flat/config/config.txt | 2 +- .../vtr_reg_strong/strong_flat_router/config/config.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/titan_other_run_flat/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/titan_other_run_flat/config/config.txt index aafaa2a7def..ee25489239f 100644 --- a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/titan_other_run_flat/config/config.txt +++ b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/titan_other_run_flat/config/config.txt @@ -41,5 +41,5 @@ qor_parse_file=qor_vpr_titan.txt # Pass requirements pass_requirements_file=pass_requirements_vpr_titan.txt -script_params=-starting_stage vpr --route_chan_width 300 --max_router_iterations 400 --router_lookahead map --flat_routing true +script_params=-starting_stage vpr --route_chan_width 300 --max_router_iterations 400 --router_lookahead map --flat_routing on diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/verify_router_lookahead_run_flat/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/verify_router_lookahead_run_flat/config/config.txt index 67c2c9f502a..fa513365115 100644 --- a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/verify_router_lookahead_run_flat/config/config.txt +++ b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/verify_router_lookahead_run_flat/config/config.txt @@ -27,4 +27,4 @@ qor_parse_file=qor_rr_graph.txt pass_requirements_file=pass_requirements_verify_rr_graph.txt # Script parameters -script_params = -verify_inter_cluster_router_lookahead -verify_intra_cluster_router_lookahead --route_chan_width 130 --flat_routing true +script_params = -verify_inter_cluster_router_lookahead -verify_intra_cluster_router_lookahead --route_chan_width 130 --flat_routing on diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/verify_rr_graph_run_flat/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/verify_rr_graph_run_flat/config/config.txt index 8200d0b72ba..9a3155eb899 100644 --- a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/verify_rr_graph_run_flat/config/config.txt +++ b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/verify_rr_graph_run_flat/config/config.txt @@ -27,4 +27,4 @@ qor_parse_file=qor_rr_graph.txt pass_requirements_file=pass_requirements_verify_rr_graph.txt # Script parameters -script_params = -verify_rr_graph --route_chan_width 130 --flat_routing true +script_params = -verify_rr_graph --route_chan_width 130 --flat_routing on 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 01eba58da65..3cf73435272 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 true --has_choking_spot true +script_params=-track_memory_usage --max_router_iterations 300 --flat_routing on --has_choking_spot true diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_run_flat/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_run_flat/config/config.txt index be28691892d..43482b7e4a9 100755 --- a/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_run_flat/config/config.txt +++ b/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_run_flat/config/config.txt @@ -31,4 +31,4 @@ qor_parse_file=qor_large.txt pass_requirements_file=pass_requirements.txt #Script parameters -script_params=-track_memory_usage -max_router_iterations 300 --flat_routing true +script_params=-track_memory_usage -max_router_iterations 300 --flat_routing on diff --git a/vtr_flow/tasks/regression_tests/vtr_reg_strong/strong_flat_router/config/config.txt b/vtr_flow/tasks/regression_tests/vtr_reg_strong/strong_flat_router/config/config.txt index 4e4071f98c2..d59d17d4831 100644 --- a/vtr_flow/tasks/regression_tests/vtr_reg_strong/strong_flat_router/config/config.txt +++ b/vtr_flow/tasks/regression_tests/vtr_reg_strong/strong_flat_router/config/config.txt @@ -24,6 +24,6 @@ qor_parse_file=qor_standard.txt # Pass requirements pass_requirements_file=pass_requirements.txt -script_params_common=-track_memory_usage --route_chan_width 100 --max_router_iterations 100 --router_lookahead map --flat_routing true +script_params_common=-track_memory_usage --route_chan_width 100 --max_router_iterations 100 --router_lookahead map --flat_routing on script_params_list_add = script_params_list_add = --router_algorithm parallel --num_workers 4 From 2f5b0c99bfda2c5cac3cfca2300e9f2d9c9d65b9 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 28 Nov 2023 10:17:12 -0500 Subject: [PATCH 3/6] add flat_routing option to online doc --- doc/src/vpr/command_line_usage.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/src/vpr/command_line_usage.rst b/doc/src/vpr/command_line_usage.rst index fc575e08a13..1ae65a3df8a 100644 --- a/doc/src/vpr/command_line_usage.rst +++ b/doc/src/vpr/command_line_usage.rst @@ -1120,6 +1120,13 @@ VPR uses a negotiated congestion algorithm (based on Pathfinder) to perform rout .. seealso:: :ref:`timing_driven_router_options` +.. option:: --flat_routing {on | off} + + If this option is enabled, the *run-flat* router is used instead of the *two-stage* router. + This means that during the routing stage, all nets, both intra- and inter-cluster, are routed directly from one primitive pin to another primitive pin. + + **Default:** ``OFF` + .. option:: --max_router_iterations The number of iterations of a Pathfinder-based router that will be executed before a circuit is declared unrouteable (if it hasn’t routed successfully yet) at a given channel width. From 279fb068cd4c065e4c9ffab00290d4abde1fbc68 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 28 Nov 2023 15:04:41 -0500 Subject: [PATCH 4/6] debug: the argument should be in lowercase --- vpr/src/base/read_options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/base/read_options.cpp b/vpr/src/base/read_options.cpp index 06176eac52f..f48b14ebf5f 100644 --- a/vpr/src/base/read_options.cpp +++ b/vpr/src/base/read_options.cpp @@ -2443,7 +2443,7 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg route_grp.add_argument(args.flat_routing, "--flat_routing") .help("Enable VPR's flat routing (routing the nets from the source primitive to the destination primitive)") - .default_value("OFF") + .default_value("off") .show_in(argparse::ShowIn::HELP_ONLY); route_grp.add_argument(args.has_choking_spot, "--has_choking_spot") From feb9d8a587dc541857120a8f7166f4a44c7cd499 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 28 Nov 2023 15:07:40 -0500 Subject: [PATCH 5/6] argparser: first make all chars lower case then compare --- vpr/src/base/read_options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/base/read_options.cpp b/vpr/src/base/read_options.cpp index f48b14ebf5f..b734b82b850 100644 --- a/vpr/src/base/read_options.cpp +++ b/vpr/src/base/read_options.cpp @@ -31,6 +31,7 @@ t_options read_options(int argc, const char** argv) { struct ParseOnOff { ConvertedValue from_str(std::string str) { + std::transform(str.begin(), str.end(), str.begin(), ::tolower); ConvertedValue conv_value; if (str == "on") conv_value.set_value(true); @@ -42,7 +43,6 @@ struct ParseOnOff { conv_value.set_error(msg.str()); } return conv_value; - ; } ConvertedValue to_str(bool val) { From c54c4d384e71a2d90c24d1718b49b2e87ae3d6aa Mon Sep 17 00:00:00 2001 From: amin1377 Date: Sat, 2 Dec 2023 09:50:21 -0500 Subject: [PATCH 6/6] add additional document on flat router --- doc/src/vpr/command_line_usage.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/vpr/command_line_usage.rst b/doc/src/vpr/command_line_usage.rst index 1ae65a3df8a..fa0cd49017b 100644 --- a/doc/src/vpr/command_line_usage.rst +++ b/doc/src/vpr/command_line_usage.rst @@ -1124,6 +1124,7 @@ VPR uses a negotiated congestion algorithm (based on Pathfinder) to perform rout If this option is enabled, the *run-flat* router is used instead of the *two-stage* router. This means that during the routing stage, all nets, both intra- and inter-cluster, are routed directly from one primitive pin to another primitive pin. + This increases routing time but can improve routing quality by re-arranging LUT inputs and exposing additional optimization opportunities in architectures with local intra-cluster routing that is not a full crossbar. **Default:** ``OFF`