Skip to content

Commit fd15259

Browse files
committed
-Updates old menu bar image in documentation.
-Makes the message shown in the gui and drawed state consistent without requiring user interaction. -Makes the signal handler checkpointing functional again when enabled.
1 parent 6fed73f commit fd15259

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

doc/src/Images/Overall_view.png

-125 KB
Loading

vpr/src/base/vpr_signal_handler.cpp

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
* (ctrl-C from terminal) on POSIX systems. It is only active if
55
* VPR_USE_SIGACTION is defined.
66
*
7-
* If a SIGINT occur the handler sets the 'forced_pause' flag of the VPR
8-
* context. If 'forced_pause' is still true when another SIGINT occurs an
9-
* exception is thrown (typically ending the program).
7+
* Behavior:
8+
* - SIGINT : log, attempt to checkpoint, then exit with INTERRUPTED_EXIT_CODE
9+
* - SIGHUP : log, attempt to checkpoint, continue running
10+
* - SIGTERM : log, attempt to checkpoint, then exit with INTERRUPTED_EXIT_CODE
1011
*/
1112
#include "vtr_log.h"
1213
#include "vtr_time.h"
@@ -17,6 +18,7 @@
1718
#include "globals.h"
1819

1920
#include "read_place.h"
21+
#include "read_route.h"
2022
#include "route_export.h"
2123
#include <atomic>
2224

@@ -27,8 +29,6 @@
2729
void vpr_signal_handler(int signal);
2830
void checkpoint();
2931

30-
std::atomic<int> uncleared_sigint_count(0);
31-
3232
#ifdef VPR_USE_SIGACTION
3333

3434
void vpr_install_signal_handler() {
@@ -44,23 +44,9 @@ void vpr_install_signal_handler() {
4444

4545
void vpr_signal_handler(int signal) {
4646
if (signal == SIGINT) {
47-
if (g_vpr_ctx.forced_pause()) {
48-
uncleared_sigint_count++; //Previous SIGINT uncleared
49-
} else {
50-
uncleared_sigint_count.store(1); //Only this SIGINT outstanding
51-
}
52-
53-
if (uncleared_sigint_count == 1) {
54-
VTR_LOG("Recieved SIGINT: try again to really exit...\n");
55-
} else if (uncleared_sigint_count == 2) {
56-
VTR_LOG("Recieved two uncleared SIGINTs: Attempting to checkpoint and exit...\n");
57-
checkpoint();
58-
std::quick_exit(INTERRUPTED_EXIT_CODE);
59-
} else if (uncleared_sigint_count == 3) {
60-
//Really exit (e.g. SIGINT while checkpointing)
61-
VTR_LOG("Recieved three uncleared SIGINTs: Exiting...\n");
62-
std::quick_exit(INTERRUPTED_EXIT_CODE);
63-
}
47+
VTR_LOG("Recieved SIGINT: Attempting to checkpoint then exit...\n");
48+
checkpoint();
49+
std::quick_exit(INTERRUPTED_EXIT_CODE);
6450
} else if (signal == SIGHUP) {
6551
VTR_LOG("Recieved SIGHUP: Attempting to checkpoint...\n");
6652
checkpoint();
@@ -92,7 +78,10 @@ void checkpoint() {
9278
VTR_LOG("Attempting to checkpoint current placement to file: %s\n", placer_checkpoint_file.c_str());
9379
print_place(nullptr, nullptr, placer_checkpoint_file.c_str(), g_vpr_ctx.placement().block_locs());
9480

81+
bool is_flat = g_vpr_ctx.routing().is_flat;
82+
const Netlist<>& router_net_list = is_flat ? (const Netlist<>&)g_vpr_ctx.atom().netlist() : (const Netlist<>&)g_vpr_ctx.clustering().clb_nlist;
83+
9584
std::string router_checkpoint_file = "router_checkpoint.route";
9685
VTR_LOG("Attempting to checkpoint current routing to file: %s\n", router_checkpoint_file.c_str());
97-
//print_route(nullptr, router_checkpoint_file.c_str());
98-
}
86+
print_route(router_net_list, nullptr, router_checkpoint_file.c_str(), is_flat);
87+
}

vpr/src/draw/draw.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ static void on_stage_change_setup(ezgl::application* app, bool is_new_window) {
270270
hide_crit_path_routing(app);
271271

272272
hide_draw_routing(app);
273+
274+
app->update_message(draw_state->default_message);
273275
}
274276

275277
#endif //NO_GRAPHICS

0 commit comments

Comments
 (0)