Skip to content

Route-verbosity #2723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/src/vpr/command_line_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,13 @@ VPR uses a negotiated congestion algorithm (based on Pathfinder) to perform rout
* `swns` - setup Worst Negative Slack (sWNS) [ns]
* `stns` - Setup Total Negative Slack (sTNS) [ns]

.. option:: --route_verbosity <int>

Controls the verbosity of routing output.
High values produce more detailed output, which can be useful for debugging or understanding the routing process.

**Default**: ``1``

.. _timing_driven_router_options:

Timing-Driven Router Options
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
RouterOpts->pres_fac_mult = Options.pres_fac_mult;
RouterOpts->max_pres_fac = Options.max_pres_fac;
RouterOpts->route_type = Options.RouteType;
RouterOpts->route_verbosity = Options.route_verbosity;

RouterOpts->full_stats = Options.full_stats;

Expand Down
5 changes: 5 additions & 0 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2495,6 +2495,11 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
.default_value("false")
.show_in(argparse::ShowIn::HELP_ONLY);


route_grp.add_argument<int>(args.route_verbosity, "--route_verbosity")
.help("Controls the verbosity of routing's output. Higher values produce more output (useful for debugging routing problems)")
.default_value("1")
.show_in(argparse::ShowIn::HELP_ONLY);
route_grp.add_argument(args.custom_3d_sb_fanin_fanout, "--custom_3d_sb_fanin_fanout")
.help(
"Specifies the number of tracks that can drive a 3D switch block connection"
Expand Down
2 changes: 2 additions & 0 deletions vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@ struct t_options {
argparse::ArgValue<int> reorder_rr_graph_nodes_seed;
argparse::ArgValue<bool> flat_routing;
argparse::ArgValue<bool> has_choking_spot;
argparse::ArgValue<int> route_verbosity;
argparse::ArgValue<int> custom_3d_sb_fanin_fanout;


/* Timing-driven router options only */
argparse::ArgValue<float> astar_fac;
argparse::ArgValue<float> astar_offset;
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/vpr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,7 @@ struct t_router_opts {
int router_debug_iteration;
e_router_lookahead lookahead_type;
int max_convergence_count;
int route_verbosity;
float reconvergence_cpd_threshold;
e_router_initial_timing initial_timing;
bool update_lower_bound_delays;
Expand Down
20 changes: 15 additions & 5 deletions vpr/src/route/rr_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ static int get_opin_direct_connections(RRGraphBuilder& rr_graph_builder,
static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder& rr_graph_builder,
t_rr_graph_storage& L_rr_node,
const RRGraphView& rr_graph,
const t_router_opts& router_opts,
const int num_seg_types,
const int num_seg_types_x,
const t_unified_to_parallel_seg_index& seg_index_map,
Expand Down Expand Up @@ -665,6 +666,7 @@ static void build_rr_graph(const t_graph_type graph_type,
const std::vector<t_physical_tile_type>& types,
const DeviceGrid& grid,
t_chan_width nodes_per_chan,
t_router_opts router_opts,
const enum e_switch_block_type sb_type,
const int Fs,
const std::vector<t_switchblock_inf>& switchblocks,
Expand Down Expand Up @@ -769,6 +771,7 @@ void create_rr_graph(const t_graph_type graph_type,
block_types,
grid,
nodes_per_chan,
router_opts,
det_routing_arch->switch_block_type,
det_routing_arch->Fs,
det_routing_arch->switchblocks,
Expand Down Expand Up @@ -994,6 +997,7 @@ static void build_rr_graph(const t_graph_type graph_type,
const std::vector<t_physical_tile_type>& types,
const DeviceGrid& grid,
t_chan_width nodes_per_chan,
t_router_opts router_opts,
const enum e_switch_block_type sb_type,
const int Fs,
const std::vector<t_switchblock_inf>& switchblocks,
Expand Down Expand Up @@ -1392,7 +1396,7 @@ static void build_rr_graph(const t_graph_type graph_type,
auto update_chan_width = alloc_and_load_rr_graph(
device_ctx.rr_graph_builder,

device_ctx.rr_graph_builder.rr_nodes(), device_ctx.rr_graph, segment_inf.size(),
device_ctx.rr_graph_builder.rr_nodes(), device_ctx.rr_graph, router_opts, segment_inf.size(),
segment_inf_x.size(),
segment_index_map,
chan_details_x, chan_details_y,
Expand Down Expand Up @@ -2065,6 +2069,7 @@ static std::vector<vtr::Matrix<int>> alloc_and_load_actual_fc(const std::vector<
static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder& rr_graph_builder,
t_rr_graph_storage& L_rr_node,
const RRGraphView& rr_graph,
const t_router_opts& router_opts,
const int num_seg_types,
const int num_seg_types_x,
const t_unified_to_parallel_seg_index& seg_index_map,
Expand Down Expand Up @@ -2116,6 +2121,9 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
the edges are not remapped yet.*/
bool switches_remapped = false;

// Define verbosity locally using router_opts
const int verbosity = router_opts.route_verbosity;

int num_edges = 0;
/* Connection SINKS and SOURCES to their pins - Initializing IPINs/OPINs. */
for (int layer = 0; layer < grid.get_num_layers(); ++layer) {
Expand Down Expand Up @@ -2161,7 +2169,7 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
}
}

VTR_LOG("SOURCE->OPIN and IPIN->SINK edge count:%d\n", num_edges);
VTR_LOGV(verbosity > 1,"SOURCE->OPIN and IPIN->SINK edge count:%d\n", num_edges);
num_edges = 0;
/* Build opins */
int rr_edges_before_directs = 0;
Expand Down Expand Up @@ -2198,8 +2206,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
}
}

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

num_edges = 0;
/* Build channels */
Expand Down Expand Up @@ -2278,6 +2286,7 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
}
}


if(grid.get_num_layers() > 1 && sb_conn_map != nullptr){
uniquify_edges(des_3d_rr_edges_to_create);
alloc_and_load_edges(rr_graph_builder, des_3d_rr_edges_to_create);
Expand All @@ -2286,7 +2295,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
}


VTR_LOG("CHAN->CHAN type edge count:%d\n", num_edges);
VTR_LOGV(verbosity > 1,"CHAN->CHAN type edge count:%d\n", num_edges);

num_edges = 0;
std::function<void(t_chan_width*)> update_chan_width = [](t_chan_width*) noexcept {};
if (clock_modeling == DEDICATED_NETWORK) {
Expand Down
Loading