Skip to content

Commit 9b81271

Browse files
committed
moved the call back function for the NoC display button from draw.cpp to draw_toggle_functions.cpp. This was done to match the previous refactor changes.
1 parent 95dae7f commit 9b81271

File tree

4 files changed

+27
-24
lines changed

4 files changed

+27
-24
lines changed

vpr/src/draw/draw.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -536,27 +536,6 @@ static void toggle_window_mode(GtkWidget* /*widget*/,
536536
window_mode = true;
537537
}
538538

539-
void toggle_noc_display(GtkWidget* /*widget*/, gint /*response_id*/, gpointer /*data*/)
540-
{
541-
/* this is the callback function for runtime created toggle_noc_display button
542-
* which is written in button.cpp */
543-
t_draw_state* draw_state = get_draw_state_vars();
544-
std::string button_name = "toggle_noc_display";
545-
auto toggle_crit_path = find_button(button_name.c_str());
546-
547-
gchar* combo_box_content = gtk_combo_box_text_get_active_text(
548-
GTK_COMBO_BOX_TEXT(toggle_crit_path));
549-
if (strcmp(combo_box_content, "None") == 0) {
550-
draw_state->draw_noc = DRAW_NO_NOC;
551-
} else if (strcmp(combo_box_content, "NoC Links") == 0)
552-
draw_state->draw_noc = DRAW_NOC_LINKS;
553-
else
554-
draw_state->draw_noc = DRAW_NOC_LINK_USAGE;
555-
556-
g_free(combo_box_content);
557-
application.refresh_drawing();
558-
}
559-
560539
#endif // NO_GRAPHICS
561540

562541
void alloc_draw_structs(const t_arch* arch) {

vpr/src/draw/draw.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ bool trace_routed_connection_rr_nodes_recurr(const t_rt_node* rt_node,
7878
int sink_rr_node,
7979
std::vector<int>& rr_nodes_on_path);
8080

81-
// toggle functions
82-
void toggle_noc_display(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/);
83-
8481
/* This routine highlights the blocks affected in the latest move *
8582
* It highlights the old and new locations of the moved blocks *
8683
* It also highlights the moved block input and output terminals *

vpr/src/draw/draw_toggle_functions.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,27 @@ void toggle_router_expansion_costs(GtkWidget* /*widget*/, gint /*response_id*/,
378378
application.refresh_drawing();
379379
}
380380

381+
void toggle_noc_display(GtkWidget* /*widget*/, gint /*response_id*/, gpointer /*data*/)
382+
{
383+
/* this is the callback function for runtime created toggle_noc_display button
384+
* which is written in button.cpp */
385+
t_draw_state* draw_state = get_draw_state_vars();
386+
std::string button_name = "toggle_noc_display";
387+
auto toggle_crit_path = find_button(button_name.c_str());
388+
389+
gchar* combo_box_content = gtk_combo_box_text_get_active_text(
390+
GTK_COMBO_BOX_TEXT(toggle_crit_path));
391+
if (strcmp(combo_box_content, "None") == 0) {
392+
draw_state->draw_noc = DRAW_NO_NOC;
393+
} else if (strcmp(combo_box_content, "NoC Links") == 0)
394+
draw_state->draw_noc = DRAW_NOC_LINKS;
395+
else
396+
draw_state->draw_noc = DRAW_NOC_LINK_USAGE;
397+
398+
g_free(combo_box_content);
399+
application.refresh_drawing();
400+
}
401+
381402
// Callback function for NetMax Fanout checkbox
382403
void net_max_fanout(GtkWidget* /*widget*/, gint /*response_id*/, gpointer /*data*/) {
383404
/* this is the callback function for runtime created net_max_fanout widget

vpr/src/draw/draw_toggle_functions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ void toggle_router_expansion_costs(GtkWidget* /*widget*/, gint /*response_id*/,
8888
* Controls if placement macros should be visualized. Changes value of draw_state->show_placement_macros. */
8989
void toggle_placement_macros(GtkWidget* /*widget*/, gint /*response_id*/, gpointer /*data*/);
9090

91+
/* Callback function for runtime created toggle_noc_display
92+
* in button.cpp.
93+
* Controls if the NoC on chip should be visualized and whether the link usage
94+
* in the NoC should be visualized. Changes value of draw_state->draw_noc */
95+
void toggle_noc_display(GtkWidget* widget, gint /*response_id*/, gpointer /*data*/);
96+
9197
/* Callback function for runtime created netMaxFanout widget in button.cpp.
9298
* Sets draw_state->draw_net_max_fanout to its corresponding value in the UI. */
9399
void net_max_fanout(GtkWidget* /*widget*/, gint /*response_id*/, gpointer /*data*/);

0 commit comments

Comments
 (0)