diff --git a/doc/src/Images/Overall_view.png b/doc/src/Images/Overall_view.png index c76e212c6b..0e40c33b96 100644 Binary files a/doc/src/Images/Overall_view.png and b/doc/src/Images/Overall_view.png differ diff --git a/doc/src/Images/manual_move.png b/doc/src/Images/manual_move.png index 7243f2f44b..1bd12c42a3 100644 Binary files a/doc/src/Images/manual_move.png and b/doc/src/Images/manual_move.png differ diff --git a/vpr/main.ui b/vpr/main.ui index 5a2f576d08..0cb14ed303 100644 --- a/vpr/main.ui +++ b/vpr/main.ui @@ -366,19 +366,6 @@ 0 - - - Pause - True - True - True - right - - - 0 - 2 - - Debug diff --git a/vpr/src/base/vpr_signal_handler.cpp b/vpr/src/base/vpr_signal_handler.cpp index 9be73206bd..2a8cce2735 100644 --- a/vpr/src/base/vpr_signal_handler.cpp +++ b/vpr/src/base/vpr_signal_handler.cpp @@ -4,9 +4,10 @@ * (ctrl-C from terminal) on POSIX systems. It is only active if * VPR_USE_SIGACTION is defined. * - * If a SIGINT occur the handler sets the 'forced_pause' flag of the VPR - * context. If 'forced_pause' is still true when another SIGINT occurs an - * exception is thrown (typically ending the program). + * Behavior: + * - SIGINT : log, attempt to checkpoint, then exit with INTERRUPTED_EXIT_CODE + * - SIGHUP : log, attempt to checkpoint, continue running + * - SIGTERM : log, attempt to checkpoint, then exit with INTERRUPTED_EXIT_CODE */ #include "vtr_log.h" #include "vtr_time.h" @@ -17,6 +18,7 @@ #include "globals.h" #include "read_place.h" +#include "read_route.h" #include "route_export.h" #include @@ -27,8 +29,6 @@ void vpr_signal_handler(int signal); void checkpoint(); -std::atomic uncleared_sigint_count(0); - #ifdef VPR_USE_SIGACTION void vpr_install_signal_handler() { @@ -44,23 +44,9 @@ void vpr_install_signal_handler() { void vpr_signal_handler(int signal) { if (signal == SIGINT) { - if (g_vpr_ctx.forced_pause()) { - uncleared_sigint_count++; //Previous SIGINT uncleared - } else { - uncleared_sigint_count.store(1); //Only this SIGINT outstanding - } - - if (uncleared_sigint_count == 1) { - VTR_LOG("Recieved SIGINT: try again to really exit...\n"); - } else if (uncleared_sigint_count == 2) { - VTR_LOG("Recieved two uncleared SIGINTs: Attempting to checkpoint and exit...\n"); - checkpoint(); - std::quick_exit(INTERRUPTED_EXIT_CODE); - } else if (uncleared_sigint_count == 3) { - //Really exit (e.g. SIGINT while checkpointing) - VTR_LOG("Recieved three uncleared SIGINTs: Exiting...\n"); - std::quick_exit(INTERRUPTED_EXIT_CODE); - } + VTR_LOG("Recieved SIGINT: Attempting to checkpoint then exit...\n"); + checkpoint(); + std::quick_exit(INTERRUPTED_EXIT_CODE); } else if (signal == SIGHUP) { VTR_LOG("Recieved SIGHUP: Attempting to checkpoint...\n"); checkpoint(); @@ -92,7 +78,10 @@ void checkpoint() { VTR_LOG("Attempting to checkpoint current placement to file: %s\n", placer_checkpoint_file.c_str()); print_place(nullptr, nullptr, placer_checkpoint_file.c_str(), g_vpr_ctx.placement().block_locs()); + bool is_flat = g_vpr_ctx.routing().is_flat; + const Netlist<>& router_net_list = is_flat ? (const Netlist<>&)g_vpr_ctx.atom().netlist() : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist; + std::string router_checkpoint_file = "router_checkpoint.route"; VTR_LOG("Attempting to checkpoint current routing to file: %s\n", router_checkpoint_file.c_str()); - //print_route(nullptr, router_checkpoint_file.c_str()); + print_route(router_net_list, nullptr, router_checkpoint_file.c_str(), is_flat); } diff --git a/vpr/src/draw/draw.cpp b/vpr/src/draw/draw.cpp index 4593410afb..0df832c05a 100644 --- a/vpr/src/draw/draw.cpp +++ b/vpr/src/draw/draw.cpp @@ -85,7 +85,6 @@ static void draw_main_canvas(ezgl::renderer* g); static void on_stage_change_setup(ezgl::application* app, bool is_new_window); static void setup_default_ezgl_callbacks(ezgl::application* app); -static void set_force_pause(GtkWidget* /*widget*/, gint /*response_id*/, gpointer /*data*/); static void set_block_outline(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/); static void set_block_text(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/); static void set_draw_partitions(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/); @@ -317,13 +316,7 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type draw_state->auto_proceed = (state_change && !should_pause); if (state_change //Must update buttons - || should_pause //The priority means graphics should pause for user interaction - || draw_state->forced_pause) { //The user asked to pause - - if (draw_state->forced_pause) { - VTR_LOG("Pausing in interactive graphics (user pressed 'Pause')\n"); - draw_state->forced_pause = false; //Reset pause flag - } + || should_pause) { //The priority means graphics should pause for user interaction application.run(on_stage_change_setup, act_on_mouse_press, act_on_mouse_move, act_on_key_press); @@ -956,10 +949,6 @@ static void setup_default_ezgl_callbacks(ezgl::application* app) { g_signal_connect(zoom_fit_button, "clicked", G_CALLBACK(ezgl::press_zoom_fit), app); - // Connect Pause button - GObject* pause_button = app->get_object("PauseButton"); - g_signal_connect(pause_button, "clicked", G_CALLBACK(set_force_pause), app); - // Connect Block Outline checkbox GObject* block_outline = app->get_object("blockOutline"); g_signal_connect(block_outline, "toggled", G_CALLBACK(set_block_outline), @@ -1097,12 +1086,6 @@ static void set_draw_partitions(GtkWidget* widget, gint /*response_id*/, gpointe application.refresh_drawing(); } -static void set_force_pause(GtkWidget* /*widget*/, gint /*response_id*/, gpointer /*data*/) { - t_draw_state* draw_state = get_draw_state_vars(); - - draw_state->forced_pause = true; -} - static void run_graphics_commands(const std::string& commands) { //A very simmple command interpreter for scripting graphics t_draw_state* draw_state = get_draw_state_vars(); diff --git a/vpr/src/draw/draw_types.h b/vpr/src/draw/draw_types.h index 6b621dadc5..dd0e0b6065 100644 --- a/vpr/src/draw/draw_types.h +++ b/vpr/src/draw/draw_types.h @@ -288,9 +288,6 @@ struct t_draw_state { std::string graphics_commands; - ///@brief If we should pause for user interaction (requested by user) - bool forced_pause = false; - int sequence_number = 0; ///@brief net transparency factor (0 - Transparent, 255 - Opaque)