Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion vpr/src/draw/draw_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ void breakpoint_info_window(std::string bpDescription, BreakpointState draw_brea
gtk_widget_set_margin_left(ri_info, 5);
#endif
gtk_widget_set_halign(ri_info, GTK_ALIGN_START);
std::string net_id = "rouet_net_id: " + std::to_string(draw_breakpoint_state.route_net_id);
std::string net_id = "route_net_id: " + std::to_string(draw_breakpoint_state.route_net_id);
GtkWidget* net_info = gtk_label_new(net_id.c_str());
#if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_start(net_info, 5);
Expand Down Expand Up @@ -766,6 +766,17 @@ bool valid_expression(std::string exp) {
return false;
}

//use the formula parser for checking the validity of the formula.
//we ignore the actual result here, since we only care about whether parsing succeeds without a VtrError.
vtr::FormulaParser fp;
vtr::t_formula_data dummy;
try {
int result = fp.parse_formula(exp, dummy, true);
(void)result;
} catch (const vtr::VtrError& e) {
return false;
}

return true;
}

Expand Down
21 changes: 17 additions & 4 deletions vpr/src/route/route_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,25 @@ void update_draw_pres_fac(const float /*new_pres_fac*/) {

#ifndef NO_GRAPHICS
void update_router_info_and_check_bp(bp_router_type type, int net_id) {
if (type == BP_ROUTE_ITER)
bool hit_bp = false;
if (type == BP_ROUTE_ITER) {
get_bp_state_globals()->get_glob_breakpoint_state()->router_iter++;
else if (type == BP_NET_ID)
hit_bp = check_for_breakpoints(false);
} else if (type == BP_NET_ID) {
// Between net id iters, check only net id and expression breakpoints
get_bp_state_globals()->get_glob_breakpoint_state()->route_net_id = net_id;
f_router_debug = check_for_breakpoints(false);
if (f_router_debug) {
t_draw_state* draw_state = get_draw_state_vars();
for (size_t i = 0; i < draw_state->list_of_breakpoints.size(); i++) {
if (draw_state->list_of_breakpoints[i].type == BT_ROUTE_NET_ID && draw_state->list_of_breakpoints[i].active) {
hit_bp = check_for_route_net_id_iter_breakpoints(draw_state->list_of_breakpoints[i].bt_route_net_id);
break;
} else if (draw_state->list_of_breakpoints[i].type == BT_EXPRESSION && draw_state->list_of_breakpoints[i].active) {
hit_bp = check_for_expression_breakpoints(draw_state->list_of_breakpoints[i].bt_expression, false);
break;
}
}
}
if (hit_bp) {
breakpoint_info_window(get_bp_state_globals()->get_glob_breakpoint_state()->bp_description, *get_bp_state_globals()->get_glob_breakpoint_state(), false);
update_screen(ScreenUpdatePriority::MAJOR, "Breakpoint Encountered", ROUTING, nullptr);
}
Expand Down