@@ -250,7 +250,7 @@ void reduce_budgets_if_congested(route_budgets& budgeting_inf,
250
250
float slope,
251
251
int itry);
252
252
253
- static bool should_route_net (ClusterNetId net_id, const CBRR& connections_inf, bool if_force_reroute);
253
+ static bool should_route_net (ClusterNetId net_id, CBRR& connections_inf, bool if_force_reroute);
254
254
static bool early_exit_heuristic (const t_router_opts& router_opts, const WirelengthInfo& wirelength_info);
255
255
256
256
struct more_sinks_than {
@@ -279,7 +279,7 @@ static std::string describe_unrouteable_connection(const int source_node, const
279
279
280
280
static bool is_high_fanout (int fanout, int fanout_threshold);
281
281
282
- static size_t dynamic_update_bounding_boxes (int high_fanout_threshold);
282
+ static size_t dynamic_update_bounding_boxes (const std::vector<ClusterNetId>& nets, int high_fanout_threshold);
283
283
static t_bb calc_current_bb (const t_trace* head);
284
284
285
285
static void enable_router_debug (const t_router_opts& router_opts, ClusterNetId net, int sink_rr);
@@ -405,6 +405,7 @@ bool try_timing_driven_route(const t_router_opts& router_opts,
405
405
int itry_since_last_convergence = -1 ;
406
406
for (itry = 1 ; itry <= router_opts.max_router_iterations ; ++itry) {
407
407
RouterStats router_iteration_stats;
408
+ std::vector<ClusterNetId> rerouted_nets;
408
409
409
410
/* Reset "is_routed" and "is_fixed" flags to indicate nets not pre-routed (yet) */
410
411
for (auto net_id : cluster_ctx.clb_nlist .nets ()) {
@@ -434,6 +435,7 @@ bool try_timing_driven_route(const t_router_opts& router_opts,
434
435
* Route each net
435
436
*/
436
437
for (auto net_id : sorted_nets) {
438
+ bool was_rerouted = false ;
437
439
bool is_routable = try_timing_driven_route_net (net_id,
438
440
itry,
439
441
pres_fac,
@@ -445,11 +447,17 @@ bool try_timing_driven_route(const t_router_opts& router_opts,
445
447
net_delay,
446
448
*router_lookahead,
447
449
netlist_pin_lookup,
448
- route_timing_info, budgeting_inf);
450
+ route_timing_info,
451
+ budgeting_inf,
452
+ was_rerouted);
449
453
450
454
if (!is_routable) {
451
455
return (false ); // Impossible to route
452
456
}
457
+
458
+ if (was_rerouted) {
459
+ rerouted_nets.push_back (net_id);
460
+ }
453
461
}
454
462
455
463
// Make sure any CLB OPINs used up by subblocks being hooked directly to them are reserved for that purpose
@@ -587,7 +595,7 @@ bool try_timing_driven_route(const t_router_opts& router_opts,
587
595
*/
588
596
589
597
if (router_opts.route_bb_update == e_route_bb_update::DYNAMIC) {
590
- num_net_bounding_boxes_updated = dynamic_update_bounding_boxes (router_opts.high_fanout_threshold );
598
+ num_net_bounding_boxes_updated = dynamic_update_bounding_boxes (rerouted_nets, router_opts.high_fanout_threshold );
591
599
}
592
600
593
601
if (itry >= high_effort_congestion_mode_iteration_threshold) {
@@ -749,7 +757,8 @@ bool try_timing_driven_route_net(ClusterNetId net_id,
749
757
const RouterLookahead& router_lookahead,
750
758
const ClusteredPinAtomPinsLookup& netlist_pin_lookup,
751
759
std::shared_ptr<SetupTimingInfo> timing_info,
752
- route_budgets& budgeting_inf) {
760
+ route_budgets& budgeting_inf,
761
+ bool & was_rerouted) {
753
762
auto & cluster_ctx = g_vpr_ctx.clustering ();
754
763
auto & route_ctx = g_vpr_ctx.mutable_routing ();
755
764
@@ -789,6 +798,8 @@ bool try_timing_driven_route_net(ClusterNetId net_id,
789
798
} else {
790
799
VTR_LOG (" Routing failed.\n " );
791
800
}
801
+
802
+ was_rerouted = true ; // Flag to record whether routing was actually changed
792
803
}
793
804
return (is_routed);
794
805
}
@@ -2044,7 +2055,7 @@ static bool timing_driven_check_net_delays(vtr::vector<ClusterNetId, float*>& ne
2044
2055
}
2045
2056
2046
2057
/* Detect if net should be routed or not */
2047
- static bool should_route_net (ClusterNetId net_id, const CBRR& connections_inf, bool if_force_reroute) {
2058
+ static bool should_route_net (ClusterNetId net_id, CBRR& connections_inf, bool if_force_reroute) {
2048
2059
auto & route_ctx = g_vpr_ctx.routing ();
2049
2060
auto & device_ctx = g_vpr_ctx.device ();
2050
2061
@@ -2080,6 +2091,8 @@ static bool should_route_net(ClusterNetId net_id, const CBRR& connections_inf, b
2080
2091
2081
2092
} /* End while loop -- did an entire traceback. */
2082
2093
2094
+ VTR_ASSERT (connections_inf.get_remaining_targets ().empty ());
2095
+
2083
2096
return false ; /* Current route has no overuse */
2084
2097
}
2085
2098
@@ -2512,7 +2525,7 @@ static bool is_high_fanout(int fanout, int fanout_threshold) {
2512
2525
//
2513
2526
// Typically, only a small minority of nets (typically > 10%) have their BBs updated
2514
2527
// each routing iteration.
2515
- static size_t dynamic_update_bounding_boxes (int high_fanout_threshold) {
2528
+ static size_t dynamic_update_bounding_boxes (const std::vector<ClusterNetId>& updated_nets, int high_fanout_threshold) {
2516
2529
auto & device_ctx = g_vpr_ctx.device ();
2517
2530
auto & cluster_ctx = g_vpr_ctx.clustering ();
2518
2531
auto & route_ctx = g_vpr_ctx.mutable_routing ();
@@ -2535,7 +2548,7 @@ static size_t dynamic_update_bounding_boxes(int high_fanout_threshold) {
2535
2548
2536
2549
size_t num_bb_updated = 0 ;
2537
2550
2538
- for (ClusterNetId net : clb_nlist. nets () ) {
2551
+ for (ClusterNetId net : updated_nets ) {
2539
2552
t_trace* routing_head = route_ctx.trace [net].head ;
2540
2553
2541
2554
if (routing_head == nullptr ) continue ; // Skip if no routing
0 commit comments