Repository navigation
scripts: SAVE_IMAGES_VIEWER picks the viewer for the final images - #4718
jorge-ferreira-pii wants to merge 2 commits into
Conversation
qt, the default, keeps the Qt GUI; web, or an OpenROAD built without Qt, saves them with the web viewer. Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request introduces the SAVE_IMAGES_VIEWER configuration variable, allowing users to choose between the Qt GUI or the web viewer for drawing final report images. The scripts are updated to dynamically set the image format (PNG for web, WebP for Qt) and use the appropriate viewer. However, a critical issue was identified in save_images.tcl where calling gui::has_ui and other GUI-specific commands directly will cause Tcl errors and crash the flow if OpenROAD is compiled without GUI support. It is recommended to check if the GUI is compiled first and safely stub the missing GUI and widget commands when running without a UI.
| if { [gui::has_ui] } { | ||
| set web_flag {} | ||
| set ext webp | ||
| } else { | ||
| set web_flag -web | ||
| set ext png | ||
| } |
There was a problem hiding this comment.
When OpenROAD is compiled without GUI support ([ord::openroad_gui_compiled] is false), the gui namespace and its commands (like gui::has_ui) do not exist. Calling [gui::has_ui] directly will cause a Tcl error and crash the flow. Additionally, other GUI/Widget-specific commands like get_scenes, save_clocktree_image, and various gui:: commands will be missing and cause crashes.\n\nTo prevent this, we should check [ord::openroad_gui_compiled] first and safely stub the missing GUI and widget commands when running without a UI.
set has_ui 0
if { [ord::openroad_gui_compiled] } {
if { [gui::has_ui] } {
set has_ui 1
}
}
if { $has_ui } {
set web_flag {}
set ext webp
} else {
set web_flag -web
set ext png
# Stub GUI/Widget commands that are not available without UI
if { [info commands save_image] eq "" } {
proc save_image {args} {}
}
if { [info commands get_scenes] eq "" } {
proc get_scenes {} { return {} }
}
if { [info commands save_clocktree_image] eq "" } {
proc save_clocktree_image {args} {}
}
if { ![namespace exists ::gui] } {
namespace eval ::gui {}
}
foreach cmd {
save_display_controls restore_display_controls set_display_controls
clear_highlights clear_selections fit show_worst_path set_heatmap
show_widget hide_widget select_clockviewer_clock select_marker_category
} {
if { [info commands ::gui::$cmd] eq "" } {
proc ::gui::$cmd {args} {}
}
}
}
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
It has a default, so it is always set; nangate45/gcd runs the web viewer so CI covers the non-default one. Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
Part of #11488 in OpenROAD. Needs OpenROAD PRs #11942, #11943, #11944, #11945, #11946, #11947, #11948, #11949 and #11950.
New variable SAVE_IMAGES_VIEWER: qt, the default, or web. With web, or with an OpenROAD build without Qt, the final report images are saved with the web viewer as PNG. With Qt, nothing changes. When a Qt window is already open, the images are saved in it.