Skip to content

Commit 3ef09be

Browse files
authored
Merge pull request #3249 from verilog-to-routing/final_graphics_clean_up
Final graphics clean up
2 parents baaac60 + b581c63 commit 3ef09be

18 files changed

+253
-161
lines changed

doc/src/Images/Net_Settings.png

13 KB
Loading

doc/src/Images/Routing_Options.png

-445 KB
Loading
53.7 KB
Loading

doc/src/Images/show_nets.gif

493 KB
Loading

doc/src/Images/show_rr_graph.gif

845 KB
Loading

doc/src/vpr/graphics.rst

Lines changed: 61 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,36 @@ If the **Placement Macros** drop down is set, any placement macros (e.g. carry c
6767

6868
Placement with macros (carry chains) highlighted
6969

70-
Visualizing Netlist Connectivity
71-
--------------------------------
72-
The **Toggle Nets** drop-down list under the **Net Settings** tab toggles the nets in the circuit to be visible/invisible. Options include **Cluster Nets** and **Primitive Nets**.
70+
Visualizing Nets
71+
----------------
72+
To visualize nets, first enable the **Display Nets** switch under the **Net** Tab.
73+
74+
The user can choose between drawing nets as **Flylines** (direct connections between sources and sinks) or as **Routing** (the actual routed path of the net).
75+
Only the **Flylines** option is available during placement, as routing has not yet been performed.
76+
77+
The Inter-Cluster Nets and Intra-Cluster Nets options allow the user to choose whether to visualize nets between clbs or within a clb, respectively. The Intra-Cluster Routed Nets option is currently only available when **flat routing is enabled**.
7378

7479
.. figure:: ../Images/Net_Settings.png
7580
:align: center
76-
:height: 200
7781

78-
Toggle Nets drop-down under Net Settings tab
82+
Net Tab
7983

80-
When a placement is being displayed, routing information is not yet known so nets are simply drawn as a “star;” that is, a straight line is drawn from the net source to each of its sinks.
81-
Click on any clb in the display, and it will be highlighted in green, while its fanin and fanout are highlighted in blue and red, respectively.
82-
Once a circuit has been routed the true path of each net will be shown.
84+
If routing is shown, clicking on a pin or channel wire whill highlight the whole net in magenta.
85+
Multiple nets can be highlighted by pressing ctrl + mouse click.
8386

84-
.. figure:: https://www.verilogtorouting.org/img/des90_nets.gif
87+
.. figure:: ../Images/show_nets.gif
8588
:align: center
8689

87-
Logical net connectivity during placement
90+
Visualizing Nets
8891

89-
If the nets routing are shown, click on a clb or pad to highlight its fanins and fanouts, or click on a pin or channel wire to highlight a whole net in magenta.
90-
Multiple nets can be highlighted by pressing ctrl + mouse click.
92+
When the **Highlight Block Fan-in and Fan-out** option is enabled, clicking on an internal block will draw its fan-in, fan-out, and internal flylines in blue, red, and yellow, respectively.
93+
94+
.. figure:: ../Images/highlight_flylines.png
95+
:align: center
96+
97+
Highlight Block Fan-in and Fan-out Flylines
98+
99+
Clicking on a clb (not the internal physical blocks) will also highlight all the fan-in and fan-out routed nets in blue and red, respectively.
91100

92101
Visualizing the Critical Path
93102
-----------------------------
@@ -113,33 +122,60 @@ The **Crit. Path** drop-down will toggle through the various visualizations:
113122
Visualizing Routing Architecture
114123
--------------------------------
115124

116-
When a routing is on screen, the **Routing Options** tab provides various options to gain more visual information.
125+
During the route stage, the **Route** tab provides various options to visualize router resources and statistics.
117126

118127
.. figure:: ../Images/Routing_Options.png
119128
:align: center
120129
:height: 300
121130

122131
Routing Options
123132

124-
Clicking on **Toggle RR** lets you to choose between various views of the routing resources available in the FPGA.
133+
To visualize routing architecture, first enable the **Display Routing Resources** switch under the Route tab. Then, click on the checkboxes below to show/hide the types of nodes and edges you want to visualize.
125134

126-
.. figure:: https://github.com/verilog-to-routing/verilog-to-routing.github.io/raw/master/img/routing_arch.gif
127-
:align: center
135+
The intra-cluster options are currently only available when **flat routing is enabled**.
136+
137+
The **Highlight Fan-In Fan-Out Edges** option will highlight the fan-in and fan-out edges of the selected routing resource in blue and red, respectively.
128138

129-
Routing Architecture Views
139+
Multiple routing resources can be highlighted by pressing ctrl + mouse click.
140+
141+
.. figure:: ../Images/show_rr_graph.gif
142+
:align: center
130143

131-
The routing resource view can be very useful in ensuring that you have correctly described your FPGA in the architecture description file -- if you see switches where they shouldn’t be or pins on the wrong side of a clb, your architecture description needs to be revised.
144+
Visualizing Routing Architecture
145+
146+
**Node Colors**:
147+
148+
+------------+--------+
149+
| Node Type | Color |
150+
+============+========+
151+
| Channel | Black |
152+
+------------+--------+
153+
| Input Pin | Purple |
154+
+------------+--------+
155+
| Output Pin | Pink |
156+
+------------+--------+
157+
158+
**Edge Colors**:
159+
160+
+-----------------------+---------------+
161+
| Edge Type | Color |
162+
+=======================+===============+
163+
| Pin to Output Pin | Light Pink |
164+
+-----------------------+---------------+
165+
| Pin to Input Pin | Medium Purple |
166+
+-----------------------+---------------+
167+
| Output Pin to Channel | Pink |
168+
+-----------------------+---------------+
169+
| Channel to Input Pin | Purple |
170+
+-----------------------+---------------+
171+
| Channel to Channel | Dark Green |
172+
+-----------------------+---------------+
173+
| Non-Configurable Edge | Dark Grey |
174+
+-----------------------+---------------+
132175

133-
Wiring segments are drawn in black, input pins are drawn in sky blue, and output pins are drawn in pink.
134-
Sinks are drawn in dark slate blue, and sources in plum.
135-
Direct connections between output and input pins are shown in medium purple.
136-
Connections from wiring segments to input pins are shown in sky blue, connections from output pins to wiring segments are shown in pink, and connections between wiring segments are shown in green.
137176
The points at which wiring segments connect to clb pins (connection box switches) are marked with an ``x``.
138177

139178
Switch box connections will have buffers (triangles) or pass transistors (circles) drawn on top of them, depending on the type of switch each connection uses.
140-
Clicking on a clb or pad will overlay the routing of all nets connected to that block on top of the drawing of the FPGA routing resources, and will label each of the pins on that block with its pin number.
141-
Clicking on a routing resource will highlight it in magenta, and its fanouts will be highlighted in red and fanins in blue.
142-
Multiple routing resources can be highlighted by pressing ctrl + mouse click.
143179

144180
Visualizing Routing Congestion
145181
------------------------------

vpr/main.ui

Lines changed: 96 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@
349349
<property name="name">test</property>
350350
<property name="can-focus">False</property>
351351
<child>
352-
<!-- n-columns=1 n-rows=6 -->
352+
<!-- n-columns=1 n-rows=4 -->
353353
<object class="GtkGrid" id="ControlGrid">
354354
<property name="visible">True</property>
355355
<property name="can-focus">False</property>
@@ -405,33 +405,6 @@
405405
<property name="top-attach">3</property>
406406
</packing>
407407
</child>
408-
<child>
409-
<object class="GtkLabel" id="CritPathLabel">
410-
<property name="visible">True</property>
411-
<property name="can-focus">False</property>
412-
<property name="label" translatable="yes">Critical Path</property>
413-
</object>
414-
<packing>
415-
<property name="left-attach">0</property>
416-
<property name="top-attach">4</property>
417-
</packing>
418-
</child>
419-
<child>
420-
<object class="GtkComboBoxText" id="ToggleCritPath">
421-
<property name="visible">True</property>
422-
<property name="can-focus">False</property>
423-
<property name="active">0</property>
424-
<items>
425-
<item translatable="yes">None</item>
426-
<item translatable="yes">Crit Path Flylines</item>
427-
<item translatable="yes">Crit Path Flylines Delays</item>
428-
</items>
429-
</object>
430-
<packing>
431-
<property name="left-attach">0</property>
432-
<property name="top-attach">5</property>
433-
</packing>
434-
</child>
435408
</object>
436409
</child>
437410
</object>
@@ -598,6 +571,101 @@
598571
<property name="position">8</property>
599572
</packing>
600573
</child>
574+
575+
<child>
576+
<object class="GtkSeparator">
577+
<property name="visible">True</property>
578+
<property name="can-focus">False</property>
579+
</object>
580+
<packing>
581+
<property name="expand">False</property>
582+
<property name="fill">True</property>
583+
<property name="position">9</property>
584+
</packing>
585+
</child>
586+
<child>
587+
<object class="GtkBox">
588+
<property name="visible">True</property>
589+
<property name="can-focus">False</property>
590+
<property name="margin-top">5</property>
591+
<property name="margin-bottom">5</property>
592+
<child>
593+
<object class="GtkLabel">
594+
<property name="visible">True</property>
595+
<property name="can-focus">False</property>
596+
<property name="label" translatable="yes">Display Critical Path</property>
597+
</object>
598+
<packing>
599+
<property name="expand">False</property>
600+
<property name="fill">True</property>
601+
<property name="position">0</property>
602+
</packing>
603+
</child>
604+
<child>
605+
<object class="GtkSwitch" id="ToggleCritPath">
606+
<property name="visible">True</property>
607+
<property name="can-focus">True</property>
608+
<property name="halign">end</property>
609+
<property name="hexpand">True</property>
610+
</object>
611+
<packing>
612+
<property name="expand">False</property>
613+
<property name="fill">True</property>
614+
<property name="position">1</property>
615+
</packing>
616+
</child>
617+
</object>
618+
<packing>
619+
<property name="expand">False</property>
620+
<property name="fill">True</property>
621+
<property name="position">10</property>
622+
</packing>
623+
</child>
624+
<child>
625+
<object class="GtkCheckButton" id="ToggleCritPathFlylines">
626+
<property name="label" translatable="yes">Critical Path Flylines</property>
627+
<property name="visible">True</property>
628+
<property name="sensitive">False</property>
629+
<property name="can-focus">True</property>
630+
<property name="receives-default">False</property>
631+
<property name="draw-indicator">True</property>
632+
</object>
633+
<packing>
634+
<property name="expand">False</property>
635+
<property name="fill">True</property>
636+
<property name="position">11</property>
637+
</packing>
638+
</child>
639+
<child>
640+
<object class="GtkCheckButton" id="ToggleCritPathRouting">
641+
<property name="label" translatable="yes">Critical Path Routing</property>
642+
<property name="visible">True</property>
643+
<property name="sensitive">False</property>
644+
<property name="can-focus">True</property>
645+
<property name="receives-default">False</property>
646+
<property name="draw-indicator">True</property>
647+
</object>
648+
<packing>
649+
<property name="expand">False</property>
650+
<property name="fill">True</property>
651+
<property name="position">12</property>
652+
</packing>
653+
</child>
654+
<child>
655+
<object class="GtkCheckButton" id="ToggleCritPathDelays">
656+
<property name="label" translatable="yes">Critical Path Delays</property>
657+
<property name="visible">True</property>
658+
<property name="sensitive">False</property>
659+
<property name="can-focus">True</property>
660+
<property name="receives-default">False</property>
661+
<property name="draw-indicator">True</property>
662+
</object>
663+
<packing>
664+
<property name="expand">False</property>
665+
<property name="fill">True</property>
666+
<property name="position">13</property>
667+
</packing>
668+
</child>
601669
</object>
602670
</child>
603671
</object>

vpr/src/base/vpr_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ RouteStatus vpr_route_flow(const Netlist<>& net_list,
10251025

10261026
//Update status
10271027
VTR_LOG("Circuit successfully routed with a channel width factor of %d.\n", route_status.chan_width());
1028-
graphics_msg = vtr::string_fmt("Routing succeeded with a channel width factor of %d.\n", route_status.chan_width());
1028+
graphics_msg = vtr::string_fmt("Routing succeeded with a channel width factor of %d.", route_status.chan_width());
10291029
} else {
10301030
//Update status
10311031
VTR_LOG("Circuit is unroutable with a channel width factor of %d.\n", route_status.chan_width());

vpr/src/draw/draw.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ static void on_stage_change_setup(ezgl::application* app, bool is_new_window) {
271271
hide_crit_path_routing(app);
272272

273273
hide_draw_routing(app);
274+
275+
app->update_message(draw_state->default_message);
276+
app->refresh_drawing();
277+
app->flush_drawing();
274278
}
275279

276280
#endif //NO_GRAPHICS
@@ -283,16 +287,20 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
283287
* continue. Saves the pic_on_screen_val to allow pan and zoom redraws. */
284288
t_draw_state* draw_state = get_draw_state_vars();
285289

290+
strcpy(draw_state->default_message, msg);
291+
286292
if (!draw_state->show_graphics)
287293
ezgl::set_disable_event_loop(true);
288294
else
289295
ezgl::set_disable_event_loop(false);
290296

291-
ezgl::setup_callback_fn init_setup = nullptr;
297+
bool state_change = false;
292298

293299
/* If it's the type of picture displayed has changed, set up the proper *
294300
* buttons. */
295301
if (draw_state->pic_on_screen != pic_on_screen_val) { //State changed
302+
303+
state_change = true;
296304

297305
if (draw_state->pic_on_screen == NO_PICTURE) {
298306
// Only add the canvas the first time we open graphics
@@ -302,10 +310,9 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
302310

303311
draw_state->setup_timing_info = setup_timing_info;
304312
draw_state->pic_on_screen = pic_on_screen_val;
305-
init_setup = on_stage_change_setup;
306313
}
307314

308-
bool state_change = (init_setup != nullptr);
315+
309316
bool should_pause = int(priority) >= draw_state->gr_automode;
310317

311318
//If there was a state change, we must call ezgl::application::run() to update the buttons.
@@ -324,20 +331,14 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
324331
draw_state->forced_pause = false; //Reset pause flag
325332
}
326333

327-
application.run(init_setup, act_on_mouse_press, act_on_mouse_move,
334+
application.run(on_stage_change_setup, act_on_mouse_press, act_on_mouse_move,
328335
act_on_key_press);
329336

330337
if (!draw_state->graphics_commands.empty()) {
331338
run_graphics_commands(draw_state->graphics_commands);
332339
}
333340
}
334341

335-
if (draw_state->show_graphics) {
336-
application.update_message(msg);
337-
application.refresh_drawing();
338-
application.flush_drawing();
339-
}
340-
341342
if (draw_state->save_graphics) {
342343
std::string extension = "pdf";
343344
save_graphics(extension, draw_state->save_graphics_file_base);
@@ -353,8 +354,10 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
353354

354355
#ifndef NO_GRAPHICS
355356
void toggle_window_mode(GtkWidget* /*widget*/,
356-
ezgl::application* /*app*/) {
357+
ezgl::application* app) {
357358
window_mode = true;
359+
app->update_message("Zoom to Selection: Click on two points to define a rectangle to zoom into.");
360+
app->refresh_drawing();
358361
}
359362

360363
#endif // NO_GRAPHICS
@@ -606,6 +609,8 @@ void act_on_mouse_press(ezgl::application* app, GdkEventButton* event, double x,
606609
//reset flags
607610
window_mode = false;
608611
window_point_1_collected = false;
612+
app->update_message(get_draw_state_vars()->default_message);
613+
app->refresh_drawing();
609614
}
610615
app->refresh_drawing();
611616
} else {
@@ -1142,8 +1147,10 @@ static void run_graphics_commands(const std::string& commands) {
11421147
VTR_LOG("%d\n", (int)draw_state->draw_nets);
11431148
} else if (cmd[0] == "set_cpd") {
11441149
VTR_ASSERT_MSG(cmd.size() == 2,
1145-
"Expect cpd draw state after 'set_cpd'");
1146-
draw_state->show_crit_path = (e_draw_crit_path)vtr::atoi(cmd[1]);
1150+
"Expect show critical path delay (bool), show critical path flylines (bool), and show critical path routing (bool) after 'set_cpd'");
1151+
draw_state->show_crit_path = true;
1152+
draw_state->show_crit_path_flylines = true;
1153+
draw_state->show_crit_path_delays= (bool)vtr::atoi(cmd[1]);
11471154
VTR_LOG("%d\n", (int)draw_state->show_crit_path);
11481155
} else if (cmd[0] == "set_routing_util") {
11491156
VTR_ASSERT_MSG(cmd.size() == 2,

0 commit comments

Comments
 (0)