vpr: Add --router_init_wirelength_abort_threshold option

This allows the router's first iteration wirelength based abort
threshold to be set via the command-line (previously hard coded).

This allows it to be changed for architecture specific reasons.
diff --git a/vpr/src/base/SetupVPR.cpp b/vpr/src/base/SetupVPR.cpp
index 527f457..caad775 100644
--- a/vpr/src/base/SetupVPR.cpp
+++ b/vpr/src/base/SetupVPR.cpp
@@ -325,6 +325,7 @@
 	RouterOpts->criticality_exp = Options.criticality_exp;
 	RouterOpts->max_criticality = Options.max_criticality;
 	RouterOpts->max_router_iterations = Options.max_router_iterations;
+	RouterOpts->init_wirelength_abort_threshold = Options.router_init_wirelength_abort_threshold;
 	RouterOpts->min_incremental_reroute_fanout = Options.min_incremental_reroute_fanout;
 	RouterOpts->incr_reroute_delay_ripup = Options.incr_reroute_delay_ripup;
 	RouterOpts->pres_fac_mult = Options.pres_fac_mult;
diff --git a/vpr/src/base/read_options.cpp b/vpr/src/base/read_options.cpp
index 014a4dd..9c5cab4 100644
--- a/vpr/src/base/read_options.cpp
+++ b/vpr/src/base/read_options.cpp
@@ -1230,6 +1230,12 @@
             .default_value("1.0")
             .show_in(argparse::ShowIn::HELP_ONLY);
 
+    route_timing_grp.add_argument(args.router_init_wirelength_abort_threshold, "--router_init_wirelength_abort_threshold")
+            .help("The first routing iteration wirelength abort threshold."
+                  " If the first routing iteration uses more than this fraction of available wirelength routing is aborted.")
+            .default_value("0.85")
+            .show_in(argparse::ShowIn::HELP_ONLY);
+
     route_timing_grp.add_argument<e_incr_reroute_delay_ripup,ParseIncrRerouteDelayRipup>(args.incr_reroute_delay_ripup, "--incremental_reroute_delay_ripup")
             .help("Controls whether incremental net routing will rip-up (and re-route) a critical connection for delay, even if the routing is legal.")
             .default_value("auto")
diff --git a/vpr/src/base/read_options.h b/vpr/src/base/read_options.h
index e8034d7..b43fd35 100644
--- a/vpr/src/base/read_options.h
+++ b/vpr/src/base/read_options.h
@@ -119,6 +119,7 @@
     argparse::ArgValue<float> astar_fac;
     argparse::ArgValue<float> max_criticality;
     argparse::ArgValue<float> criticality_exp;
+    argparse::ArgValue<float> router_init_wirelength_abort_threshold;
     argparse::ArgValue<e_incr_reroute_delay_ripup> incr_reroute_delay_ripup;
     argparse::ArgValue<e_routing_failure_predictor> routing_failure_predictor;
     argparse::ArgValue<e_routing_budgets_algorithm> routing_budgets_algorithm;
diff --git a/vpr/src/base/vpr_types.h b/vpr/src/base/vpr_types.h
index 6952ae4..e309ab5 100644
--- a/vpr/src/base/vpr_types.h
+++ b/vpr/src/base/vpr_types.h
@@ -857,6 +857,7 @@
 	float astar_fac;
 	float max_criticality;
 	float criticality_exp;
+    float init_wirelength_abort_threshold;
 	bool verify_binary_search;
 	bool full_stats;
 	bool congestion_analysis;
diff --git a/vpr/src/route/route_timing.cpp b/vpr/src/route/route_timing.cpp
index 4b7cfe4..fd57fb2 100644
--- a/vpr/src/route/route_timing.cpp
+++ b/vpr/src/route/route_timing.cpp
@@ -249,7 +249,7 @@
         CBRR& connections_inf, float slope, int itry);
 
 static bool should_route_net(ClusterNetId net_id, const CBRR& connections_inf, bool if_force_reroute);
-static bool early_exit_heuristic(const WirelengthInfo& wirelength_info);
+static bool early_exit_heuristic(const t_router_opts& router_opts, const WirelengthInfo& wirelength_info);
 
 struct more_sinks_than {
     inline bool operator()(const ClusterNetId net_index1, const ClusterNetId net_index2) {
@@ -584,7 +584,7 @@
         /*
          * Abort checks: Should we give-up because this routing problem is unlikely to converge to a legal routing?
          */
-        if (itry == 1 && early_exit_heuristic(wirelength_info)) {
+        if (itry == 1 && early_exit_heuristic(router_opts, wirelength_info)) {
             //Abort
             break;
         }
@@ -2111,14 +2111,14 @@
     return false; /* Current route has no overuse */
 }
 
-static bool early_exit_heuristic(const WirelengthInfo& wirelength_info) {
+static bool early_exit_heuristic(const t_router_opts& router_opts, const WirelengthInfo& wirelength_info) {
     /* Early exit code for cases where it is obvious that a successful route will not be found
        Heuristic: If total wirelength used in first routing iteration is X% of total available wirelength, exit */
 
-    if (wirelength_info.used_wirelength_ratio() > FIRST_ITER_WIRELENTH_LIMIT) {
+    if (wirelength_info.used_wirelength_ratio() > router_opts.init_wirelength_abort_threshold) {
         VTR_LOG("Wire length usage ratio %g exceeds limit of %g, fail routing.\n",
                 wirelength_info.used_wirelength_ratio(),
-                FIRST_ITER_WIRELENTH_LIMIT);
+                router_opts.init_wirelength_abort_threshold);
         return true;
     }
     return false;