Skip to content

Commit 1be6dca

Browse files
Merge remote-tracking branch 'origin/master' into temp_3d_sg
2 parents 8d5b442 + 84ec20c commit 1be6dca

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

vpr/src/draw/breakpoint.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ bool check_for_breakpoints(bool in_placer) {
6161
//goes through the breakpoints vector
6262
t_draw_state* draw_state = get_draw_state_vars();
6363
for (size_t i = 0; i < draw_state->list_of_breakpoints.size(); i++) {
64-
if (draw_state->list_of_breakpoints[i].type == BT_MOVE_NUM && draw_state->list_of_breakpoints[i].active)
64+
if (draw_state->list_of_breakpoints[i].type == BT_MOVE_NUM && draw_state->list_of_breakpoints[i].active && in_placer)
6565
return check_for_moves_breakpoints(draw_state->list_of_breakpoints[i].bt_moves);
66-
else if (draw_state->list_of_breakpoints[i].type == BT_FROM_BLOCK && draw_state->list_of_breakpoints[i].active)
66+
else if (draw_state->list_of_breakpoints[i].type == BT_FROM_BLOCK && draw_state->list_of_breakpoints[i].active && in_placer)
6767
return check_for_block_breakpoints(draw_state->list_of_breakpoints[i].bt_from_block);
68-
else if (draw_state->list_of_breakpoints[i].type == BT_TEMP_NUM && draw_state->list_of_breakpoints[i].active)
68+
else if (draw_state->list_of_breakpoints[i].type == BT_TEMP_NUM && draw_state->list_of_breakpoints[i].active && in_placer)
6969
return check_for_temperature_breakpoints(draw_state->list_of_breakpoints[i].bt_temps);
70-
else if (draw_state->list_of_breakpoints[i].type == BT_ROUTER_ITER && draw_state->list_of_breakpoints[i].active)
70+
else if (draw_state->list_of_breakpoints[i].type == BT_ROUTER_ITER && draw_state->list_of_breakpoints[i].active && !in_placer)
7171
return check_for_router_iter_breakpoints(draw_state->list_of_breakpoints[i].bt_router_iter);
72-
else if (draw_state->list_of_breakpoints[i].type == BT_ROUTE_NET_ID && draw_state->list_of_breakpoints[i].active)
72+
else if (draw_state->list_of_breakpoints[i].type == BT_ROUTE_NET_ID && draw_state->list_of_breakpoints[i].active && !in_placer)
7373
return check_for_route_net_id_iter_breakpoints(draw_state->list_of_breakpoints[i].bt_route_net_id);
7474
else if (draw_state->list_of_breakpoints[i].type == BT_EXPRESSION && draw_state->list_of_breakpoints[i].active)
7575
return check_for_expression_breakpoints(draw_state->list_of_breakpoints[i].bt_expression, in_placer);

vpr/src/place/annealer.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,11 @@ t_swap_result PlacementAnnealer::try_swap_(MoveGenerator& move_generator,
767767
}
768768
move_outcome_stats.outcome = move_outcome;
769769

770-
// If we force a router block move then it was not proposed by the
771-
// move generator, so we should not calculate the reward and update
770+
// If we force a router block move or manual move then it was not proposed
771+
// by the move generator, so we should not calculate the reward and update
772772
// the move generators status since this outcome is not a direct
773-
// consequence of the move generator
774-
if (!router_block_move) {
773+
// consequence of the move generator.
774+
if (!router_block_move && !manual_move_enabled) {
775775
move_generator.calculate_reward_and_process_outcome(move_outcome_stats, delta_c, REWARD_BB_TIMING_RELATIVE_WEIGHT);
776776
}
777777

@@ -830,6 +830,14 @@ void PlacementAnnealer::placement_inner_loop() {
830830

831831
// Inner loop begins
832832
for (int inner_iter = 0, inner_crit_iter_count = 1; inner_iter < annealing_state_.move_lim; inner_iter++) {
833+
#ifndef NO_GRAPHICS
834+
// Checks manual move flag for manual move feature
835+
t_draw_state* draw_state = get_draw_state_vars();
836+
if (draw_state->show_graphics) {
837+
manual_move_enabled = manual_move_is_selected();
838+
}
839+
#endif /*NO_GRAPHICS*/
840+
833841
t_swap_result swap_result = try_swap_(move_generator, placer_opts_.place_algorithm, manual_move_enabled);
834842

835843
if (swap_result.move_result == e_move_result::ACCEPTED) {

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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -672,17 +672,14 @@ void update_draw_pres_fac(const float /*new_pres_fac*/) {
672672

673673
#ifndef NO_GRAPHICS
674674
void update_router_info_and_check_bp(bp_router_type type, int net_id) {
675-
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-
}
675+
if (type == BP_ROUTE_ITER)
676+
get_bp_state_globals()->get_glob_breakpoint_state()->router_iter++;
677+
else if (type == BP_NET_ID)
678+
get_bp_state_globals()->get_glob_breakpoint_state()->route_net_id = net_id;
679+
f_router_debug = check_for_breakpoints(false);
680+
if (f_router_debug) {
681+
breakpoint_info_window(get_bp_state_globals()->get_glob_breakpoint_state()->bp_description, *get_bp_state_globals()->get_glob_breakpoint_state(), false);
682+
update_screen(ScreenUpdatePriority::MAJOR, "Breakpoint Encountered", ROUTING, nullptr);
686683
}
687684
}
688685
#endif

0 commit comments

Comments
 (0)