Skip to content

Commit fe505e0

Browse files
Merge pull request #2121 from verilog-to-routing/Seb_DrawDocumentation
Documentation Updates for VPR Graphics
2 parents 04161e5 + b39e9e9 commit fe505e0

33 files changed

+578
-164
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
===============
2+
VPR Draw Files
3+
===============
4+
5+
breakpoint.h/cpp
6+
--------------
7+
.. doxygenfile:: breakpoint.h
8+
:project: vpr
9+
:sections: detaileddescription
10+
11+
draw_basic.h/cpp
12+
--------------
13+
.. doxygenfile:: draw_basic.h
14+
:project: vpr
15+
:sections: detaileddescription
16+
17+
draw_color.h
18+
--------------
19+
.. doxygenfile:: draw_color.h
20+
:project: vpr
21+
:sections: detaileddescription
22+
23+
draw_debug.h/cpp
24+
--------------
25+
.. doxygenfile:: draw_debug.h
26+
:project: vpr
27+
:sections: detaileddescription
28+
29+
draw_global.h/cpp
30+
--------------
31+
.. doxygenfile:: draw_global.h
32+
:project: vpr
33+
:sections: detaileddescription
34+
35+
draw_mux.h/cpp
36+
--------------
37+
.. doxygenfile:: draw_mux.h
38+
:project: vpr
39+
:sections: detaileddescription
40+
41+
draw_noc.h/cpp
42+
--------------
43+
.. doxygenfile:: draw_noc.h
44+
:project: vpr
45+
:sections: detaileddescription
46+
47+
draw_rr_edges.h/cpp
48+
--------------
49+
.. doxygenfile:: draw_rr_edges.h
50+
:project: vpr
51+
:sections: detaileddescription
52+
53+
draw_rr.h/cpp
54+
--------------
55+
.. doxygenfile:: draw_rr.h
56+
:project: vpr
57+
:sections: detaileddescription
58+
59+
draw_searchbar.h/cpp
60+
--------------
61+
.. doxygenfile:: draw_searchbar.h
62+
:project: vpr
63+
:sections: detaileddescription
64+
65+
draw_toggle_functions.h/cpp
66+
--------------
67+
.. doxygenfile:: draw_toggle_functions.h
68+
:project: vpr
69+
:sections: detaileddescription
70+
71+
draw_triangle.h/cpp
72+
--------------
73+
.. doxygenfile:: draw_triangle.h
74+
:project: vpr
75+
:sections: detaileddescription
76+
77+
draw_types.h/cpp
78+
--------------
79+
.. doxygenfile:: draw_types.h
80+
:project: vpr
81+
:sections: detaileddescription
82+
83+
draw.h/cpp
84+
--------------
85+
.. doxygenfile:: draw.h
86+
:project: vpr
87+
:sections: detaileddescription
88+
89+
hsl.h/cpp
90+
--------------
91+
.. doxygenfile:: hsl.h
92+
:project: vpr
93+
:sections: detaileddescription
94+
95+
intra_logic_block.h/cpp
96+
--------------
97+
.. doxygenfile:: intra_logic_block.h
98+
:project: vpr
99+
:sections: detaileddescription
100+
101+
manual_moves.h/cpp
102+
--------------
103+
.. doxygenfile:: manual_moves.h
104+
:project: vpr
105+
:sections: detaileddescription
106+
107+
save_graphics.h/cpp
108+
--------------
109+
.. doxygenfile:: save_graphics.h
110+
:project: vpr
111+
:sections: detaileddescription
112+
113+
search_bar.h/cpp
114+
--------------
115+
.. doxygenfile:: search_bar.h
116+
:project: vpr
117+
:sections: detaileddescription
118+
119+
ui_setup.h/cpp
120+
--------------
121+
.. doxygenfile:: ui_setup.h
122+
:project: vpr
123+
:sections: detaileddescription
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
===============
2+
VPR Draw Structures
3+
===============
4+
5+
T_Draw_State
6+
----------
7+
.. doxygenstruct:: t_draw_state
8+
:project: vpr
9+
:members:
10+
11+
T_Draw_Coords
12+
----------
13+
.. doxygenstruct:: t_draw_coords
14+
:project: vpr
15+
:members:

doc/src/api/vprinternals/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.. _vpr_internals:
2+
3+
VPR INTERNALS
4+
=======
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
9+
draw_structs
10+
vpr_ui
11+
draw_files
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=============================
2+
VPR UI
3+
=============================
4+
5+
UI SETUP
6+
-------
7+
.. doxygenfile:: ui_setup.h
8+
:project: vpr
9+
:sections: func
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _edit_vpr_ui:
2+
3+
Editing VPR UI
4+
--------------
5+
6+
VPR's UI is created with GTK, and actively maintained/edited through the use of Glade and a main.ui file. We prefer to not use code initializations of Gtk Buttons/UI objects, and instead make them with Glade.
7+
This allows for better organized menus and visual editing of the UI. Please consult the attached guide for Glade: <Link Glade/Gtk quickstart> (WIP as of August 8th, 2022).
8+
9+
When connecting a button to its function, place it in an appropriate function depending on the drop down menu it will go in. Button setups are done in ui_setup.cpp/h and callback functions are in draw_toggle_functions.cpp/h.

doc/src/dev/tutorials/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Developer Tutorials
88

99
new_developer_tutorial
1010
timing_graph_debug/index
11+
edit_vpr_ui

doc/src/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ For more specific documentation about VPR see :ref:`vpr`.
6363

6464
api/vpr/index
6565
api/vtrutil/index
66+
api/vprinternals/index
6667

6768
Indices and tables
6869
==================

