Skip to content

Commit 536d009

Browse files
committed
[CLI] rename verify_rr_switch_id to verify_route_file_switch_id
1 parent 438c4c8 commit 536d009

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
517517
RouterOpts->custom_3d_sb_fanin_fanout = Options.custom_3d_sb_fanin_fanout;
518518
RouterOpts->with_timing_analysis = Options.timing_analysis;
519519

520-
RouterOpts->verify_rr_switch_id = Options.verify_rr_switch_id;
520+
RouterOpts->verify_route_file_switch_id = Options.verify_route_file_switch_id ;
521521

522522
RouterOpts->generate_router_lookahead_report = Options.generate_router_lookahead_report.value();
523523
}

vpr/src/base/read_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
16371637
.default_value("on")
16381638
.show_in(argparse::ShowIn::HELP_ONLY);
16391639

1640-
gen_grp.add_argument<bool, ParseOnOff>(args.verify_rr_switch_id, "--verify_rr_switch_id")
1640+
gen_grp.add_argument<bool, ParseOnOff>(args.verify_route_file_switch_id , "--verify_route_file_switch_id")
16411641
.help(
16421642
"Verify that the switch IDs in the routing file are consistent with those in the RR Graph. "
16431643
"Set this to false when switch IDs in the routing file may differ from the RR Graph. "

vpr/src/base/read_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct t_options {
7373
argparse::ArgValue<e_timing_update_type> timing_update_type;
7474
argparse::ArgValue<bool> CreateEchoFile;
7575
argparse::ArgValue<bool> verify_file_digests;
76-
argparse::ArgValue<bool> verify_rr_switch_id;
76+
argparse::ArgValue<bool> verify_route_file_switch_id ;
7777
argparse::ArgValue<std::string> device_layout;
7878
argparse::ArgValue<float> target_device_utilization;
7979
argparse::ArgValue<e_constant_net_method> constant_net_method;

vpr/src/base/read_route.cpp

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
* @param fp The file stream to read from.
4848
* @param filename The name of the file to read from.
4949
* @param lineno The line number currently being processed.
50-
* @param verify_rr_switch_id Whether to verify the RR switch IDs in the routing file.
50+
* @param verify_route_file_switch_id Whether to verify the RR switch IDs in the routing file.
5151
* @param is_flat Whether flat-router is enabled.
5252
*/
5353
static void process_route(const Netlist<>& net_list,
5454
std::ifstream& fp,
5555
const char* filename,
5656
int& lineno,
57-
bool verify_rr_switch_id,
57+
bool verify_route_file_switch_id ,
5858
bool is_flat);
5959

6060
/**
@@ -64,13 +64,13 @@ static void process_route(const Netlist<>& net_list,
6464
* @param fp The file stream to read from.
6565
* @param inet The net ID to process.
6666
* @param filename The name of the file to read from.
67-
* @param verify_rr_switch_id Whether to verify the RR switch IDs in the routing file.
67+
* @param verify_route_file_switch_id Whether to verify the RR switch IDs in the routing file.
6868
*/
6969
static void process_nodes(const Netlist<>& net_list,
7070
std::ifstream& fp,
7171
ClusterNetId inet,
7272
const char* filename,
73-
bool verify_rr_switch_id,
73+
bool verify_route_file_switch_id ,
7474
int& lineno);
7575

7676
/**
@@ -83,7 +83,7 @@ static void process_nodes(const Netlist<>& net_list,
8383
* @param input_tokens The tokens of the net.
8484
* @param filename The name of the file to read from.
8585
* @param lineno The line number currently being processed.
86-
* @param verify_rr_switch_id Whether to verify the RR switch IDs in the routing file.
86+
* @param verify_route_file_switch_id Whether to verify the RR switch IDs in the routing file.
8787
* @param is_flat Whether flat-router is enabled.
8888
*/
8989
static void process_nets(const Netlist<>& net_list,
@@ -93,7 +93,7 @@ static void process_nets(const Netlist<>& net_list,
9393
std::vector<std::string> input_tokens,
9494
const char* filename,
9595
int& lineno,
96-
bool verify_rr_switch_id,
96+
bool verify_route_file_switch_id ,
9797
bool is_flat);
9898

9999
/**
@@ -206,7 +206,7 @@ bool read_route(const char* route_file,
206206
}
207207

208208
/* Read in every net */
209-
process_route(router_net_list, fp, route_file, lineno, router_opts.verify_rr_switch_id, is_flat);
209+
process_route(router_net_list, fp, route_file, lineno, router_opts.verify_route_file_switch_id , is_flat);
210210

211211
fp.close();
212212

@@ -242,7 +242,7 @@ static void process_route(const Netlist<>& net_list,
242242
std::ifstream& fp,
243243
const char* filename,
244244
int& lineno,
245-
bool verify_rr_switch_id,
245+
bool verify_route_file_switch_id ,
246246
bool is_flat) {
247247
std::string input;
248248
std::vector<std::string> tokens;
@@ -263,7 +263,7 @@ static void process_route(const Netlist<>& net_list,
263263
tokens,
264264
filename,
265265
lineno,
266-
verify_rr_switch_id,
266+
verify_route_file_switch_id ,
267267
is_flat);
268268
}
269269
}
@@ -278,7 +278,7 @@ static void process_nets(const Netlist<>& net_list,
278278
std::vector<std::string> input_tokens,
279279
const char* filename,
280280
int& lineno,
281-
bool verify_rr_switch_id,
281+
bool verify_route_file_switch_id ,
282282
bool is_flat) {
283283
if (input_tokens.size() > 3 && input_tokens[3] == "global"
284284
&& input_tokens[4] == "net" && input_tokens[5] == "connecting:") {
@@ -316,7 +316,7 @@ static void process_nets(const Netlist<>& net_list,
316316
fp,
317317
inet,
318318
filename,
319-
verify_rr_switch_id,
319+
verify_route_file_switch_id ,
320320
lineno);
321321
}
322322
input_tokens.clear();
@@ -326,7 +326,7 @@ static void process_nodes(const Netlist<>& net_list,
326326
std::ifstream& fp,
327327
ClusterNetId inet,
328328
const char* filename,
329-
bool verify_rr_switch_id,
329+
bool verify_route_file_switch_id ,
330330
int& lineno) {
331331
/* Not a global net. Goes through every node and add it into trace.head*/
332332
auto& device_ctx = g_vpr_ctx.mutable_device();
@@ -519,7 +519,7 @@ static void process_nodes(const Netlist<>& net_list,
519519
oldpos = fp.tellg();
520520
}
521521

522-
if (verify_rr_switch_id) {
522+
if (verify_route_file_switch_id ) {
523523
VTR_ASSERT(validate_traceback(head_ptr));
524524
} else {
525525
std::set<int> seen_rr_nodes;
@@ -544,22 +544,21 @@ static void update_rr_switch_id(t_trace* trace, std::set<int>& seen_rr_nodes) {
544544
return;
545545
}
546546

547-
if (trace->iswitch == OPEN) { //End of a branch
548-
//Verify that the next element (branch point) has been already seen in the traceback so far
547+
if (trace->iswitch == OPEN) { // End of a branch
548+
// Verify that the next element (branch point) has been already seen in the traceback so far
549549
if (!seen_rr_nodes.count(next->index)) {
550550
VPR_FATAL_ERROR(VPR_ERROR_ROUTE, "Traceback branch point %d not found", next->index);
551551
}
552-
} else { //Midway along branch
553-
//Check there is an edge connecting trace and next
554-
auto& device_ctx = g_vpr_ctx.device();
555-
const auto& rr_graph = device_ctx.rr_graph;
552+
} else { // Midway along branch
553+
// Check there is an edge connecting trace and next
554+
const auto& rr_graph = g_vpr_ctx.device().rr_graph;
556555
bool found = false;
557556
for (t_edge_size iedge = 0; iedge < rr_graph.num_edges(RRNodeId(trace->index)); ++iedge) {
558557
int to_node = size_t(rr_graph.edge_sink_node(RRNodeId(trace->index), iedge));
559558
if (to_node == next->index) {
560559
found = true;
561560

562-
//Verify that the switch matches
561+
// Verify that the switch matches
563562
int rr_iswitch = rr_graph.edge_switch(RRNodeId(trace->index), iedge);
564563
trace->iswitch = rr_iswitch;
565564
break;
@@ -569,7 +568,7 @@ static void update_rr_switch_id(t_trace* trace, std::set<int>& seen_rr_nodes) {
569568
VPR_FATAL_ERROR(VPR_ERROR_ROUTE, "Traceback no RR edge between RR nodes %d -> %d\n", trace->index, next->index);
570569
}
571570
}
572-
//Recurse
571+
// Recurse
573572
update_rr_switch_id(next, seen_rr_nodes);
574573
}
575574

vpr/src/base/vpr_types.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,9 +1343,10 @@ struct t_router_opts {
13431343

13441344
bool with_timing_analysis;
13451345

1346-
bool verify_rr_switch_id;
1346+
/// Whether to verify the switch IDs in the route file with the RR Graph.
1347+
bool verify_route_file_switch_id;
13471348

1348-
// Options related to rr_node reordering, for testing and possible cache optimization
1349+
/// Options related to rr_node reordering, for testing and possible cache optimization
13491350
e_rr_node_reorder_algorithm reorder_rr_graph_nodes_algorithm = DONT_REORDER;
13501351
int reorder_rr_graph_nodes_threshold = 0;
13511352
int reorder_rr_graph_nodes_seed = 1;

0 commit comments

Comments
 (0)