Skip to content

Commit 1d5a301

Browse files
committed
[Draw][Route] Fix the router iteration reset and updates to stop at desired breakpoint.
1 parent c2cce9a commit 1d5a301

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

vpr/src/route/route.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "rr_graph.h"
1313
#include "router_lookahead_report.h"
1414
#include "vtr_time.h"
15+
#include "vtr_expr_eval.h"
1516

1617
bool 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", est_success_iteration);
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

vpr/src/route/route_utils.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -673,16 +673,14 @@ void update_draw_pres_fac(const float /*new_pres_fac*/) {
673673
#ifndef NO_GRAPHICS
674674
void update_router_info_and_check_bp(bp_router_type type, int net_id) {
675675
t_draw_state* draw_state = get_draw_state_vars();
676-
if (!draw_state->list_of_breakpoints.empty()) {
677-
if (type == BP_ROUTE_ITER)
678-
get_bp_state_globals()->get_glob_breakpoint_state()->router_iter++;
679-
else if (type == BP_NET_ID)
680-
get_bp_state_globals()->get_glob_breakpoint_state()->route_net_id = net_id;
681-
f_router_debug = check_for_breakpoints(false);
682-
if (f_router_debug) {
683-
breakpoint_info_window(get_bp_state_globals()->get_glob_breakpoint_state()->bp_description, *get_bp_state_globals()->get_glob_breakpoint_state(), false);
684-
update_screen(ScreenUpdatePriority::MAJOR, "Breakpoint Encountered", ROUTING, nullptr);
685-
}
676+
if (type == BP_ROUTE_ITER)
677+
get_bp_state_globals()->get_glob_breakpoint_state()->router_iter++;
678+
else if (type == BP_NET_ID)
679+
get_bp_state_globals()->get_glob_breakpoint_state()->route_net_id = net_id;
680+
f_router_debug = check_for_breakpoints(false);
681+
if (f_router_debug) {
682+
breakpoint_info_window(get_bp_state_globals()->get_glob_breakpoint_state()->bp_description, *get_bp_state_globals()->get_glob_breakpoint_state(), false);
683+
update_screen(ScreenUpdatePriority::MAJOR, "Breakpoint Encountered", ROUTING, nullptr);
686684
}
687685
}
688686
#endif

0 commit comments

Comments
 (0)