Skip to content

Commit d554ff9

Browse files
authored
Merge pull request #2723 from ZohairZaidi/route-verbosity
Route-verbosity
2 parents 6595b26 + 1c6dad6 commit d554ff9

File tree

6 files changed

+32
-10
lines changed

6 files changed

+32
-10
lines changed

doc/src/vpr/command_line_usage.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,13 @@ VPR uses a negotiated congestion algorithm (based on Pathfinder) to perform rout
12921292
* `swns` - setup Worst Negative Slack (sWNS) [ns]
12931293
* `stns` - Setup Total Negative Slack (sTNS) [ns]
12941294

1295+
.. option:: --route_verbosity <int>
1296+
1297+
Controls the verbosity of routing output.
1298+
High values produce more detailed output, which can be useful for debugging or understanding the routing process.
1299+
1300+
**Default**: ``1``
1301+
12951302
.. _timing_driven_router_options:
12961303

12971304
Timing-Driven Router Options

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
435435
RouterOpts->pres_fac_mult = Options.pres_fac_mult;
436436
RouterOpts->max_pres_fac = Options.max_pres_fac;
437437
RouterOpts->route_type = Options.RouteType;
438+
RouterOpts->route_verbosity = Options.route_verbosity;
438439

439440
RouterOpts->full_stats = Options.full_stats;
440441

vpr/src/base/read_options.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,11 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
24952495
.default_value("false")
24962496
.show_in(argparse::ShowIn::HELP_ONLY);
24972497

2498+
2499+
route_grp.add_argument<int>(args.route_verbosity, "--route_verbosity")
2500+
.help("Controls the verbosity of routing's output. Higher values produce more output (useful for debugging routing problems)")
2501+
.default_value("1")
2502+
.show_in(argparse::ShowIn::HELP_ONLY);
24982503
route_grp.add_argument(args.custom_3d_sb_fanin_fanout, "--custom_3d_sb_fanin_fanout")
24992504
.help(
25002505
"Specifies the number of tracks that can drive a 3D switch block connection"

vpr/src/base/read_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ struct t_options {
218218
argparse::ArgValue<int> reorder_rr_graph_nodes_seed;
219219
argparse::ArgValue<bool> flat_routing;
220220
argparse::ArgValue<bool> has_choking_spot;
221+
argparse::ArgValue<int> route_verbosity;
221222
argparse::ArgValue<int> custom_3d_sb_fanin_fanout;
222223

223224
/* Timing-driven router options only */

vpr/src/base/vpr_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,7 @@ struct t_router_opts {
13781378
int router_debug_iteration;
13791379
e_router_lookahead lookahead_type;
13801380
int max_convergence_count;
1381+
int route_verbosity;
13811382
float reconvergence_cpd_threshold;
13821383
e_router_initial_timing initial_timing;
13831384
bool update_lower_bound_delays;

vpr/src/route/rr_graph.cpp

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
208208
const t_clb_to_clb_directs* clb_to_clb_directs,
209209
bool is_global_graph,
210210
const enum e_clock_modeling clock_modeling,
211-
bool is_flat);
211+
bool is_flat,
212+
const int route_verbosity);
212213

213214
static void alloc_and_load_intra_cluster_rr_graph(RRGraphBuilder& rr_graph_builder,
214215
const DeviceGrid& grid,
@@ -682,7 +683,8 @@ static void build_rr_graph(const t_graph_type graph_type,
682683
const int num_directs,
683684
int* wire_to_rr_ipin_switch,
684685
bool is_flat,
685-
int* Warnings);
686+
int* Warnings,
687+
const int route_verbosity);
686688

687689
static void build_intra_cluster_rr_graph(const t_graph_type graph_type,
688690
const DeviceGrid& grid,
@@ -785,7 +787,8 @@ void create_rr_graph(const t_graph_type graph_type,
785787
directs, num_directs,
786788
&det_routing_arch->wire_to_rr_ipin_switch,
787789
is_flat,
788-
Warnings);
790+
Warnings,
791+
router_opts.route_verbosity);
789792
}
790793
}
791794

@@ -1011,7 +1014,8 @@ static void build_rr_graph(const t_graph_type graph_type,
10111014
const int num_directs,
10121015
int* wire_to_rr_ipin_switch,
10131016
bool is_flat,
1014-
int* Warnings) {
1017+
int* Warnings,
1018+
const int route_verbosity) {
10151019
vtr::ScopedStartFinishTimer timer("Build routing resource graph");
10161020

10171021
/* Reset warning flag */
@@ -1410,7 +1414,8 @@ static void build_rr_graph(const t_graph_type graph_type,
14101414
directs, num_directs, clb_to_clb_directs,
14111415
is_global_graph,
14121416
clock_modeling,
1413-
is_flat);
1417+
is_flat,
1418+
route_verbosity);
14141419

14151420
// Verify no incremental node allocation.
14161421
// AA: Note that in the case of dedicated networks, we are currently underestimating the additional node count due to the clock networks.
@@ -2093,7 +2098,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
20932098
const t_clb_to_clb_directs* clb_to_clb_directs,
20942099
bool is_global_graph,
20952100
const enum e_clock_modeling clock_modeling,
2096-
bool /*is_flat*/) {
2101+
bool /*is_flat*/,
2102+
const int route_verbosity) {
20972103
//We take special care when creating RR graph edges (there are typically many more
20982104
//edges than nodes in an RR graph).
20992105
//
@@ -2161,7 +2167,7 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
21612167
}
21622168
}
21632169

2164-
VTR_LOG("SOURCE->OPIN and IPIN->SINK edge count:%d\n", num_edges);
2170+
VTR_LOGV(route_verbosity > 1,"SOURCE->OPIN and IPIN->SINK edge count:%d\n", num_edges);
21652171
num_edges = 0;
21662172
/* Build opins */
21672173
int rr_edges_before_directs = 0;
@@ -2198,8 +2204,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
21982204
}
21992205
}
22002206

2201-
VTR_LOG("OPIN->CHANX/CHANY edge count before creating direct connections: %d\n", rr_edges_before_directs);
2202-
VTR_LOG("OPIN->CHANX/CHANY edge count after creating direct connections: %d\n", num_edges);
2207+
VTR_LOGV(route_verbosity > 1,"OPIN->CHANX/CHANY edge count before creating direct connections: %d\n", rr_edges_before_directs);
2208+
VTR_LOGV(route_verbosity > 1,"OPIN->CHANX/CHANY edge count after creating direct connections: %d\n", num_edges);
22032209

22042210
num_edges = 0;
22052211
/* Build channels */
@@ -2286,7 +2292,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
22862292
}
22872293

22882294

2289-
VTR_LOG("CHAN->CHAN type edge count:%d\n", num_edges);
2295+
VTR_LOGV(route_verbosity > 1,"CHAN->CHAN type edge count:%d\n", num_edges);
2296+
22902297
num_edges = 0;
22912298
std::function<void(t_chan_width*)> update_chan_width = [](t_chan_width*) noexcept {};
22922299
if (clock_modeling == DEDICATED_NETWORK) {

0 commit comments

Comments
 (0)