@@ -42,6 +42,8 @@ using namespace std;
42
42
#include " hsl.h"
43
43
#include " route_export.h"
44
44
#include " search_bar.h"
45
+ #include " timing_info.h"
46
+ #include " physical_types.h"
45
47
46
48
#ifdef WIN32 /* For runtime tracking in WIN32. The clock() function defined in time.h will *
47
49
* track CPU runtime. */
@@ -53,19 +55,21 @@ using namespace std;
53
55
# include < sys/time.h>
54
56
#endif
55
57
58
+ #ifndef NO_GRAPHICS
59
+
56
60
// To process key presses we need the X11 keysym definitions,
57
61
// which are unavailable when building with MINGW
58
- #if defined(X11) && !defined(__MINGW32__)
59
- # include < X11/keysym.h>
60
- #endif
62
+ # if defined(X11) && !defined(__MINGW32__)
63
+ # include < X11/keysym.h>
64
+ # endif
61
65
62
- #include " rr_graph.h"
63
- #include " route_util.h"
64
- #include " place_macro.h"
66
+ # include " rr_graph.h"
67
+ # include " route_util.h"
68
+ # include " place_macro.h"
65
69
66
70
/* ***************************** Define Macros *******************************/
67
71
68
- #define DEFAULT_RR_NODE_COLOR ezgl::BLACK
72
+ # define DEFAULT_RR_NODE_COLOR ezgl::BLACK
69
73
// #define TIME_DRAWSCREEN /* Enable if want to track runtime for drawscreen() */
70
74
71
75
// The arrow head position for turning/straight-thru connections in a switch box
@@ -200,9 +204,12 @@ void initial_setup_NO_PICTURE_to_ROUTING(ezgl::application* app);
200
204
void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path (ezgl::application* app);
201
205
void toggle_window_mode (GtkWidget* /* widget*/ , ezgl::application* /* app*/ );
202
206
207
+ #endif // NO_GRAPHICS
208
+
203
209
/* ********************* Subroutine definitions ******************************/
204
210
205
211
void init_graphics_state (bool show_graphics_val, int gr_automode_val, enum e_route_type route_type) {
212
+ #ifndef NO_GRAPHICS
206
213
/* Call accessor functions to retrieve global variables. */
207
214
t_draw_state* draw_state = get_draw_state_vars ();
208
215
@@ -213,8 +220,14 @@ void init_graphics_state(bool show_graphics_val, int gr_automode_val, enum e_rou
213
220
draw_state->show_graphics = show_graphics_val;
214
221
draw_state->gr_automode = gr_automode_val;
215
222
draw_state->draw_route_type = route_type;
223
+ #else
224
+ (void )show_graphics_val;
225
+ (void )gr_automode_val;
226
+ (void )route_type;
227
+ #endif // NO_GRAPHICS
216
228
}
217
229
230
+ #ifndef NO_GRAPHICS
218
231
void draw_main_canvas (ezgl::renderer& g) {
219
232
t_draw_state* draw_state = get_draw_state_vars ();
220
233
@@ -368,8 +381,11 @@ void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path(ezgl::application* app)
368
381
initial_setup_NO_PICTURE_to_ROUTING (app);
369
382
app->create_button (" Crit. Path" , 6 , toggle_crit_path);
370
383
}
384
+ #endif // NO_GRAPHICS
371
385
372
386
void update_screen (ScreenUpdatePriority priority, const char * msg, enum pic_type pic_on_screen_val, std::shared_ptr<SetupTimingInfo> setup_timing_info) {
387
+ #ifndef NO_GRAPHICS
388
+
373
389
/* Updates the screen if the user has requested graphics. The priority *
374
390
* value controls whether or not the Proceed button must be clicked to *
375
391
* continue. Saves the pic_on_screen_val to allow pan and zoom redraws. */
@@ -438,8 +454,15 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
438
454
} else {
439
455
application.refresh_drawing ();
440
456
}
457
+ #else
458
+ (void )setup_timing_info;
459
+ (void )priority;
460
+ (void )msg;
461
+ (void )pic_on_screen_val;
462
+ #endif // NO_GRAPHICS
441
463
}
442
464
465
+ #ifndef NO_GRAPHICS
443
466
void toggle_window_mode (GtkWidget* /* widget*/ , ezgl::application* /* app*/ ) {
444
467
window_mode = true ;
445
468
}
@@ -645,7 +668,10 @@ void toggle_router_rr_costs(GtkWidget* /*widget*/, ezgl::application* app) {
645
668
app->refresh_drawing ();
646
669
}
647
670
671
+ #endif // NO_GRAPHICS
672
+
648
673
void alloc_draw_structs (const t_arch* arch) {
674
+ #ifndef NO_GRAPHICS
649
675
/* Call accessor functions to retrieve global variables. */
650
676
t_draw_coords* draw_coords = get_draw_coords_vars ();
651
677
t_draw_state* draw_state = get_draw_state_vars ();
@@ -672,9 +698,13 @@ void alloc_draw_structs(const t_arch* arch) {
672
698
draw_state->arch_info = arch;
673
699
674
700
deselect_all (); /* Set initial colors */
701
+ #else
702
+ (void )arch;
703
+ #endif // NO_GRAPHICS
675
704
}
676
705
677
706
void free_draw_structs () {
707
+ #ifndef NO_GRAPHICS
678
708
/* Free everything allocated by alloc_draw_structs. Called after close_graphics() *
679
709
* in vpr_api.c.
680
710
*
@@ -694,9 +724,13 @@ void free_draw_structs() {
694
724
free (draw_state->draw_rr_node );
695
725
draw_state->draw_rr_node = nullptr ;
696
726
}
727
+ #else
728
+ ;
729
+ #endif /* NO_GRAPHICS */
697
730
}
698
731
699
732
void init_draw_coords (float width_val) {
733
+ #ifndef NO_GRAPHICS
700
734
/* Load the arrays containing the left and bottom coordinates of the clbs *
701
735
* forming the FPGA. tile_width_val sets the width and height of a drawn *
702
736
* clb. */
@@ -751,8 +785,13 @@ void init_draw_coords(float width_val) {
751
785
float draw_height = draw_coords->tile_y [device_ctx.grid .height () - 1 ] + draw_coords->get_tile_width ();
752
786
753
787
initial_world = ezgl::rectangle ({-VISIBLE_MARGIN * draw_width, -VISIBLE_MARGIN * draw_height}, {(1 . + VISIBLE_MARGIN) * draw_width, (1 . + VISIBLE_MARGIN) * draw_height});
788
+ #else
789
+ (void )width_val;
790
+ #endif /* NO_GRAPHICS */
754
791
}
755
792
793
+ #ifndef NO_GRAPHICS
794
+
756
795
/* Draws the blocks placed on the proper clbs. Occupied blocks are darker colours *
757
796
* while empty ones are lighter colours and have a dashed border. */
758
797
static void drawplace (ezgl::renderer& g) {
@@ -2354,7 +2393,7 @@ static bool highlight_rr_nodes(float x, float y) {
2354
2393
return highlight_rr_nodes (hit_node);
2355
2394
}
2356
2395
2357
- #if defined(X11) && !defined(__MINGW32__)
2396
+ # if defined(X11) && !defined(__MINGW32__)
2358
2397
void act_on_key_press (ezgl::application* app, GdkEventKey* event, char * key_name) {
2359
2398
// VTR_LOG("Key press %c (%d)\n", key_pressed, keysym);
2360
2399
std::string key (key_name);
@@ -2366,11 +2405,11 @@ void act_on_key_press(ezgl::application* app, GdkEventKey* event, char* key_name
2366
2405
2367
2406
event = event; // just for hiding warning message
2368
2407
}
2369
- #else
2408
+ # else
2370
2409
void act_on_key_press (ezgl::application* app, GdkEventKey* event, char * key_name) {
2371
2410
// Nothing to do
2372
2411
}
2373
- #endif
2412
+ # endif
2374
2413
2375
2414
void act_on_mouse_press (ezgl::application* app, GdkEventButton* event, double x, double y) {
2376
2415
app->update_message (" Mouse Clicked" );
@@ -3553,3 +3592,5 @@ static void highlight_blocks(double x, double y) {
3553
3592
3554
3593
application.refresh_drawing ();
3555
3594
}
3595
+
3596
+ #endif /* NO_GRAPHICS */
0 commit comments