Skip to content

[Infra] Cleaned Up Includes in Draw Dir #3071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
4 changes: 4 additions & 0 deletions vpr/src/base/vpr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
#include "serverupdate.h"
#endif /* NO_SERVER */

#ifndef NO_GRAPHICS
#include "draw_global.h"
#endif // NO_GRAPHICS

/* Local subroutines */
static void free_complex_block_types();

Expand Down
5 changes: 4 additions & 1 deletion vpr/src/draw/breakpoint.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@

#ifndef NO_GRAPHICS

#include "breakpoint.h"
#include "draw_global.h"
#include "vtr_expr_eval.h"

#include <iostream>

#ifndef NO_GRAPHICS
//if the user adds a "proceed move" breakpoint using the entry field in the UI, this function converts it to the equivalent expression and calls the expression evaluator. Returns true if a breakpoint is encountered
//the way the proceed moves breakpoint works is that it proceeds the indicated number of moves from where the placer currently is i.e if at move 3 and proceed 4 ends up at move 7
bool check_for_moves_breakpoints(int moves_to_proceed) {
Expand Down
10 changes: 2 additions & 8 deletions vpr/src/draw/breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@
* breakpoints have the same type, and the same value corresponding to the type.
*/

#ifndef BREAKPOINT_H
#define BREAKPOINT_H
#pragma once

#include <vector>
#include <string>

#include "move_transactions.h"
#include "vtr_expr_eval.h"
#include "breakpoint_state_globals.h"

typedef enum breakpoint_types {
BT_MOVE_NUM,
Expand Down Expand Up @@ -133,5 +129,3 @@ BreakpointState get_current_info_b();

//prints current BreakpointState information to terminal when breakpoint is reached
void print_current_info(bool in_placer);

#endif /* BREAKPOINT_H */
5 changes: 1 addition & 4 deletions vpr/src/draw/breakpoint_state_globals.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef BREAKPOINT_STATE_GLOBALS
#define BREAKPOINT_STATE_GLOBALS
#pragma once

#include <string>
#include <vector>
Expand Down Expand Up @@ -29,5 +28,3 @@ class BreakpointStateGlobals {
return &glob_breakpoint_state;
}
};

#endif
6 changes: 0 additions & 6 deletions vpr/src/draw/buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@
* Last updated: Aug 2019
*/

#include "draw_global.h"
#include "draw.h"
#include "draw_toggle_functions.h"
#include "buttons.h"
#include "intra_logic_block.h"
#include "clustered_netlist.h"

#include "ezgl/point.hpp"
#include "ezgl/application.hpp"
#include "ezgl/graphics.hpp"

//location of spin buttons, combo boxes, and labels on grid
gint box_width = 1;
Expand Down
12 changes: 3 additions & 9 deletions vpr/src/draw/buttons.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
#ifndef BUTTONS_H
#define BUTTONS_H
#pragma once

#ifndef NO_GRAPHICS

#include "draw_global.h"

#include "ezgl/point.hpp"
#include "ezgl/application.hpp"
#include "ezgl/graphics.hpp"
#include <gtk/gtk.h>

void delete_button(const char* button_name);
GtkWidget* find_button(const char* button_name);
#endif /* NO_GRAPHICS */

#endif /* BUTTONS_H */
#endif /* NO_GRAPHICS */
22 changes: 9 additions & 13 deletions vpr/src/draw/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@
#include <cstdio>
#include <cstring>
#include <cmath>
#include "draw.h"
#include "timing_info.h"
#include "physical_types.h"

#include "move_utils.h"

#ifndef NO_GRAPHICS

#include <algorithm>
#include <array>
#include <iostream>

#include "draw_debug.h"
#include "vtr_assert.h"
#include "vtr_ndoffsetmatrix.h"
#include "vtr_memory.h"
#include "vtr_log.h"
#include "vtr_color_map.h"
#include "vtr_path.h"
Expand All @@ -30,39 +38,27 @@

#include "globals.h"
#include "draw_color.h"
#include "draw.h"
#include "draw_basic.h"
#include "draw_rr.h"
#include "draw_toggle_functions.h"
#include "draw_searchbar.h"
#include "draw_global.h"
#include "intra_logic_block.h"
#include "tatum/report/TimingPathCollector.hpp"
#include "hsl.h"
#include "route_export.h"
#include "search_bar.h"
#include "save_graphics.h"
#include "timing_info.h"
#include "physical_types.h"
#include "manual_moves.h"
#include "draw_noc.h"
#include "draw_floorplanning.h"

#include "move_utils.h"
#include "ui_setup.h"

#ifndef NO_GRAPHICS

//To process key presses we need the X11 keysym definitions,
//which are unavailable when building with MINGW
#if defined(X11) && !defined(__MINGW32__)
#include <X11/keysym.h>
#endif

#include "rr_graph.h"
#include "route_utilization.h"
#include "place_macro.h"
#include "buttons.h"
#include "draw_rr.h"
/****************************** Define Macros *******************************/

Expand Down
25 changes: 11 additions & 14 deletions vpr/src/draw/draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@
* Last updated: August 2022
*/

#ifndef DRAW_H
#define DRAW_H
#pragma once

#include "rr_graph_fwd.h"
#include "timing_info.h"
#include "blk_loc_registry.h"
#include "physical_types.h"
#include "rr_graph_type.h"
#include "timing_info.h"
#include "vpr_types.h"
#include <string>

#ifndef NO_GRAPHICS

#include "draw_global.h"

#include "ezgl/point.hpp"
#include "draw_types.h"
#include "ezgl/application.hpp"
#include "ezgl/graphics.hpp"
#include "draw_color.h"
#include "search_bar.h"
#include "draw_debug.h"
#include "manual_moves.h"
#include "ezgl/point.hpp"
#include "physical_types.h"
#include "rr_graph_fwd.h"
#include "vtr_color_map.h"
#include "vtr_ndoffsetmatrix.h"

extern ezgl::application::settings settings;
Expand Down Expand Up @@ -173,5 +172,3 @@ t_draw_layer_display get_element_visibility_and_transparency(int src_layer, int
ClusterBlockId get_cluster_block_id_from_xy_loc(double x, double y);

#endif /* NO_GRAPHICS */

#endif /* DRAW_H */
6 changes: 2 additions & 4 deletions vpr/src/draw/draw_basic.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* draw_basic.cpp contains all functions that draw in the main graphics area
* that aren't RR nodes or muxes (they have their own file).
* All functions in this file contain the prefix draw_. */
#ifndef NO_GRAPHICS

#include <cstdio>
#include <cmath>
#include <algorithm>
Expand All @@ -27,18 +29,14 @@
#include "route_export.h"
#include "tatum/report/TimingPathCollector.hpp"

#ifndef NO_GRAPHICS

//To process key presses we need the X11 keysym definitions,
//which are unavailable when building with MINGW
#if defined(X11) && !defined(__MINGW32__)
#include <X11/keysym.h>
#endif

#include "rr_graph.h"
#include "route_utilization.h"
#include "place_macro.h"
#include "buttons.h"

/****************************** Define Macros *******************************/
#define DEFAULT_RR_NODE_COLOR ezgl::BLACK
Expand Down
32 changes: 8 additions & 24 deletions vpr/src/draw/draw_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,23 @@
* All functions in this file contain the prefix draw_.
*/

#ifndef DRAW_BASIC_H
#define DRAW_BASIC_H
#pragma once

#ifndef NO_GRAPHICS

#include <cstdio>
#include <cfloat>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <array>
#include <iostream>

#include "vtr_assert.h"
#include "vtr_ndoffsetmatrix.h"
#include "vtr_memory.h"
#include "vtr_log.h"
#include "vtr_color_map.h"
#include "vtr_path.h"

#include "vpr_utils.h"
#include "vpr_error.h"

#include "globals.h"
#include "draw_types.h"
#include "netlist_fwd.h"
#include "rr_graph_fwd.h"
#include "tatum/TimingGraphFwd.hpp"

#include "move_utils.h"

#ifndef NO_GRAPHICS

#include "draw_global.h"
#include "vtr_color_map.h"

#include "ezgl/point.hpp"
#include "ezgl/application.hpp"
#include "ezgl/graphics.hpp"

/* Draws the blocks placed on the proper clbs. Occupied blocks are darker colours *
Expand Down Expand Up @@ -158,4 +143,3 @@ void draw_reset_blk_colors();
void draw_reset_blk_color(ClusterBlockId blk_id);

#endif /* NO_GRAPHICS */
#endif /* DRAW_BASIC_H */
10 changes: 3 additions & 7 deletions vpr/src/draw/draw_color.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
* as well as a global vector of colors shuffled to prevent similar
* colors from being close together
*/
#ifndef DRAW_COLOR_H
#define DRAW_COLOR_H
#pragma once

#ifndef NO_GRAPHICS

#include "ezgl/point.hpp"
#include "ezgl/application.hpp"
#include "ezgl/graphics.hpp"
#include <vector>
#include "ezgl/color.hpp"

static constexpr ezgl::color blk_BISQUE(0xFF, 0xE4, 0xC4);
static constexpr ezgl::color blk_LIGHTGREY(0xD3, 0xD3, 0xD3);
Expand Down Expand Up @@ -326,5 +324,3 @@ const std::vector<ezgl::color> block_colors{
};

#endif /* NO_GRAPHICS */

#endif /* DRAW_COLOR_H */
6 changes: 4 additions & 2 deletions vpr/src/draw/draw_debug.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "draw_debug.h"

#ifndef NO_GRAPHICS

#include "draw_debug.h"
#include "draw_global.h"
#include "vtr_expr_eval.h"

//keeps track of open windows to avoid reopenning windows that are alerady open
struct open_windows {
bool debug_window = false;
Expand Down
21 changes: 6 additions & 15 deletions vpr/src/draw/draw_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,17 @@
* This file contains all functions regarding the graphics related to the setting of place and route breakpoints.
* Manages creation of new Gtk Windows with debug options on use of the "Debug" button.
*/
#ifndef DRAW_DEBUG_H
#define DRAW_DEBUG_H
#pragma once

#ifndef NO_GRAPHICS

#include "breakpoint.h"
#include "draw_global.h"
#include "ezgl/application.hpp"
#include "ezgl/graphics.hpp"

#include <cstdio>
#include <cfloat>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <array>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <gtk/gtk.h>
#include <string>
#include "breakpoint_state_globals.h"

/** debugger functions **/
void draw_debug_window();
Expand All @@ -44,5 +37,3 @@ bool valid_expression(std::string exp);
void breakpoint_info_window(std::string bpDescription, BreakpointState draw_breakpoint_state, bool in_placer);

#endif /*NO_GRAPHICS*/

#endif /*DRAW_DEBUG_H*/
11 changes: 2 additions & 9 deletions vpr/src/draw/draw_floorplanning.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
#include <vector>
#ifndef NO_GRAPHICS

#include "vpr_error.h"
#include <vector>

#include "globals.h"

#include "draw_floorplanning.h"
#include "user_place_constraints.h"
#include "draw_color.h"
#include "draw.h"
#include "read_xml_arch_file.h"
#include "draw_global.h"
#include "intra_logic_block.h"
#include "route_export.h"
#include "tatum/report/TimingPathCollector.hpp"

#ifndef NO_GRAPHICS

//To process key presses we need the X11 keysym definitions,
//which are unavailable when building with MINGW
Expand Down
Loading