Skip to content

Commit 7b55b70

Browse files
authored
Merge pull request #3286 from verilog-to-routing/breakpoint_updates_PnR
[Draw][Breakpoints] Place and route graphical breakpoints updates
2 parents 6274fd1 + 8f255d8 commit 7b55b70

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

vpr/src/draw/draw_debug.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ void breakpoint_info_window(std::string bpDescription, BreakpointState draw_brea
690690
gtk_widget_set_margin_left(ri_info, 5);
691691
#endif
692692
gtk_widget_set_halign(ri_info, GTK_ALIGN_START);
693-
std::string net_id = "rouet_net_id: " + std::to_string(draw_breakpoint_state.route_net_id);
693+
std::string net_id = "route_net_id: " + std::to_string(draw_breakpoint_state.route_net_id);
694694
GtkWidget* net_info = gtk_label_new(net_id.c_str());
695695
#if GTK_CHECK_VERSION(3, 12, 0)
696696
gtk_widget_set_margin_start(net_info, 5);
@@ -766,6 +766,17 @@ bool valid_expression(std::string exp) {
766766
return false;
767767
}
768768

769+
//use the formula parser for checking the validity of the formula.
770+
//we ignore the actual result here, since we only care about whether parsing succeeds without a VtrError.
771+
vtr::FormulaParser fp;
772+
vtr::t_formula_data dummy;
773+
try {
774+
int result = fp.parse_formula(exp, dummy, true);
775+
(void)result;
776+
} catch (const vtr::VtrError& e) {
777+
return false;
778+
}
779+
769780
return true;
770781
}
771782

vpr/src/route/route_utils.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,12 +672,25 @@ 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-
if (type == BP_ROUTE_ITER)
675+
bool hit_bp = false;
676+
if (type == BP_ROUTE_ITER) {
676677
get_bp_state_globals()->get_glob_breakpoint_state()->router_iter++;
677-
else if (type == BP_NET_ID)
678+
hit_bp = check_for_breakpoints(false);
679+
} else if (type == BP_NET_ID) {
680+
// Between net id iters, check only net id and expression breakpoints
678681
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) {
682+
t_draw_state* draw_state = get_draw_state_vars();
683+
for (size_t i = 0; i < draw_state->list_of_breakpoints.size(); i++) {
684+
if (draw_state->list_of_breakpoints[i].type == BT_ROUTE_NET_ID && draw_state->list_of_breakpoints[i].active) {
685+
hit_bp = check_for_route_net_id_iter_breakpoints(draw_state->list_of_breakpoints[i].bt_route_net_id);
686+
break;
687+
} else if (draw_state->list_of_breakpoints[i].type == BT_EXPRESSION && draw_state->list_of_breakpoints[i].active) {
688+
hit_bp = check_for_expression_breakpoints(draw_state->list_of_breakpoints[i].bt_expression, false);
689+
break;
690+
}
691+
}
692+
}
693+
if (hit_bp) {
681694
breakpoint_info_window(get_bp_state_globals()->get_glob_breakpoint_state()->bp_description, *get_bp_state_globals()->get_glob_breakpoint_state(), false);
682695
update_screen(ScreenUpdatePriority::MAJOR, "Breakpoint Encountered", ROUTING, nullptr);
683696
}

0 commit comments

Comments
 (0)