diff --git a/vpr/src/draw/draw_debug.cpp b/vpr/src/draw/draw_debug.cpp index be7f9acdc4..fbfc597448 100644 --- a/vpr/src/draw/draw_debug.cpp +++ b/vpr/src/draw/draw_debug.cpp @@ -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); @@ -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; } diff --git a/vpr/src/route/route_utils.cpp b/vpr/src/route/route_utils.cpp index 9d5107a4d0..d11da79167 100644 --- a/vpr/src/route/route_utils.cpp +++ b/vpr/src/route/route_utils.cpp @@ -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); }