Skip to content

Commit 265e1b7

Browse files
committed
final route_verbosity feature update
1 parent 8d4e7e1 commit 265e1b7

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

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+
route_grp.add_argument<int>(args.route_verbosity, "--route_verbosity")
2499+
.help("Controls the verbosity of routing's output. Higher values produce more output (useful for debugging routing problems)")
2500+
.default_value("1")
2501+
.show_in(argparse::ShowIn::HELP_ONLY);
2502+
24982503
auto& route_timing_grp = parser.add_argument_group("timing-driven routing options");
24992504

25002505
route_timing_grp.add_argument(args.astar_fac, "--astar_fac")

vpr/src/route/rr_graph.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static int get_opin_direct_connections(RRGraphBuilder& rr_graph_builder,
180180
static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder& rr_graph_builder,
181181
t_rr_graph_storage& L_rr_node,
182182
const RRGraphView& rr_graph,
183+
const t_router_opts& router_opts,
183184
const int num_seg_types,
184185
const int num_seg_types_x,
185186
const t_unified_to_parallel_seg_index& seg_index_map,
@@ -642,6 +643,7 @@ static void build_rr_graph(const t_graph_type graph_type,
642643
const std::vector<t_physical_tile_type>& types,
643644
const DeviceGrid& grid,
644645
t_chan_width nodes_per_chan,
646+
t_router_opts router_opts,
645647
const enum e_switch_block_type sb_type,
646648
const int Fs,
647649
const std::vector<t_switchblock_inf>& switchblocks,
@@ -745,6 +747,7 @@ void create_rr_graph(const t_graph_type graph_type,
745747
block_types,
746748
grid,
747749
nodes_per_chan,
750+
router_opts,
748751
det_routing_arch->switch_block_type,
749752
det_routing_arch->Fs,
750753
det_routing_arch->switchblocks,
@@ -969,6 +972,7 @@ static void build_rr_graph(const t_graph_type graph_type,
969972
const std::vector<t_physical_tile_type>& types,
970973
const DeviceGrid& grid,
971974
t_chan_width nodes_per_chan,
975+
t_router_opts router_opts,
972976
const enum e_switch_block_type sb_type,
973977
const int Fs,
974978
const std::vector<t_switchblock_inf>& switchblocks,
@@ -1351,7 +1355,7 @@ static void build_rr_graph(const t_graph_type graph_type,
13511355
auto update_chan_width = alloc_and_load_rr_graph(
13521356
device_ctx.rr_graph_builder,
13531357

1354-
device_ctx.rr_graph_builder.rr_nodes(), device_ctx.rr_graph, segment_inf.size(),
1358+
device_ctx.rr_graph_builder.rr_nodes(), device_ctx.rr_graph, router_opts, segment_inf.size(),
13551359
segment_inf_x.size(),
13561360
segment_index_map,
13571361
chan_details_x, chan_details_y,
@@ -2021,6 +2025,7 @@ static std::vector<vtr::Matrix<int>> alloc_and_load_actual_fc(const std::vector<
20212025
static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder& rr_graph_builder,
20222026
t_rr_graph_storage& L_rr_node,
20232027
const RRGraphView& rr_graph,
2028+
const t_router_opts& router_opts,
20242029
const int num_seg_types,
20252030
const int num_seg_types_x,
20262031
const t_unified_to_parallel_seg_index& seg_index_map,
@@ -2071,6 +2076,9 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
20712076
the edges are not remapped yet.*/
20722077
bool switches_remapped = false;
20732078

2079+
// Define verbosity locally using router_opts
2080+
const int verbosity = router_opts.route_verbosity;
2081+
20742082
int num_edges = 0;
20752083
/* Connection SINKS and SOURCES to their pins - Initializing IPINs/OPINs. */
20762084
for (int layer = 0; layer < grid.get_num_layers(); ++layer) {
@@ -2116,7 +2124,7 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
21162124
}
21172125
}
21182126

2119-
VTR_LOG("SOURCE->OPIN and IPIN->SINK edge count:%d\n", num_edges);
2127+
VTR_LOGV(verbosity > 1,"SOURCE->OPIN and IPIN->SINK edge count:%d\n", num_edges);
21202128
num_edges = 0;
21212129
/* Build opins */
21222130
int rr_edges_before_directs = 0;
@@ -2153,8 +2161,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
21532161
}
21542162
}
21552163

2156-
VTR_LOG("OPIN->CHANX/CHANY edge count before creating direct connections: %d\n", rr_edges_before_directs);
2157-
VTR_LOG("OPIN->CHANX/CHANY edge count after creating direct connections: %d\n", num_edges);
2164+
VTR_LOGV(verbosity > 1,"OPIN->CHANX/CHANY edge count before creating direct connections: %d\n", rr_edges_before_directs);
2165+
VTR_LOGV(verbosity > 1,"OPIN->CHANX/CHANY edge count after creating direct connections: %d\n", num_edges);
21582166

21592167
num_edges = 0;
21602168
/* Build channels */

0 commit comments

Comments
 (0)