Skip to content

Commit e8fd53a

Browse files
HackerFoolitghost
authored andcommitted
add --quick_check_route, disables slow non-configurable edge check
Signed-off-by: Dustin DeWeese <[email protected]>
1 parent e6fae2e commit e8fd53a

File tree

7 files changed

+34
-7
lines changed

7 files changed

+34
-7
lines changed

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
376376
RouterOpts->write_router_lookahead = Options.write_router_lookahead;
377377
RouterOpts->read_router_lookahead = Options.read_router_lookahead;
378378
RouterOpts->disable_check_route = Options.disable_check_route;
379+
RouterOpts->quick_check_route = Options.quick_check_route;
379380
}
380381

381382
static void SetupAnnealSched(const t_options& Options,

vpr/src/base/read_options.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,11 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg
16251625
.default_value("off")
16261626
.show_in(argparse::ShowIn::HELP_ONLY);
16271627

1628+
route_timing_grp.add_argument<bool, ParseOnOff>(args.quick_check_route, "--quick_check_route")
1629+
.help("Runs check_route, disabling slow checks, once routing step has finished or when routing file is loaded")
1630+
.default_value("off")
1631+
.show_in(argparse::ShowIn::HELP_ONLY);
1632+
16281633
route_timing_grp.add_argument(args.router_debug_net, "--router_debug_net")
16291634
.help(
16301635
"Controls when router debugging is enabled.\n"

vpr/src/base/read_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ struct t_options {
134134
argparse::ArgValue<e_router_algorithm> RouterAlgorithm;
135135
argparse::ArgValue<int> min_incremental_reroute_fanout;
136136
argparse::ArgValue<bool> disable_check_route;
137+
argparse::ArgValue<bool> quick_check_route;
137138

138139
/* Timing-driven router options only */
139140
argparse::ArgValue<float> astar_fac;

vpr/src/base/vpr_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ RouteStatus vpr_route_flow(t_vpr_setup& vpr_setup, const t_arch& arch) {
689689
if (route_status.success()) {
690690
//Sanity check the routing
691691
if (!router_opts.disable_check_route) {
692-
check_route(router_opts.route_type);
692+
check_route(router_opts.route_type, router_opts.quick_check_route);
693693
}
694694
get_serial_num();
695695

vpr/src/base/vpr_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ struct t_router_opts {
950950
std::string write_router_lookahead;
951951
std::string read_router_lookahead;
952952
bool disable_check_route;
953+
bool quick_check_route;
953954
};
954955

955956
struct t_analysis_opts {

vpr/src/route/check_route.cpp

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ static void reset_flags(ClusterNetId inet, bool* connected_to_route);
2727
static void check_locally_used_clb_opins(const t_clb_opins_used& clb_opins_used_locally,
2828
enum e_route_type route_type);
2929

30+
static void check_all_non_configurable_edges();
3031
static bool check_non_configurable_edges(ClusterNetId net, const t_non_configurable_rr_sets& non_configurable_rr_sets);
3132
static void check_net_for_stubs(ClusterNetId net);
3233

3334
/************************ Subroutine definitions ****************************/
3435

35-
void check_route(enum e_route_type route_type) {
36+
void check_route(enum e_route_type route_type, bool quick) {
3637
/* This routine checks that a routing: (1) Describes a properly *
3738
* connected path for each net, (2) this path connects all the *
3839
* pins spanned by that net, and (3) that no routing resources are *
@@ -68,8 +69,6 @@ void check_route(enum e_route_type route_type) {
6869

6970
check_locally_used_clb_opins(route_ctx.clb_opins_used_locally, route_type);
7071

71-
auto non_configurable_rr_sets = identify_non_configurable_rr_sets();
72-
7372
connected_to_route = (bool*)vtr::calloc(device_ctx.rr_nodes.size(), sizeof(bool));
7473

7574
max_pins = 0;
@@ -156,8 +155,6 @@ void check_route(enum e_route_type route_type) {
156155
}
157156
}
158157

159-
check_non_configurable_edges(net_id, non_configurable_rr_sets);
160-
161158
check_net_for_stubs(net_id);
162159

163160
reset_flags(net_id, connected_to_route);
@@ -166,6 +163,11 @@ void check_route(enum e_route_type route_type) {
166163

167164
free(pin_done);
168165
free(connected_to_route);
166+
167+
if (!quick) {
168+
check_all_non_configurable_edges();
169+
}
170+
169171
VTR_LOG("Completed routing consistency check successfully.\n");
170172
VTR_LOG("\n");
171173
}
@@ -625,6 +627,23 @@ static void check_node_and_range(int inode, enum e_route_type route_type) {
625627
check_rr_node(inode, route_type, device_ctx);
626628
}
627629

630+
//Checks that all non-configurable edges are in a legal configuration
631+
//This check is slow, so it has been moved out of check_route()
632+
static void check_all_non_configurable_edges() {
633+
VTR_LOG("\n");
634+
VTR_LOG("Checking to ensure non-configurable edges are legal...\n");
635+
636+
auto non_configurable_rr_sets = identify_non_configurable_rr_sets();
637+
638+
auto& cluster_ctx = g_vpr_ctx.clustering();
639+
for (auto net_id : cluster_ctx.clb_nlist.nets()) {
640+
check_non_configurable_edges(net_id, non_configurable_rr_sets);
641+
}
642+
643+
VTR_LOG("Completed non-configurable edge check successfully.\n");
644+
VTR_LOG("\n");
645+
}
646+
628647
//Checks that the specified routing is legal with respect to non-configurable edges
629648
//
630649
//For routing to be legal if *any* non-configurable edge is used, so must *all*

vpr/src/route/check_route.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "physical_types.h"
44
#include "route_common.h"
55

6-
void check_route(enum e_route_type route_type);
6+
void check_route(enum e_route_type route_type, bool quick);
77

88
void recompute_occupancy_from_scratch();
99

0 commit comments

Comments
 (0)