vpr/src/draw/breakpoint.h

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* @file breakpoint.h
3+
*
4+
* @brief Declaration of breakpoint class, as well as some related functions.
5+
*
6+
* This file holds the declaration of the breakpoint class, and also some of the breakpoint related functions.
7+
*
8+
* This class holds the definiton of type Breakpoint as well as all related functions.
9+
* Breakpoints can be set through the GUI anytime during placement or routing. Breakpoints can also be activated,
10+
* deactivated, and deleted. Each breakpoint has a type (BT_MOVE_NUM, BT_TEMP_NUM, BT_FROM_BLOCK, BT_ROUTER_ITER, BT_ROUTE_NET_ID, BT_EXPRESSION) and holds the
11+
* values for corresponding to its type, as well as a boolean variable to activate and deactivate a breakpoint. It should be noted that each breakpoint can only have one type and hold one value corresponding to that type.
12+
* More complicated breakpoints are set using an expression. (e.g move_num > 3 && block_id == 11)
13+
* Breakpoints can be create using 3 constructors, the default contructor that doesn't identify the type and sets a breakpoint that is never reached,
14+
* a constructor that takes in the type and an int value, and lastly a constructor that takes in the type and the sting that holds the expression.
15+
* (e.g Breakpoint(BT_MOVE_NUM, 4) or Breakpoint(BT_EXPRESSION, "move_num += 3")) The == operator has also been provided which returns true when two
16+
* breakpoints have the same type, and the same value corresponding to the type.
17+
*/
18+
119
#ifndef BREAKPOINT_H
220
#define BREAKPOINT_H
321

@@ -7,9 +25,6 @@
725
#include "move_transactions.h"
826
#include "vtr_expr_eval.h"
927

10-
/**This class holds the definiton of type Breakpoint as well as al realted functions. Breakpoints can be set through the GUI anytime during placement or routing. Breakpoints can also be activated, deactivated, and deleted. Each breakpoint has a type (BT_MOVE_NUM, BT_TEMP_NUM, BT_FROM_BLOCK, BT_ROUTER_ITER, BT_ROUTE_NET_ID, BT_EXPRESSION) and holds the values for corresponding to its type, as well as a boolean variable to activate and deactivate a breakpoint. It should be noted that each breakpoint can only have one type and hold one value corresponding to that type. More complicated breakpoints are set using an expression. (e.g move_num > 3 && block_id == 11)
11-
* Breakpoints can be create using 3 constructors, the default contructor that doesn't identify the type and sets a breakopint that is never reached, a constructor that takes in the type and an int value, and lastly a constructor that takes in the type and the sting that holds the expression. (e.g Breakpoint(BT_MOVE_NUM, 4) or Breakpoint(BT_EXPRESSION, "move_num += 3")) The == operator has also been provided which returns true when two breakpoints have the same type, and the same value corresponding to the type.**/
12-
1328
typedef enum breakpoint_types {
1429
BT_MOVE_NUM,
1530
BT_TEMP_NUM,

vpr/src/draw/draw.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* As a note, looks into draw_global.c for understanding the data structures associated with drawing->
99
*
1010
* Contains all functions that didn't fit in any other draw_*.cpp file.
11-
* Authors: Vaughn Betz, Long Yu (Mike) Wang, Dingyu (Tina) Yang
12-
* Last updated: June 2019
11+
* Authors: Vaughn Betz, Long Yu (Mike) Wang, Dingyu (Tina) Yang, Sebastian Lievano
12+
* Last updated: August 2022
1313
*/
1414

1515
#include <cstdio>
@@ -672,7 +672,7 @@ void act_on_key_press(ezgl::application* app, GdkEventKey* /*event*/, char* key_
672672
std::string text(gtk_entry_get_text(GTK_ENTRY(searchBar)));
673673
t_draw_state* draw_state = get_draw_state_vars();
674674
if (gtk_widget_is_focus(searchBar)) {
675-
if (key == "Return") {
675+
if (key == "Return" || key == "Tab") {
676676
enable_autocomplete(app);
677677
gtk_editable_set_position(GTK_EDITABLE(searchBar), text.length());
678678
return;
@@ -683,6 +683,9 @@ void act_on_key_press(ezgl::application* app, GdkEventKey* /*event*/, char* key_
683683
} else {
684684
gtk_entry_set_completion(GTK_ENTRY(searchBar), nullptr);
685685
}
686+
if (key == "Escape") {
687+
deselect_all();
688+
}
686689
}
687690

688691
void act_on_mouse_press(ezgl::application* app, GdkEventButton* event, double x, double y) {

vpr/src/draw/draw.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/**
2+
* @file draw.h
3+
*
4+
* The main drawing file. Contains the setup for ezgl application, ui setup, and graphis functions
5+
*
6+
* This is VPR's main graphics application program. The program interacts with ezgl/graphics.hpp,
7+
* which provides an API for displaying graphics on both X11 and Win32. The most important
8+
* subroutine in this file is draw_main_canvas(), which is a callback function that will be called
9+
* whenever the screen needs to be updated. Then, draw_main_canvas() will decide what
10+
* drawing subroutines to call depending on whether PLACEMENT or ROUTING is shown on screen.
11+
* The initial_setup_X() functions link the menu button signals to the corresponding drawing functions.
12+
* As a note, looks into draw_global.c for understanding the data structures associated with drawing->
13+
*
14+
* Contains all functions that didn't fit in any other draw_*.cpp file.
15+
*
16+
* Authors: Vaughn Betz, Long Yu (Mike) Wang, Dingyu (Tina) Yang, Sebastian Lievano
17+
* Last updated: August 2022
18+
*/
19+
120
#ifndef DRAW_H
221
#define DRAW_H
322

0 commit comments

Comments
 (0)