Skip to content

Commit 8dd84f0

Browse files
authored
Merge pull request #2777 from verilog-to-routing/turn_on_choke_point
Turn On Choke Point By Default [WIP]
2 parents 24b3bd3 + 53f3b3b commit 8dd84f0

File tree

15 files changed

+31
-34
lines changed

15 files changed

+31
-34
lines changed

libs/libarchfpga/src/physical_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ class t_pb_graph_pin {
13821382
float tco_max = std::numeric_limits<float>::quiet_NaN(); /* For sequential logic elements the maximum clock to output time */
13831383
t_pb_graph_pin* associated_clock_pin = nullptr; /* For sequentail elements, the associated clock */
13841384

1385-
/* This member is used when flat-routing and has_choking_spot are enabled.
1385+
/* This member is used when flat-routing and router_opt_choke_points are enabled.
13861386
* It is used to identify choke points.
13871387
* This is only valid for IPINs, and it only contain the pins that are reachable to the pin by a forwarding path.
13881388
* It doesn't take into account feed-back connection.

vpr/src/base/SetupVPR.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ void SetupVPR(const t_options* options,
318318
vtr::ScopedStartFinishTimer timer("Allocate intra-cluster resources");
319319
// The following two functions should be called when the data structured related to t_pb_graph_node, t_pb_type,
320320
// and t_pb_graph_edge are initialized
321-
alloc_and_load_intra_cluster_resources(routerOpts->has_choking_spot);
321+
alloc_and_load_intra_cluster_resources(routerOpts->has_choke_point);
322322
add_intra_tile_switches();
323323
}
324324

@@ -510,7 +510,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
510510
RouterOpts->max_logged_overused_rr_nodes = Options.max_logged_overused_rr_nodes;
511511
RouterOpts->generate_rr_node_overuse_report = Options.generate_rr_node_overuse_report;
512512
RouterOpts->flat_routing = Options.flat_routing;
513-
RouterOpts->has_choking_spot = Options.has_choking_spot;
513+
RouterOpts->has_choke_point = Options.router_opt_choke_points;
514514
RouterOpts->custom_3d_sb_fanin_fanout = Options.custom_3d_sb_fanin_fanout;
515515
RouterOpts->with_timing_analysis = Options.timing_analysis;
516516
}

vpr/src/base/ShowSetup.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
255255
VTR_LOG("false\n");
256256
}
257257

258-
VTR_LOG("RouterOpts.has_choking_spot: ");
259-
if (RouterOpts.has_choking_spot) {
260-
VTR_LOG("true\n");
258+
VTR_LOG("RouterOpts.choke_points: ");
259+
if (RouterOpts.has_choke_point) {
260+
VTR_LOG("on\n");
261261
} else {
262-
VTR_LOG("false\n");
262+
VTR_LOG("off\n");
263263
}
264264

265265
VTR_ASSERT(GLOBAL == RouterOpts.route_type || DETAILED == RouterOpts.route_type);

vpr/src/base/place_and_route.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,
398398

399399
init_route_structs(router_net_list,
400400
router_opts.bb_factor,
401-
router_opts.has_choking_spot,
401+
router_opts.has_choke_point,
402402
is_flat);
403403

404404
restore_routing(best_routing,

vpr/src/base/read_options.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,13 +2491,13 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
24912491
.default_value("off")
24922492
.show_in(argparse::ShowIn::HELP_ONLY);
24932493

2494-
route_grp.add_argument(args.has_choking_spot, "--has_choking_spot")
2494+
route_grp.add_argument<bool, ParseOnOff>(args.router_opt_choke_points, "--router_opt_choke_points")
24952495
.help(
24962496
""
2497-
"Some FPGA architectures, due to the lack of full connectivity inside the cluster, may have"
2498-
" a choking spot inside the cluster. Thus, if routing doesn't converge, enabling this option may"
2499-
" help it.")
2500-
.default_value("false")
2497+
"Some FPGA architectures with limited fan-out options within a cluster (e.g. fracturable LUTs with shared pins) do"
2498+
" not converge well in routing unless these fan-out choke points are discovered and optimized for during net routing."
2499+
" This option helps router convergence for such architectures.")
2500+
.default_value("on")
25012501
.show_in(argparse::ShowIn::HELP_ONLY);
25022502

25032503

vpr/src/base/read_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ struct t_options {
218218
argparse::ArgValue<int> reorder_rr_graph_nodes_threshold;
219219
argparse::ArgValue<int> reorder_rr_graph_nodes_seed;
220220
argparse::ArgValue<bool> flat_routing;
221-
argparse::ArgValue<bool> has_choking_spot;
221+
argparse::ArgValue<bool> router_opt_choke_points;
222222
argparse::ArgValue<int> route_verbosity;
223223
argparse::ArgValue<int> custom_3d_sb_fanin_fanout;
224224

vpr/src/base/read_route.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ bool read_route(const char* route_file, const t_router_opts& router_opts, bool v
109109
const Netlist<>& router_net_list = (flat_router) ? (const Netlist<>&)g_vpr_ctx.atom().nlist : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist;
110110
init_route_structs(router_net_list,
111111
router_opts.bb_factor,
112-
router_opts.has_choking_spot,
112+
router_opts.has_choke_point,
113113
flat_router);
114114

115115
/*Check dimensions*/

vpr/src/base/vpr_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ struct t_router_opts {
13391339
bool generate_rr_node_overuse_report;
13401340

13411341
bool flat_routing;
1342-
bool has_choking_spot;
1342+
bool has_choke_point;
13431343

13441344
int custom_3d_sb_fanin_fanout = 1;
13451345

vpr/src/route/connection_router.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ void ConnectionRouter<Heap>::evaluate_timing_driven_node_costs(t_heap* to,
775775
//cost.
776776
cong_cost = 0.;
777777
}
778-
if (conn_params_->has_choking_spot_ && is_flat_ && rr_graph_->node_type(to_node) == IPIN) {
778+
if (conn_params_->router_opt_choke_points_ && is_flat_ && rr_graph_->node_type(to_node) == IPIN) {
779779
auto find_res = conn_params_->connection_choking_spots_.find(to_node);
780780
if (find_res != conn_params_->connection_choking_spots_.end()) {
781781
cong_cost = cong_cost / pow(2, (float)find_res->second);

vpr/src/route/route.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool route(const Netlist<>& net_list,
7171

7272
init_route_structs(net_list,
7373
router_opts.bb_factor,
74-
router_opts.has_choking_spot,
74+
router_opts.has_choke_point,
7575
is_flat);
7676

7777
IntraLbPbPinLookup intra_lb_pb_pin_lookup(device_ctx.logical_block_types);
@@ -80,7 +80,7 @@ bool route(const Netlist<>& net_list,
8080
auto choking_spots = set_nets_choking_spots(net_list,
8181
route_ctx.net_terminal_groups,
8282
route_ctx.net_terminal_group_num,
83-
router_opts.has_choking_spot,
83+
router_opts.has_choke_point,
8484
is_flat);
8585

8686
//Initially, the router runs normally trying to reduce congestion while

vpr/src/route/route_net.tpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ inline NetResultFlags route_sink(ConnectionRouter& router,
436436
bool sink_critical = (cost_params.criticality > HIGH_FANOUT_CRITICALITY_THRESHOLD);
437437
bool net_is_clock = route_ctx.is_clock_net[net_id] != 0;
438438

439-
bool has_choking_spot = ((int)choking_spots[target_pin].size() != 0) && router_opts.has_choking_spot;
440-
ConnectionParameters conn_params(net_id, target_pin, has_choking_spot, choking_spots[target_pin]);
439+
bool router_opt_choke_points = ((int)choking_spots[target_pin].size() != 0) && router_opts.has_choke_point;
440+
ConnectionParameters conn_params(net_id, target_pin, router_opt_choke_points, choking_spots[target_pin]);
441441

442442
//We normally route high fanout nets by only adding spatially close-by routing to the heap (reduces run-time).
443443
//However, if the current sink is 'critical' from a timing perspective, we put the entire route tree back onto

vpr/src/route/route_utils.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,21 +391,18 @@ vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int>>> set_net
391391
std::vector<std::vector<int>>>& net_terminal_groups,
392392
const vtr::vector<ParentNetId,
393393
std::vector<int>>& net_terminal_group_num,
394-
bool has_choking_spot,
394+
bool router_opt_choke_points,
395395
bool is_flat) {
396396
vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int>>> choking_spots(net_list.nets().size());
397397
for (const auto& net_id : net_list.nets()) {
398398
choking_spots[net_id].resize(net_list.net_pins(net_id).size());
399399
}
400400

401-
// Return if the architecture doesn't have any potential choke points
402-
if (!has_choking_spot) {
401+
// Return if the architecture doesn't have any potential choke points or flat router is not enabled
402+
if (!router_opt_choke_points || !is_flat) {
403403
return choking_spots;
404404
}
405405

406-
// We only identify choke points if flat_routing is enabled.
407-
VTR_ASSERT(is_flat);
408-
409406
const auto& device_ctx = g_vpr_ctx.device();
410407
const auto& rr_graph = device_ctx.rr_graph;
411408
const auto& route_ctx = g_vpr_ctx.routing();

vpr/src/route/route_utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,22 @@ void print_router_criticality_histogram(const Netlist<>& net_list,
121121
void prune_unused_non_configurable_nets(CBRR& connections_inf,
122122
const Netlist<>& net_list);
123123

124-
/** If flat_routing and has_choking_spot are true, there are some choke points inside the cluster which would increase the convergence time of routing.
124+
/** If flat_routing and router_opt_choke_points are true, there are some choke points inside the cluster which would increase the convergence time of routing.
125125
* To address this issue, the congestion cost of those choke points needs to decrease. This function identify those choke points for each net,
126126
* and since the amount of congestion reduction is dependant on the number sinks reachable from that choke point, it also store the number of reachable sinks
127127
* for each choke point.
128128
* @param net_list
129129
* @param net_terminal_groups [Net_id][group_id] -> rr_node_id of the pins in the group
130130
* @param net_terminal_group_num [Net_id][pin_id] -> group_id
131-
* @param has_choking_spot is true if the given architecture has choking spots inside the cluster
131+
* @param router_opt_choke_points is true if the given architecture has choking spots inside the cluster
132132
* @param is_flat is true if flat_routing is enabled
133133
* @return [Net_id][pin_id] -> [choke_point_rr_node_id, number of sinks reachable by this choke point] */
134134
vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int>>> set_nets_choking_spots(const Netlist<>& net_list,
135135
const vtr::vector<ParentNetId,
136136
std::vector<std::vector<int>>>& net_terminal_groups,
137137
const vtr::vector<ParentNetId,
138138
std::vector<int>>& net_terminal_group_num,
139-
bool has_choking_spot,
139+
bool router_opt_choke_points,
140140
bool is_flat);
141141

142142
/** Wrapper for create_rr_graph() with extra checks */

vpr/src/route/router_stats.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
struct ConnectionParameters {
1010
ConnectionParameters(ParentNetId net_id,
1111
int target_pin_num,
12-
bool has_choking_spot,
12+
bool router_opt_choke_points,
1313
const std::unordered_map<RRNodeId, int>& connection_choking_spots)
1414
: net_id_(net_id)
1515
, target_pin_num_(target_pin_num)
16-
, has_choking_spot_(has_choking_spot)
16+
, router_opt_choke_points_(router_opt_choke_points)
1717
, connection_choking_spots_(connection_choking_spots) {}
1818

1919
// Net id of the connection
@@ -24,7 +24,7 @@ struct ConnectionParameters {
2424
// Show whether for the given connection, router should expect a choking point
2525
// If this is true, it would increase the routing time since the router has to
2626
// take some measures to solve the congestion
27-
bool has_choking_spot_;
27+
bool router_opt_choke_points_;
2828

2929
const std::unordered_map<RRNodeId, int>& connection_choking_spots_;
3030
};

vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/vtr_reg_qor_large_depop_run_flat/config/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ qor_parse_file=qor_standard.txt
2929
pass_requirements_file=pass_requirements.txt
3030

3131
#Script parameters
32-
script_params=-track_memory_usage --max_router_iterations 300 --flat_routing on --has_choking_spot true
32+
script_params=-track_memory_usage --max_router_iterations 300 --flat_routing on --router_opt_choke_points true

0 commit comments

Comments
 (0)