Skip to content
Closed
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
Binary file modified doc/src/Images/Overall_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/src/Images/manual_move.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions vpr/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,6 @@
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="PauseButton">
<property name="label" translatable="yes">Pause</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image-position">right</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="debugButton">
<property name="label" translatable="yes">Debug</property>
Expand Down
35 changes: 12 additions & 23 deletions vpr/src/base/vpr_signal_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -17,6 +18,7 @@
#include "globals.h"

#include "read_place.h"
#include "read_route.h"
#include "route_export.h"
#include <atomic>

Expand All @@ -27,8 +29,6 @@
void vpr_signal_handler(int signal);
void checkpoint();

std::atomic<int> uncleared_sigint_count(0);

#ifdef VPR_USE_SIGACTION

void vpr_install_signal_handler() {
Expand All @@ -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();
Expand Down Expand Up @@ -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);
}
19 changes: 1 addition & 18 deletions vpr/src/draw/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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*/);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions vpr/src/draw/draw_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down