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 4 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
1 change: 1 addition & 0 deletions vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ 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 */
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
31 changes: 21 additions & 10 deletions vpr/src/route/rr_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
const t_clb_to_clb_directs* clb_to_clb_directs,
bool is_global_graph,
const enum e_clock_modeling clock_modeling,
bool is_flat);
bool is_flat,
const int route_verbosity);

static void alloc_and_load_intra_cluster_rr_graph(RRGraphBuilder& rr_graph_builder,
const DeviceGrid& grid,
Expand Down Expand Up @@ -682,7 +683,8 @@ static void build_rr_graph(const t_graph_type graph_type,
const int num_directs,
int* wire_to_rr_ipin_switch,
bool is_flat,
int* Warnings);
int* Warnings,
const t_router_opts& router_opts);

static void build_intra_cluster_rr_graph(const t_graph_type graph_type,
const DeviceGrid& grid,
Expand Down Expand Up @@ -785,7 +787,9 @@ void create_rr_graph(const t_graph_type graph_type,
directs, num_directs,
&det_routing_arch->wire_to_rr_ipin_switch,
is_flat,
Warnings);
Warnings,
router_opts
);
}
}

Expand Down Expand Up @@ -1011,7 +1015,8 @@ static void build_rr_graph(const t_graph_type graph_type,
const int num_directs,
int* wire_to_rr_ipin_switch,
bool is_flat,
int* Warnings) {
int* Warnings,
const t_router_opts& router_opts) {
vtr::ScopedStartFinishTimer timer("Build routing resource graph");

/* Reset warning flag */
Expand Down Expand Up @@ -1410,7 +1415,8 @@ static void build_rr_graph(const t_graph_type graph_type,
directs, num_directs, clb_to_clb_directs,
is_global_graph,
clock_modeling,
is_flat);
is_flat,
router_opts.route_verbosity);

// Verify no incremental node allocation.
// AA: Note that in the case of dedicated networks, we are currently underestimating the additional node count due to the clock networks.
Expand Down Expand Up @@ -2093,7 +2099,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
const t_clb_to_clb_directs* clb_to_clb_directs,
bool is_global_graph,
const enum e_clock_modeling clock_modeling,
bool /*is_flat*/) {
bool /*is_flat*/,
const int route_verbosity) {
//We take special care when creating RR graph edges (there are typically many more
//edges than nodes in an RR graph).
//
Expand All @@ -2116,6 +2123,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 = 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 +2171,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 +2208,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 @@ -2286,7 +2296,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