Skip to content
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

Turn On Choke Point By Default #2777

Merged
merged 7 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/physical_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ class t_pb_graph_pin {
float tco_max = std::numeric_limits<float>::quiet_NaN(); /* For sequential logic elements the maximum clock to output time */
t_pb_graph_pin* associated_clock_pin = nullptr; /* For sequentail elements, the associated clock */

/* This member is used when flat-routing and has_choking_spot are enabled.
/* This member is used when flat-routing and router_opt_choke_points are enabled.
* It is used to identify choke points.
* This is only valid for IPINs, and it only contain the pins that are reachable to the pin by a forwarding path.
* It doesn't take into account feed-back connection.
Expand Down
4 changes: 2 additions & 2 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void SetupVPR(const t_options* options,
vtr::ScopedStartFinishTimer timer("Allocate intra-cluster resources");
// The following two functions should be called when the data structured related to t_pb_graph_node, t_pb_type,
// and t_pb_graph_edge are initialized
alloc_and_load_intra_cluster_resources(routerOpts->has_choking_spot);
alloc_and_load_intra_cluster_resources(routerOpts->has_choke_point);
add_intra_tile_switches();
}

Expand Down Expand Up @@ -510,7 +510,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
RouterOpts->max_logged_overused_rr_nodes = Options.max_logged_overused_rr_nodes;
RouterOpts->generate_rr_node_overuse_report = Options.generate_rr_node_overuse_report;
RouterOpts->flat_routing = Options.flat_routing;
RouterOpts->has_choking_spot = Options.has_choking_spot;
RouterOpts->has_choke_point = Options.router_opt_choke_points;
RouterOpts->custom_3d_sb_fanin_fanout = Options.custom_3d_sb_fanin_fanout;
RouterOpts->with_timing_analysis = Options.timing_analysis;
}
Expand Down
8 changes: 4 additions & 4 deletions vpr/src/base/ShowSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("false\n");
}

VTR_LOG("RouterOpts.has_choking_spot: ");
if (RouterOpts.has_choking_spot) {
VTR_LOG("true\n");
VTR_LOG("RouterOpts.choke_points: ");
if (RouterOpts.has_choke_point) {
VTR_LOG("on\n");
} else {
VTR_LOG("false\n");
VTR_LOG("off\n");
}

VTR_ASSERT(GLOBAL == RouterOpts.route_type || DETAILED == RouterOpts.route_type);
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/place_and_route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ int binary_search_place_and_route(const Netlist<>& placement_net_list,

init_route_structs(router_net_list,
router_opts.bb_factor,
router_opts.has_choking_spot,
router_opts.has_choke_point,
is_flat);

restore_routing(best_routing,
Expand Down
10 changes: 5 additions & 5 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2491,13 +2491,13 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
.default_value("off")
.show_in(argparse::ShowIn::HELP_ONLY);

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


Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ struct t_options {
argparse::ArgValue<int> reorder_rr_graph_nodes_threshold;
argparse::ArgValue<int> reorder_rr_graph_nodes_seed;
argparse::ArgValue<bool> flat_routing;
argparse::ArgValue<bool> has_choking_spot;
argparse::ArgValue<bool> router_opt_choke_points;
argparse::ArgValue<int> route_verbosity;
argparse::ArgValue<int> custom_3d_sb_fanin_fanout;

Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/read_route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ bool read_route(const char* route_file, const t_router_opts& router_opts, bool v
const Netlist<>& router_net_list = (flat_router) ? (const Netlist<>&)g_vpr_ctx.atom().nlist : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist;
init_route_structs(router_net_list,
router_opts.bb_factor,
router_opts.has_choking_spot,
router_opts.has_choke_point,
flat_router);

/*Check dimensions*/
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/vpr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ struct t_router_opts {
bool generate_rr_node_overuse_report;

bool flat_routing;
bool has_choking_spot;
bool has_choke_point;

int custom_3d_sb_fanin_fanout = 1;

Expand Down
2 changes: 1 addition & 1 deletion vpr/src/route/connection_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ void ConnectionRouter<Heap>::evaluate_timing_driven_node_costs(t_heap* to,
//cost.
cong_cost = 0.;
}
if (conn_params_->has_choking_spot_ && is_flat_ && rr_graph_->node_type(to_node) == IPIN) {
if (conn_params_->router_opt_choke_points_ && is_flat_ && rr_graph_->node_type(to_node) == IPIN) {
auto find_res = conn_params_->connection_choking_spots_.find(to_node);
if (find_res != conn_params_->connection_choking_spots_.end()) {
cong_cost = cong_cost / pow(2, (float)find_res->second);
Expand Down
4 changes: 2 additions & 2 deletions vpr/src/route/route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ bool route(const Netlist<>& net_list,

init_route_structs(net_list,
router_opts.bb_factor,
router_opts.has_choking_spot,
router_opts.has_choke_point,
is_flat);

IntraLbPbPinLookup intra_lb_pb_pin_lookup(device_ctx.logical_block_types);
Expand All @@ -80,7 +80,7 @@ bool route(const Netlist<>& net_list,
auto choking_spots = set_nets_choking_spots(net_list,
route_ctx.net_terminal_groups,
route_ctx.net_terminal_group_num,
router_opts.has_choking_spot,
router_opts.has_choke_point,
is_flat);

//Initially, the router runs normally trying to reduce congestion while
Expand Down
4 changes: 2 additions & 2 deletions vpr/src/route/route_net.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ inline NetResultFlags route_sink(ConnectionRouter& router,
bool sink_critical = (cost_params.criticality > HIGH_FANOUT_CRITICALITY_THRESHOLD);
bool net_is_clock = route_ctx.is_clock_net[net_id] != 0;

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

//We normally route high fanout nets by only adding spatially close-by routing to the heap (reduces run-time).
//However, if the current sink is 'critical' from a timing perspective, we put the entire route tree back onto
Expand Down
9 changes: 3 additions & 6 deletions vpr/src/route/route_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,21 +391,18 @@ vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int>>> set_net
std::vector<std::vector<int>>>& net_terminal_groups,
const vtr::vector<ParentNetId,
std::vector<int>>& net_terminal_group_num,
bool has_choking_spot,
bool router_opt_choke_points,
bool is_flat) {
vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int>>> choking_spots(net_list.nets().size());
for (const auto& net_id : net_list.nets()) {
choking_spots[net_id].resize(net_list.net_pins(net_id).size());
}

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

// We only identify choke points if flat_routing is enabled.
VTR_ASSERT(is_flat);

const auto& device_ctx = g_vpr_ctx.device();
const auto& rr_graph = device_ctx.rr_graph;
const auto& route_ctx = g_vpr_ctx.routing();
Expand Down
6 changes: 3 additions & 3 deletions vpr/src/route/route_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,22 @@ void print_router_criticality_histogram(const Netlist<>& net_list,
void prune_unused_non_configurable_nets(CBRR& connections_inf,
const Netlist<>& net_list);

/** 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.
/** 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.
* To address this issue, the congestion cost of those choke points needs to decrease. This function identify those choke points for each net,
* 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
* for each choke point.
* @param net_list
* @param net_terminal_groups [Net_id][group_id] -> rr_node_id of the pins in the group
* @param net_terminal_group_num [Net_id][pin_id] -> group_id
* @param has_choking_spot is true if the given architecture has choking spots inside the cluster
* @param router_opt_choke_points is true if the given architecture has choking spots inside the cluster
* @param is_flat is true if flat_routing is enabled
* @return [Net_id][pin_id] -> [choke_point_rr_node_id, number of sinks reachable by this choke point] */
vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int>>> set_nets_choking_spots(const Netlist<>& net_list,
const vtr::vector<ParentNetId,
std::vector<std::vector<int>>>& net_terminal_groups,
const vtr::vector<ParentNetId,
std::vector<int>>& net_terminal_group_num,
bool has_choking_spot,
bool router_opt_choke_points,
bool is_flat);

/** Wrapper for create_rr_graph() with extra checks */
Expand Down
6 changes: 3 additions & 3 deletions vpr/src/route/router_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
struct ConnectionParameters {
ConnectionParameters(ParentNetId net_id,
int target_pin_num,
bool has_choking_spot,
bool router_opt_choke_points,
const std::unordered_map<RRNodeId, int>& connection_choking_spots)
: net_id_(net_id)
, target_pin_num_(target_pin_num)
, has_choking_spot_(has_choking_spot)
, router_opt_choke_points_(router_opt_choke_points)
, connection_choking_spots_(connection_choking_spots) {}

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

const std::unordered_map<RRNodeId, int>& connection_choking_spots_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ qor_parse_file=qor_standard.txt
pass_requirements_file=pass_requirements.txt

#Script parameters
script_params=-track_memory_usage --max_router_iterations 300 --flat_routing on --has_choking_spot true
script_params=-track_memory_usage --max_router_iterations 300 --flat_routing on --router_opt_choke_points true
Loading