1212#include  " rr_graph.h" 
1313#include  " router_lookahead_report.h" 
1414#include  " vtr_time.h" 
15+ #include  " vtr_expr_eval.h" 
1516
1617bool  route (const  Netlist<>& net_list,
1718           int  width_fac,
@@ -251,6 +252,10 @@ bool route(const Netlist<>& net_list,
251252    int  rcv_finished_count = RCV_FINISH_EARLY_COUNTDOWN;
252253
253254    print_route_status_header ();
255+ #ifndef  NO_GRAPHICS
256+     //  Reset router iteration in the current route attempt.
257+     get_bp_state_globals ()->get_glob_breakpoint_state ()->router_iter  = 0 ;
258+ #endif 
254259    for  (itry = 1 ; itry <= router_opts.max_router_iterations ; ++itry) {
255260        /*  Reset "is_routed" and "is_fixed" flags to indicate nets not pre-routed (yet) */ 
256261        for  (auto  net_id : net_list.nets ()) {
@@ -268,6 +273,11 @@ bool route(const Netlist<>& net_list,
268273            worst_negative_slack = timing_info->hold_total_negative_slack ();
269274        }
270275
276+ #ifndef  NO_GRAPHICS
277+         //  Update router information and check breakpoint.
278+         update_router_info_and_check_bp (BP_ROUTE_ITER, -1 );
279+ #endif 
280+ 
271281        /*  Initial criticalities: set to 1 on the first iter if the user asked for it */ 
272282        if  (router_opts.initial_timing  == e_router_initial_timing::ALL_CRITICAL && itry == 1 )
273283            netlist_router->set_timing_info (make_constant_timing_info (1 ));
@@ -400,19 +410,13 @@ bool route(const Netlist<>& net_list,
400410        if  (legal_convergence_count >= router_opts.max_convergence_count 
401411            || iter_results.stats .connections_routed  == 0 
402412            || early_reconvergence_exit_heuristic (router_opts, itry_since_last_convergence, timing_info, best_routing_metrics)) {
403- #ifndef  NO_GRAPHICS
404-             update_router_info_and_check_bp (BP_ROUTE_ITER, -1 );
405- #endif 
406413            break ; // Done routing
407414        }
408415
409416        /* 
410417         * Abort checks: Should we give-up because this routing problem is unlikely to converge to a legal routing? 
411418         */  
412419        if  (itry == 1  && early_exit_heuristic (router_opts, wirelength_info)) {
413- #ifndef  NO_GRAPHICS
414-             update_router_info_and_check_bp (BP_ROUTE_ITER, -1 );
415- #endif 
416420            // Abort
417421            break ;
418422        }
@@ -423,18 +427,12 @@ bool route(const Netlist<>& net_list,
423427
424428            if  (!std::isnan (est_success_iteration) && est_success_iteration > abort_iteration_threshold && router_opts.routing_budgets_algorithm  != YOYO) {
425429                VTR_LOG (" Routing aborted, the predicted iteration for a successful route (%.1f) is too high.\n " 
426- #ifndef  NO_GRAPHICS
427-                 update_router_info_and_check_bp (BP_ROUTE_ITER, -1 );
428- #endif 
429430                break ; // Abort
430431            }
431432        }
432433
433434        if  (itry == 1  && router_opts.exit_after_first_routing_iteration ) {
434435            VTR_LOG (" Exiting after first routing iteration as requested\n " 
435- #ifndef  NO_GRAPHICS
436-             update_router_info_and_check_bp (BP_ROUTE_ITER, -1 );
437- #endif 
438436            break ;
439437        }
440438
0 commit comments