Skip to content

Commit

Permalink
Merge pull request verilog-to-routing#2723 from ZohairZaidi/route-ver…
Browse files Browse the repository at this point in the history
…bosity

Route-verbosity
  • Loading branch information
vaughnbetz authored Sep 18, 2024
2 parents 6595b26 + 1c6dad6 commit d554ff9
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 10 deletions.
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 @@ -1378,6 +1378,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
27 changes: 17 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 int route_verbosity);

static void build_intra_cluster_rr_graph(const t_graph_type graph_type,
const DeviceGrid& grid,
Expand Down Expand Up @@ -785,7 +787,8 @@ 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.route_verbosity);
}
}

Expand Down Expand Up @@ -1011,7 +1014,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 int route_verbosity) {
vtr::ScopedStartFinishTimer timer("Build routing resource graph");

/* Reset warning flag */
Expand Down Expand Up @@ -1410,7 +1414,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,
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 +2098,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 Down Expand Up @@ -2161,7 +2167,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(route_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 +2204,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(route_verbosity > 1,"OPIN->CHANX/CHANY edge count before creating direct connections: %d\n", rr_edges_before_directs);
VTR_LOGV(route_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 +2292,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(route_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

0 comments on commit d554ff9

Please sign in to comment.