Skip to content

scripts: SAVE_IMAGES_VIEWER picks the viewer for the final images - #4718

Draft
jorge-ferreira-pii wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:issue11488-orfs-1-save-images-viewer
Draft

jorge-ferreira-pii wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:issue11488-orfs-1-save-images-viewer

Conversation

@jorge-ferreira-pii

@jorge-ferreira-pii jorge-ferreira-pii commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

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>
@jorge-ferreira-pii jorge-ferreira-pii self-assigned this Oct 22, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +4 to +10
if { [gui::has_ui] } {
set web_flag {}
set ext webp
} else {
set web_flag -web
set ext png
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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} {}
    }
  }
}

@openroad-ci

openroad-ci commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch.

Commit e40a880 · Jenkins build #2 · Baseline: build · View build on dashboard

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>
@jorge-ferreira-pii
jorge-ferreira-pii marked this pull request as draft October 23, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants