Skip to content

Commit caf76ca

Browse files
committed
check_route: move option within check route function
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 99cedb8 commit caf76ca

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

vpr/src/base/vpr_api.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -710,13 +710,7 @@ RouteStatus vpr_route_flow(t_vpr_setup& vpr_setup, const t_arch& arch) {
710710
std::string graphics_msg;
711711
if (route_status.success()) {
712712
//Sanity check the routing
713-
if (router_opts.check_route == e_check_route_option::QUICK) {
714-
check_route(router_opts.route_type, /*quick=*/true);
715-
} else if (router_opts.check_route == e_check_route_option::FULL) {
716-
check_route(router_opts.route_type, /*quick=*/false);
717-
} else {
718-
VTR_LOG_WARN("The user disabled the check route step.");
719-
}
713+
check_route(router_opts.route_type, router_opts.check_route);
720714
get_serial_num();
721715

722716
//Update status

vpr/src/route/check_route.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,18 @@ static void check_net_for_stubs(ClusterNetId net);
3434

3535
/************************ Subroutine definitions ****************************/
3636

37-
void check_route(enum e_route_type route_type, bool quick) {
37+
void check_route(enum e_route_type route_type, e_check_route_option check_route_option) {
3838
/* This routine checks that a routing: (1) Describes a properly *
3939
* connected path for each net, (2) this path connects all the *
4040
* pins spanned by that net, and (3) that no routing resources are *
4141
* oversubscribed (the occupancy of everything is recomputed from *
4242
* scratch). */
4343

44+
if (check_route_option == e_check_route_option::OFF) {
45+
VTR_LOG_WARN("The user disabled the check route step.");
46+
return;
47+
}
48+
4449
int max_pins, inode, prev_node;
4550
unsigned int ipin;
4651
bool valid, connects;
@@ -160,8 +165,10 @@ void check_route(enum e_route_type route_type, bool quick) {
160165

161166
} /* End for each net */
162167

163-
if (!quick) {
168+
if (check_route_option == e_check_route_option::FULL) {
164169
check_all_non_configurable_edges();
170+
} else {
171+
VTR_ASSERT(check_route_option == e_check_route_option::QUICK);
165172
}
166173

167174
VTR_LOG("Completed routing consistency check successfully.\n");

vpr/src/route/check_route.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#ifndef VPR_CHECK_ROUTE_H
22
#define VPR_CHECK_ROUTE_H
33
#include "physical_types.h"
4+
#include "vpr_types.h"
45
#include "route_common.h"
56

6-
void check_route(enum e_route_type route_type, bool quick);
7+
void check_route(enum e_route_type route_type, e_check_route_option check_route_option);
78

89
void recompute_occupancy_from_scratch();
910

0 commit comments

Comments
 (0)