Skip to content
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
Binary file modified doc/src/Images/Net_Settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/src/Images/Routing_Options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/src/Images/highlight_flylines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/src/Images/show_nets.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/src/Images/show_rr_graph.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 61 additions & 25 deletions doc/src/vpr/graphics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,36 @@ If the **Placement Macros** drop down is set, any placement macros (e.g. carry c

Placement with macros (carry chains) highlighted

Visualizing Netlist Connectivity
--------------------------------
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**.
Visualizing Nets
----------------
To visualize nets, first enable the **Display Nets** switch under the **Net** Tab.

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).
Only the **Flylines** option is available during placement, as routing has not yet been performed.

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**.

.. figure:: ../Images/Net_Settings.png
:align: center
:height: 200

Toggle Nets drop-down under Net Settings tab
Net Tab

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.
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.
Once a circuit has been routed the true path of each net will be shown.
If routing is shown, clicking on a pin or channel wire whill highlight the whole net in magenta.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whill -> will

Multiple nets can be highlighted by pressing ctrl + mouse click.

.. figure:: https://www.verilogtorouting.org/img/des90_nets.gif
.. figure:: ../Images/show_nets.gif
:align: center

Logical net connectivity during placement
Visualizing Nets

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.
Multiple nets can be highlighted by pressing ctrl + mouse click.
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.

.. figure:: ../Images/highlight_flylines.png
:align: center

Highlight Block Fan-in and Fan-out Flylines

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.

Visualizing the Critical Path
-----------------------------
Expand All @@ -113,33 +122,60 @@ The **Crit. Path** drop-down will toggle through the various visualizations:
Visualizing Routing Architecture
--------------------------------

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

.. figure:: ../Images/Routing_Options.png
:align: center
:height: 300

Routing Options

Clicking on **Toggle RR** lets you to choose between various views of the routing resources available in the FPGA.
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.

.. figure:: https://github.com/verilog-to-routing/verilog-to-routing.github.io/raw/master/img/routing_arch.gif
:align: center
The intra-cluster options are currently only available when **flat routing is enabled**.

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.

Routing Architecture Views
Multiple routing resources can be highlighted by pressing ctrl + mouse click.

.. figure:: ../Images/show_rr_graph.gif
:align: center

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.
Visualizing Routing Architecture

**Node Colors**:

+------------+--------+
| Node Type | Color |
+============+========+
| Channel | Black |
+------------+--------+
| Input Pin | Purple |
+------------+--------+
| Output Pin | Pink |
+------------+--------+

**Edge Colors**:

+-----------------------+---------------+
| Edge Type | Color |
+=======================+===============+
| Pin to Output Pin | Light Pink |
+-----------------------+---------------+
| Pin to Input Pin | Medium Purple |
+-----------------------+---------------+
| Output Pin to Channel | Pink |
+-----------------------+---------------+
| Channel to Input Pin | Purple |
+-----------------------+---------------+
| Channel to Channel | Dark Green |
+-----------------------+---------------+
| Non-Configurable Edge | Dark Grey |
+-----------------------+---------------+

Wiring segments are drawn in black, input pins are drawn in sky blue, and output pins are drawn in pink.
Sinks are drawn in dark slate blue, and sources in plum.
Direct connections between output and input pins are shown in medium purple.
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.
The points at which wiring segments connect to clb pins (connection box switches) are marked with an ``x``.

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.
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.
Clicking on a routing resource will highlight it in magenta, and its fanouts will be highlighted in red and fanins in blue.
Multiple routing resources can be highlighted by pressing ctrl + mouse click.

Visualizing Routing Congestion
------------------------------
Expand Down
124 changes: 96 additions & 28 deletions vpr/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
<property name="name">test</property>
<property name="can-focus">False</property>
<child>
<!-- n-columns=1 n-rows=6 -->
<!-- n-columns=1 n-rows=4 -->
<object class="GtkGrid" id="ControlGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
Expand Down Expand Up @@ -405,33 +405,6 @@
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="CritPathLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Critical Path</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="ToggleCritPath">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="active">0</property>
<items>
<item translatable="yes">None</item>
<item translatable="yes">Crit Path Flylines</item>
<item translatable="yes">Crit Path Flylines Delays</item>
</items>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
</object>
</child>
</object>
Expand Down Expand Up @@ -598,6 +571,101 @@
<property name="position">8</property>
</packing>
</child>

