45
45
#include " save_graphics.h"
46
46
#include " timing_info.h"
47
47
#include " physical_types.h"
48
+ #include " route_common.h"
48
49
49
50
#ifdef WIN32 /* For runtime tracking in WIN32. The clock() function defined in time.h will *
50
51
* track CPU runtime. */
@@ -138,20 +139,20 @@ static void draw_router_expansion_costs(ezgl::renderer* g);
138
139
139
140
static void draw_rr_costs (ezgl::renderer* g, const std::vector<float >& rr_costs, bool lowest_cost_first = true );
140
141
141
- void draw_main_canvas (ezgl::renderer* g);
142
- void initial_setup_NO_PICTURE_to_PLACEMENT (ezgl::application* app, bool is_new_window);
143
- void initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path (ezgl::application* app, bool is_new_window);
144
- void initial_setup_PLACEMENT_to_ROUTING (ezgl::application* app, bool is_new_window);
145
- void initial_setup_ROUTING_to_PLACEMENT (ezgl::application* app, bool is_new_window);
146
- void initial_setup_NO_PICTURE_to_ROUTING (ezgl::application* app, bool is_new_window);
147
- void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path (ezgl::application* app, bool is_new_window);
148
- void toggle_window_mode (GtkWidget* /* widget*/ , ezgl::application* /* app*/ );
149
- void setup_default_ezgl_callbacks (ezgl::application* app);
150
- void set_force_pause (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
151
- void set_block_outline (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ );
152
- void set_block_text (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ );
153
- void clip_routing_util (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ );
154
- void run_graphics_commands (std::string commands);
142
+ static void draw_main_canvas (ezgl::renderer* g);
143
+ static void initial_setup_NO_PICTURE_to_PLACEMENT (ezgl::application* app, bool is_new_window);
144
+ static void initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path (ezgl::application* app, bool is_new_window);
145
+ static void initial_setup_PLACEMENT_to_ROUTING (ezgl::application* app, bool is_new_window);
146
+ static void initial_setup_ROUTING_to_PLACEMENT (ezgl::application* app, bool is_new_window);
147
+ static void initial_setup_NO_PICTURE_to_ROUTING (ezgl::application* app, bool is_new_window);
148
+ static void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path (ezgl::application* app, bool is_new_window);
149
+ static void toggle_window_mode (GtkWidget* /* widget*/ , ezgl::application* /* app*/ );
150
+ static void setup_default_ezgl_callbacks (ezgl::application* app);
151
+ static void set_force_pause (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
152
+ static void set_block_outline (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ );
153
+ static void set_block_text (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ );
154
+ static void clip_routing_util (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ );
155
+ static void run_graphics_commands (std::string commands);
155
156
156
157
/* ************************* File Scope Variables ****************************/
157
158
@@ -233,7 +234,7 @@ void init_graphics_state(bool show_graphics_val, int gr_automode_val, enum e_rou
233
234
}
234
235
235
236
#ifndef NO_GRAPHICS
236
- void draw_main_canvas (ezgl::renderer* g) {
237
+ static void draw_main_canvas (ezgl::renderer* g) {
237
238
t_draw_state* draw_state = get_draw_state_vars ();
238
239
239
240
g->set_font_size (14 );
@@ -300,7 +301,7 @@ void draw_main_canvas(ezgl::renderer* g) {
300
301
/* function below intializes the interface window with a set of buttons and links
301
302
* signals to corresponding functions for situation where the window is opened from
302
303
* NO_PICTURE_to_PLACEMENT */
303
- void initial_setup_NO_PICTURE_to_PLACEMENT (ezgl::application* app, bool is_new_window) {
304
+ static void initial_setup_NO_PICTURE_to_PLACEMENT (ezgl::application* app, bool is_new_window) {
304
305
if (!is_new_window) return ;
305
306
306
307
// button to enter window_mode, created in main.ui
@@ -337,15 +338,15 @@ void initial_setup_NO_PICTURE_to_PLACEMENT(ezgl::application* app, bool is_new_w
337
338
/* function below intializes the interface window with a set of buttons and links
338
339
* signals to corresponding functions for situation where the window is opened from
339
340
* NO_PICTURE_to_PLACEMENT_with_crit_path */
340
- void initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path (ezgl::application* app, bool is_new_window) {
341
+ static void initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path (ezgl::application* app, bool is_new_window) {
341
342
initial_setup_NO_PICTURE_to_PLACEMENT (app, is_new_window);
342
343
button_for_toggle_crit_path ();
343
344
}
344
345
345
346
/* function below intializes the interface window with a set of buttons and links
346
347
* signals to corresponding functions for situation where the window is opened from
347
348
* PLACEMENT_to_ROUTING */
348
- void initial_setup_PLACEMENT_to_ROUTING (ezgl::application* app, bool is_new_window) {
349
+ static void initial_setup_PLACEMENT_to_ROUTING (ezgl::application* app, bool is_new_window) {
349
350
initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path (app, is_new_window);
350
351
button_for_toggle_rr ();
351
352
button_for_toggle_congestion ();
@@ -358,7 +359,7 @@ void initial_setup_PLACEMENT_to_ROUTING(ezgl::application* app, bool is_new_wind
358
359
/* function below intializes the interface window with a set of buttons and links
359
360
* signals to corresponding functions for situation where the window is opened from
360
361
* ROUTING_to_PLACEMENT */
361
- void initial_setup_ROUTING_to_PLACEMENT (ezgl::application* app, bool is_new_window) {
362
+ static void initial_setup_ROUTING_to_PLACEMENT (ezgl::application* app, bool is_new_window) {
362
363
initial_setup_PLACEMENT_to_ROUTING (app, is_new_window);
363
364
std::string toggle_rr = " toggle_rr" ;
364
365
std::string toggle_congestion = " toggle_congestion" ;
@@ -378,7 +379,7 @@ void initial_setup_ROUTING_to_PLACEMENT(ezgl::application* app, bool is_new_wind
378
379
/* function below intializes the interface window with a set of buttons and links
379
380
* signals to corresponding functions for situation where the window is opened from
380
381
* NO_PICTURE_to_ROUTING */
381
- void initial_setup_NO_PICTURE_to_ROUTING (ezgl::application* app, bool is_new_window) {
382
+ static void initial_setup_NO_PICTURE_to_ROUTING (ezgl::application* app, bool is_new_window) {
382
383
if (!is_new_window) return ;
383
384
384
385
GtkButton* window = (GtkButton*)app->get_object (" Window" );
@@ -416,7 +417,7 @@ void initial_setup_NO_PICTURE_to_ROUTING(ezgl::application* app, bool is_new_win
416
417
/* function below intializes the interface window with a set of buttons and links
417
418
* signals to corresponding functions for situation where the window is opened from
418
419
* NO_PICTURE_to_ROUTING_with_crit_path */
419
- void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path (ezgl::application* app, bool is_new_window) {
420
+ static void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path (ezgl::application* app, bool is_new_window) {
420
421
initial_setup_NO_PICTURE_to_ROUTING (app, is_new_window);
421
422
button_for_toggle_crit_path ();
422
423
}
@@ -529,7 +530,7 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
529
530
}
530
531
531
532
#ifndef NO_GRAPHICS
532
- void toggle_window_mode (GtkWidget* /* widget*/ , ezgl::application* /* app*/ ) {
533
+ static void toggle_window_mode (GtkWidget* /* widget*/ , ezgl::application* /* app*/ ) {
533
534
window_mode = true ;
534
535
}
535
536
@@ -1194,27 +1195,24 @@ static void draw_routing_costs(ezgl::renderer* g) {
1194
1195
float min_cost = std::numeric_limits<float >::infinity ();
1195
1196
float max_cost = -min_cost;
1196
1197
std::vector<float > rr_node_costs (device_ctx.rr_nodes .size (), 0 .);
1198
+
1197
1199
for (size_t inode = 0 ; inode < device_ctx.rr_nodes .size (); inode++) {
1198
1200
float cost = 0 .;
1199
1201
if (draw_state->show_routing_costs == DRAW_TOTAL_ROUTING_COSTS
1200
1202
|| draw_state->show_routing_costs == DRAW_LOG_TOTAL_ROUTING_COSTS) {
1201
- int cost_index = device_ctx.rr_nodes [inode].cost_index ();
1202
- cost = device_ctx.rr_indexed_data [cost_index].base_cost
1203
- + route_ctx.rr_node_route_inf [inode].acc_cost
1204
- + route_ctx.rr_node_route_inf [inode].pres_cost ;
1203
+ cost = get_single_rr_cong_cost (inode, get_draw_state_vars ()->pres_fac );
1205
1204
1206
1205
} else if (draw_state->show_routing_costs == DRAW_BASE_ROUTING_COSTS) {
1207
- int cost_index = device_ctx.rr_nodes [inode].cost_index ();
1208
- cost = device_ctx.rr_indexed_data [cost_index].base_cost ;
1206
+ cost = get_single_rr_cong_base_cost (inode);
1209
1207
1210
1208
} else if (draw_state->show_routing_costs == DRAW_ACC_ROUTING_COSTS
1211
1209
|| draw_state->show_routing_costs == DRAW_LOG_ACC_ROUTING_COSTS) {
1212
- cost = route_ctx. rr_node_route_inf [ inode]. acc_cost ;
1210
+ cost = get_single_rr_cong_acc_cost ( inode) ;
1213
1211
1214
1212
} else {
1215
1213
VTR_ASSERT (draw_state->show_routing_costs == DRAW_PRES_ROUTING_COSTS
1216
1214
|| draw_state->show_routing_costs == DRAW_LOG_PRES_ROUTING_COSTS);
1217
- cost = route_ctx. rr_node_route_inf [ inode]. pres_cost ;
1215
+ cost = get_single_rr_cong_pres_cost ( inode, get_draw_state_vars ()-> pres_fac ) ;
1218
1216
}
1219
1217
1220
1218
if (draw_state->show_routing_costs == DRAW_LOG_TOTAL_ROUTING_COSTS
@@ -3913,7 +3911,7 @@ float get_net_alpha() {
3913
3911
return draw_state->net_alpha ;
3914
3912
}
3915
3913
3916
- void setup_default_ezgl_callbacks (ezgl::application* app) {
3914
+ static void setup_default_ezgl_callbacks (ezgl::application* app) {
3917
3915
// Connect press_proceed function to the Proceed button
3918
3916
GObject* proceed_button = app->get_object (" ProceedButton" );
3919
3917
g_signal_connect (proceed_button, " clicked" , G_CALLBACK (ezgl::press_proceed), app);
@@ -3940,7 +3938,7 @@ void setup_default_ezgl_callbacks(ezgl::application* app) {
3940
3938
}
3941
3939
3942
3940
// Callback function for Block Outline checkbox
3943
- void set_block_outline (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ ) {
3941
+ static void set_block_outline (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ ) {
3944
3942
t_draw_state* draw_state = get_draw_state_vars ();
3945
3943
3946
3944
// assign corresponding bool value to draw_state->draw_block_outlines
@@ -3954,7 +3952,7 @@ void set_block_outline(GtkWidget* widget, gint /*response_id*/, gpointer /*data*
3954
3952
}
3955
3953
3956
3954
// Callback function for Block Text checkbox
3957
- void set_block_text (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ ) {
3955
+ static void set_block_text (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ ) {
3958
3956
t_draw_state* draw_state = get_draw_state_vars ();
3959
3957
3960
3958
// assign corresponding bool value to draw_state->draw_block_text
@@ -3969,7 +3967,7 @@ void set_block_text(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/)
3969
3967
}
3970
3968
3971
3969
// Callback function for Clip Routing Util checkbox
3972
- void clip_routing_util (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ ) {
3970
+ static void clip_routing_util (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ ) {
3973
3971
t_draw_state* draw_state = get_draw_state_vars ();
3974
3972
3975
3973
// assign corresponding bool value to draw_state->clip_routing_util
@@ -3999,13 +3997,13 @@ void net_max_fanout(GtkWidget* /*widget*/, gint /*response_id*/, gpointer /*data
3999
3997
application.refresh_drawing ();
4000
3998
}
4001
3999
4002
- void set_force_pause (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ ) {
4000
+ static void set_force_pause (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ ) {
4003
4001
t_draw_state* draw_state = get_draw_state_vars ();
4004
4002
4005
4003
draw_state->forced_pause = true ;
4006
4004
}
4007
4005
4008
- void run_graphics_commands (std::string commands) {
4006
+ static void run_graphics_commands (std::string commands) {
4009
4007
// A very simmple command interpreter for scripting graphics
4010
4008
t_draw_state* draw_state = get_draw_state_vars ();
4011
4009
0 commit comments