15
15
# include " search_bar.h"
16
16
# include " draw_debug.h"
17
17
# include " manual_moves.h"
18
+ # include " vtr_ndoffsetmatrix.h"
18
19
19
20
extern ezgl::application::settings settings;
20
21
extern ezgl::application application;
21
22
22
23
#endif /* NO_GRAPHICS */
23
24
24
25
void update_screen (ScreenUpdatePriority priority, const char * msg, enum pic_type pic_on_screen_val, std::shared_ptr<SetupTimingInfo> timing_info);
26
+
25
27
// Initializes the drawing locations.
26
28
// FIXME: Currently broken if no rr-graph is loaded
27
29
void init_draw_coords (float clb_width);
28
30
31
+ /* Sets the static show_graphics and gr_automode variables to the *
32
+ * desired values. They control if graphics are enabled and, if so, *
33
+ * how often the user is prompted for input. */
29
34
void init_graphics_state (bool show_graphics_val, int gr_automode_val, enum e_route_type route_type, bool save_graphics, std::string graphics_commands);
30
35
36
+ /* Allocates the structures needed to draw the placement and routing.*/
31
37
void alloc_draw_structs (const t_arch* arch);
38
+
39
+ /* Free everything allocated by alloc_draw_structs. Called after close_graphics()
40
+ * in vpr_api.c. */
32
41
void free_draw_structs ();
33
42
34
43
#ifndef NO_GRAPHICS
35
-
36
- void draw_get_rr_pin_coords (int inode, float * xcen, float * ycen, const e_side& pin_side);
37
- void draw_get_rr_pin_coords (const t_rr_node& node, float * xcen, float * ycen, const e_side& pin_side);
38
-
39
- void draw_triangle_along_line (ezgl::renderer* g, ezgl::point2d start, ezgl::point2d end, float relative_position = 1 ., float arrow_size = DEFAULT_ARROW_SIZE);
40
- void draw_triangle_along_line (ezgl::renderer* g, ezgl::point2d loc, ezgl::point2d start, ezgl::point2d end, float arrow_size = DEFAULT_ARROW_SIZE);
41
- void draw_triangle_along_line (ezgl::renderer* g, float xend, float yend, float x1, float x2, float y1, float y2, float arrow_size = DEFAULT_ARROW_SIZE);
42
-
43
44
const ezgl::color SELECTED_COLOR = ezgl::GREEN;
44
45
const ezgl::color DRIVES_IT_COLOR = ezgl::RED;
45
46
const ezgl::color DRIVEN_BY_IT_COLOR = ezgl::LIGHT_MEDIUM_BLUE;
46
47
47
48
const float WIRE_DRAWING_WIDTH = 0.5 ;
48
49
50
+ /* Find the edge between two rr nodes */
51
+ t_edge_size find_edge (int prev_inode, int inode);
52
+
53
+ /* Returns the track number of this routing resource node inode. */
54
+ int get_track_num (int inode, const vtr::OffsetMatrix<int >& chanx_track, const vtr::OffsetMatrix<int >& chany_track);
55
+
49
56
// Returns the drawing coordinates of the specified pin
50
57
ezgl::point2d atom_pin_draw_coord (AtomPinId pin);
51
58
52
59
// Returns the drawing coordinates of the specified tnode
53
60
ezgl::point2d tnode_draw_coord (tatum::NodeId node);
54
61
55
- void annotate_draw_rr_node_costs (ClusterNetId net, int sink_rr_node);
56
- void clear_draw_rr_annotations ();
57
-
62
+ /* Converts a vtr Color to a ezgl Color. */
58
63
ezgl::color to_ezgl_color (vtr::Color<float > color);
59
64
60
- void draw_screen ();
61
-
62
- // search bar related functions
63
- ezgl::rectangle draw_get_rr_chan_bbox (int inode);
64
- void draw_highlight_blocks_color (t_logical_block_type_ptr type, ClusterBlockId blk_id);
65
- void highlight_nets (char * message, int hit_node);
66
- void draw_highlight_fan_in_fan_out (const std::set<int >& nodes);
67
- std::set<int > draw_expand_non_configurable_rr_nodes (int hit_node);
68
- void deselect_all ();
69
-
70
- // toggle functions
71
- void toggle_nets (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
72
- void toggle_rr (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
73
- void toggle_congestion (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
74
- void toggle_routing_congestion_cost (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
75
- void toggle_routing_bounding_box (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
76
- void toggle_routing_util (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
77
- void toggle_crit_path (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
78
- void toggle_block_pin_util (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
79
- void toggle_router_expansion_costs (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
80
- void toggle_placement_macros (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
81
- void net_max_fanout (GtkWidget* /* widget*/ , gint /* response_id*/ , gpointer /* data*/ );
82
- void set_net_alpha_value (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ );
83
- void set_net_alpha_value_with_enter (GtkWidget* widget, gint /* response_id*/ , gpointer /* data*/ );
84
- float get_net_alpha ();
85
-
86
- ezgl::color get_block_type_color (t_physical_tile_type_ptr type);
65
+ /* This helper function determines whether a net has been highlighted. The highlighting
66
+ * could be caused by the user clicking on a routing resource, toggled, or
67
+ * fan-in/fan-out of a highlighted node. */
68
+ bool draw_if_net_highlighted (ClusterNetId inet);
69
+ std::vector<int > trace_routed_connection_rr_nodes (
70
+ const ClusterNetId net_id,
71
+ const int driver_pin,
72
+ const int sink_pin);
73
+
74
+ /* Helper function for trace_routed_connection_rr_nodes
75
+ * Adds the rr nodes linking rt_node to sink_rr_node to rr_nodes_on_path
76
+ * Returns true if rt_node is on the path. */
77
+ bool trace_routed_connection_rr_nodes_recurr (const t_rt_node* rt_node,
78
+ int sink_rr_node,
79
+ std::vector<int >& rr_nodes_on_path);
87
80
88
81
/* This routine highlights the blocks affected in the latest move *
89
82
* It highlights the old and new locations of the moved blocks *
@@ -103,6 +96,13 @@ void clear_colored_locations();
103
96
// otherwise, the function returns false (the location isn't among the highlighted locations)
104
97
bool highlight_loc_with_specific_color (int x, int y, ezgl::color& loc_color);
105
98
99
+ /* Because the list of possible block type colours is finite, we wrap around possible colours if there are more
100
+ * block types than colour choices. This ensures we support any number of types, although the colours may repeat.*/
101
+ ezgl::color get_block_type_color (t_physical_tile_type_ptr type);
102
+
103
+ /* Lightens a color's luminance [0, 1] by an aboslute 'amount' */
104
+ ezgl::color lighten_color (ezgl::color color, float amount);
105
+
106
106
#endif /* NO_GRAPHICS */
107
107
108
108
#endif /* DRAW_H */
0 commit comments