<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">9</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Display Critical Path</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="ToggleCritPath">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">10</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ToggleCritPathFlylines">
<property name="label" translatable="yes">Critical Path Flylines</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">11</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ToggleCritPathRouting">
<property name="label" translatable="yes">Critical Path Routing</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">12</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ToggleCritPathDelays">
<property name="label" translatable="yes">Critical Path Delays</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="draw-indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">13</property>
</packing>
</child>
</object>
</child>
</object>
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/vpr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ RouteStatus vpr_route_flow(const Netlist<>& net_list,

//Update status
VTR_LOG("Circuit successfully routed with a channel width factor of %d.\n", route_status.chan_width());
graphics_msg = vtr::string_fmt("Routing succeeded with a channel width factor of %d.\n", route_status.chan_width());
graphics_msg = vtr::string_fmt("Routing succeeded with a channel width factor of %d.", route_status.chan_width());
} else {
//Update status
VTR_LOG("Circuit is unroutable with a channel width factor of %d.\n", route_status.chan_width());
Expand Down
33 changes: 20 additions & 13 deletions vpr/src/draw/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ static void on_stage_change_setup(ezgl::application* app, bool is_new_window) {
hide_crit_path_routing(app);

hide_draw_routing(app);

app->update_message(draw_state->default_message);
app->refresh_drawing();
app->flush_drawing();
}

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

strcpy(draw_state->default_message, msg);

if (!draw_state->show_graphics)
ezgl::set_disable_event_loop(true);
else
ezgl::set_disable_event_loop(false);

ezgl::setup_callback_fn init_setup = nullptr;
bool state_change = false;

/* If it's the type of picture displayed has changed, set up the proper *
* buttons. */
if (draw_state->pic_on_screen != pic_on_screen_val) { //State changed

state_change = true;

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

draw_state->setup_timing_info = setup_timing_info;
draw_state->pic_on_screen = pic_on_screen_val;
init_setup = on_stage_change_setup;
}

bool state_change = (init_setup != nullptr);

bool should_pause = int(priority) >= draw_state->gr_automode;

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

application.run(init_setup, act_on_mouse_press, act_on_mouse_move,
application.run(on_stage_change_setup, act_on_mouse_press, act_on_mouse_move,
act_on_key_press);

if (!draw_state->graphics_commands.empty()) {
run_graphics_commands(draw_state->graphics_commands);
}
}

if (draw_state->show_graphics) {
application.update_message(msg);
application.refresh_drawing();
application.flush_drawing();
}

if (draw_state->save_graphics) {
std::string extension = "pdf";
save_graphics(extension, draw_state->save_graphics_file_base);
Expand All @@ -353,8 +354,10 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type

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

#endif // NO_GRAPHICS
Expand Down Expand Up @@ -606,6 +609,8 @@ void act_on_mouse_press(ezgl::application* app, GdkEventButton* event, double x,
//reset flags
window_mode = false;
window_point_1_collected = false;
app->update_message(get_draw_state_vars()->default_message);
app->refresh_drawing();
}
app->refresh_drawing();
} else {
Expand Down Expand Up @@ -1142,8 +1147,10 @@ static void run_graphics_commands(const std::string& commands) {
VTR_LOG("%d\n", (int)draw_state->draw_nets);
} else if (cmd[0] == "set_cpd") {
VTR_ASSERT_MSG(cmd.size() == 2,
"Expect cpd draw state after 'set_cpd'");
draw_state->show_crit_path = (e_draw_crit_path)vtr::atoi(cmd[1]);
"Expect show critical path delay (bool), show critical path flylines (bool), and show critical path routing (bool) after 'set_cpd'");
draw_state->show_crit_path = true;
draw_state->show_crit_path_flylines = true;
draw_state->show_crit_path_delays= (bool)vtr::atoi(cmd[1]);
VTR_LOG("%d\n", (int)draw_state->show_crit_path);
} else if (cmd[0] == "set_routing_util") {
VTR_ASSERT_MSG(cmd.size() == 2,
Expand Down
Loading