diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md
index 4d44b0b25b..88eead1765 100644
--- a/docs/user/FlowVariables.md
+++ b/docs/user/FlowVariables.md
@@ -272,6 +272,7 @@ configuration file.
| RTLMP_WIRELENGTH_WT| Weight for half-perimiter wirelength.| 100.0|
| RUN_LOG_NAME_STEM| Stem of the log file name, the log file will be named `$(LOG_DIR)/$(RUN_LOG_NAME_STEM).log`.| run|
| RUN_SCRIPT| Path to script to run from `make run`, python or tcl script detected by .py or .tcl extension.| |
+| SAVE_IMAGES_VIEWER| Which viewer draws the images of the final report: qt for the Qt GUI in an offscreen window, or web for the web viewer, which needs no display. OpenROAD built without Qt always uses the web viewer.| qt|
| SC_LEF| Path to technology standard cell LEF file.| |
| SDC_FILE| The path to design constraint (SDC) file.| |
| SEAL_GDS| Seal macro to place around the design.| |
@@ -624,6 +625,7 @@ configuration file.
- [REPORT_CLOCK_SKEW](#REPORT_CLOCK_SKEW)
- [REPORT_ENDPOINT_SLACK](#REPORT_ENDPOINT_SLACK)
- [ROUTING_LAYER_ADJUSTMENT](#ROUTING_LAYER_ADJUSTMENT)
+- [SAVE_IMAGES_VIEWER](#SAVE_IMAGES_VIEWER)
- [SEC_CHECK](#SEC_CHECK)
- [SKIP_DETAILED_ROUTE](#SKIP_DETAILED_ROUTE)
- [SKIP_REPORT_METRICS](#SKIP_REPORT_METRICS)
diff --git a/flow/designs/nangate45/gcd/config.mk b/flow/designs/nangate45/gcd/config.mk
index 76cca1b8bc..9f9051a566 100644
--- a/flow/designs/nangate45/gcd/config.mk
+++ b/flow/designs/nangate45/gcd/config.mk
@@ -14,5 +14,8 @@ export TNS_END_PERCENT = 100
export GPL_PLACE_IOS = 1
export SYNTH_REPEATABLE_BUILD ?= 1
+# CI runs the non-default image viewer on this design.
+export SAVE_IMAGES_VIEWER ?= web
+
# This needs a smaller pitch to accomodate a small block
export PDN_TCL ?= $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NAME)/grid_strategy-M1-M4-M7.tcl
diff --git a/flow/scripts/final_outputs.tcl b/flow/scripts/final_outputs.tcl
index 520b9d0374..daca878dbc 100644
--- a/flow/scripts/final_outputs.tcl
+++ b/flow/scripts/final_outputs.tcl
@@ -70,7 +70,14 @@ report_metrics 6 "finish"
source_step_tcl POST FINAL_REPORT
-# Save a final image if openroad is compiled with the gui
-if { [ord::openroad_gui_compiled] } {
+# Save the final images: in a Qt window already open, in an offscreen one, or
+# with the web viewer, which OpenROAD built without Qt always uses.
+set images_viewer $::env(SAVE_IMAGES_VIEWER)
+if { $images_viewer ni {qt web} } {
+ utl::error FLW 34 "SAVE_IMAGES_VIEWER must be qt or web, not $images_viewer."
+}
+if { $images_viewer eq "web" || ![ord::openroad_gui_compiled] || [gui::has_ui] } {
+ source $::env(SCRIPTS_DIR)/save_images.tcl
+} else {
gui::show "source $::env(SCRIPTS_DIR)/save_images.tcl" false
}
diff --git a/flow/scripts/save_images.tcl b/flow/scripts/save_images.tcl
index 2f6c06d17b..e1505016c5 100644
--- a/flow/scripts/save_images.tcl
+++ b/flow/scripts/save_images.tcl
@@ -1,5 +1,14 @@
source $::env(SCRIPTS_DIR)/util.tcl
+# With no Qt window up, the web viewer draws the images; it writes only PNG.
+if { [gui::has_ui] } {
+ set web_flag {}
+ set ext webp
+} else {
+ set web_flag -web
+ set ext png
+}
+
gui::save_display_controls
set height [[[ord::get_db_block] getBBox] getDY]
@@ -30,22 +39,22 @@ gui::set_display_controls "Misc/Highlight selected" visible true
gui::set_display_controls "Misc/Detailed view" visible true
# The routing view
-save_image -resolution $resolution $::env(REPORTS_DIR)/final_all.webp
+save_image {*}$web_flag -resolution $resolution $::env(REPORTS_DIR)/final_all.$ext
gui::set_display_controls "Nets/Power" visible false
gui::set_display_controls "Nets/Ground" visible false
-save_image -resolution $resolution $::env(REPORTS_DIR)/final_routing.webp
+save_image {*}$web_flag -resolution $resolution $::env(REPORTS_DIR)/final_routing.$ext
# The placement view without routing
gui::set_display_controls "Shape Types/Routing/*" visible false
gui::set_display_controls "Instances/Physical/Fill cell" visible false
gui::set_display_controls "Misc/Instances/*" visible false
-save_image -resolution $resolution $::env(REPORTS_DIR)/final_placement.webp
+save_image {*}$web_flag -resolution $resolution $::env(REPORTS_DIR)/final_placement.$ext
if { [env_var_exists_and_non_empty PWR_NETS_VOLTAGES] } {
gui::set_display_controls "Heat Maps/IR Drop" visible true
gui::set_heatmap IRDrop Layer $::env(IR_DROP_LAYER)
gui::set_heatmap IRDrop ShowLegend 1
- save_image -resolution $resolution $::env(REPORTS_DIR)/final_ir_drop.webp
+ save_image {*}$web_flag -resolution $resolution $::env(REPORTS_DIR)/final_ir_drop.$ext
gui::set_display_controls "Heat Maps/IR Drop" visible false
}
@@ -58,7 +67,7 @@ gui::set_display_controls "Instances/StdCells/Clock tree/*" visible true
gui::set_display_controls "Instances/StdCells/Sequential" visible true
gui::set_display_controls "Instances/Macro" visible true
select -name "clk*" -type Inst
-save_image -resolution $resolution $::env(REPORTS_DIR)/final_clocks.webp
+save_image {*}$web_flag -resolution $resolution $::env(REPORTS_DIR)/final_clocks.$ext
gui::clear_selections
gui::show_widget "Clock Tree Viewer"
@@ -70,10 +79,10 @@ foreach scene [get_scenes] {
save_clocktree_image -clock $clock_name \
-width 1024 -height 1024 \
-scene $scene \
- $::env(REPORTS_DIR)/cts_${scene_name}_${clock_name}.webp
+ $::env(REPORTS_DIR)/cts_${scene_name}_${clock_name}.$ext
gui::select_clockviewer_clock $clock_name
- save_image -resolution $resolution \
- $::env(REPORTS_DIR)/cts_${scene_name}_${clock_name}_layout.webp
+ save_image {*}$web_flag -resolution $resolution \
+ $::env(REPORTS_DIR)/cts_${scene_name}_${clock_name}_layout.$ext
}
}
}
@@ -98,7 +107,7 @@ select -name "wire*" -type Inst -highlight 3
select -name "rebuffer*" -type Inst -highlight 4 ;# red
select -name "split*" -type Inst -highlight 5 ;# dark green
-save_image -resolution $resolution $::env(REPORTS_DIR)/final_resizer.webp
+save_image {*}$web_flag -resolution $resolution $::env(REPORTS_DIR)/final_resizer.$ext
gui::clear_highlights -1
gui::clear_selections
@@ -109,7 +118,7 @@ gui::set_display_controls "Instances/Physical/*" visible false
gui::set_display_controls "Nets/*" visible false
gui::set_display_controls "Heat Maps/Routing Congestion" visible true
-save_image -resolution $resolution $::env(REPORTS_DIR)/final_congestion.webp
+save_image {*}$web_flag -resolution $resolution $::env(REPORTS_DIR)/final_congestion.$ext
# The worst timing path view
gui::set_display_controls "Heat Maps/Routing Congestion" visible false
@@ -119,7 +128,7 @@ gui::set_display_controls "Instances/*" visible true
gui::set_display_controls "Shape Types/Routing/*" visible false
gui::show_worst_path
-save_image -resolution $resolution $::env(REPORTS_DIR)/final_worst_path.webp
+save_image {*}$web_flag -resolution $resolution $::env(REPORTS_DIR)/final_worst_path.$ext
gui::set_display_controls "Timing Path/*" visible false
gui::restore_display_controls
diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json
index cb678fa68e..d20b25e5ca 100644
--- a/flow/scripts/variables.json
+++ b/flow/scripts/variables.json
@@ -1124,6 +1124,13 @@
"RUN_SCRIPT": {
"description": "Path to script to run from `make run`, python or tcl script detected by .py or .tcl extension.\n"
},
+ "SAVE_IMAGES_VIEWER": {
+ "default": "qt",
+ "description": "Which viewer draws the images of the final report: qt for the Qt GUI in an offscreen window, or web for the web viewer, which needs no display. OpenROAD built without Qt always uses the web viewer.\n",
+ "stages": [
+ "final"
+ ]
+ },
"SC_LEF": {
"description": "Path to technology standard cell LEF file.\n"
},
diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml
index 62a5bcf355..4190b7b073 100644
--- a/flow/scripts/variables.yaml
+++ b/flow/scripts/variables.yaml
@@ -602,6 +602,14 @@ GUI_TIMING:
quite time consuming. Useful to disable when investigating non-timing
aspects like floorplan, placement, routing, etc.
default: 1
+SAVE_IMAGES_VIEWER:
+ description: >
+ Which viewer draws the images of the final report: qt for the Qt GUI in
+ an offscreen window, or web for the web viewer, which needs no display.
+ OpenROAD built without Qt always uses the web viewer.
+ default: qt
+ stages:
+ - final
FILL_CELLS:
description: >
Fill cells are used to fill empty sites. If not set or empty, fill cell