Skip to content

Commit b8b12da

Browse files
committed
makefile: add GUI_ARGS and GUI_SOURCE env vars
These are used to execute a script upon startup and possibly exit immediately. Previously "echo report_checks | make open_synth" was used, but the problem here is that if the command fails, then the error isn't and shouldn't be propagated to the user as open_synth is a REPL loop that should not propagate the exit code for a failed command, the app should continue to run. Example uses: make GUI_ARGS=-exit GUI_SOURCE=blah.tcl open_final make GUI_ARGS=-exit GUI_SOURCE=blah.tcl open_synth Signed-off-by: Øyvind Harboe <[email protected]>
1 parent a40a953 commit b8b12da

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

docs/user/FlowVariables.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ Note:
144144
| `IO_PLACER_H` | The metal layer on which to place the I/O pins horizontally (top and bottom of the die). |
145145
| `IO_PLACER_V` | The metal layer on which to place the I/O pins vertically (sides of the die). |
146146
| `GUI_NO_TIMING` | Skip loading timing for a faster GUI load. |
147+
| `GUI_SOURCE` | Source the script. |
148+
| `GUI_ARGS` | OpenROAD command line options for gui_ and open_ targets, typically set tup `-exit` in combination with GUI_SOURCE to run a script and exit. |
147149

148150

149151
### Placement

flow/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ endef
584584
define OPEN_GUI
585585
.PHONY: $(1)_$(2)
586586
$(1)_$(2):
587-
$(3)=$(RESULTS_DIR)/$(2) $(4) $(SCRIPTS_DIR)/gui.tcl
587+
$(3)=$(RESULTS_DIR)/$(2) $(4) $(GUI_ARGS) $(SCRIPTS_DIR)/gui.tcl
588588
endef
589589

590590
# Separate dependency checking and doing a step. This can
@@ -1056,10 +1056,10 @@ $(foreach file,$(RESULTS_DEF) $(RESULTS_GDS) $(RESULTS_OAS),klayout_$(file)): kl
10561056

10571057
.PHONY: gui_synth
10581058
gui_synth:
1059-
$(OPENROAD_GUI_CMD) $(SCRIPTS_DIR)/sta-synth.tcl
1059+
$(OPENROAD_GUI_CMD) $(GUI_ARGS) $(SCRIPTS_DIR)/sta-synth.tcl
10601060
.PHONY: open_synth
10611061
open_synth:
1062-
$(OPENROAD_NO_EXIT_CMD) $(SCRIPTS_DIR)/sta-synth.tcl
1062+
$(OPENROAD_NO_EXIT_CMD) $(GUI_ARGS) $(SCRIPTS_DIR)/sta-synth.tcl
10631063

10641064
$(eval $(call OPEN_GUI_SHORTCUT,floorplan,2_floorplan.odb))
10651065
$(eval $(call OPEN_GUI_SHORTCUT,place,3_place.odb))

flow/scripts/gui.tcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,7 @@ if {![info exist ::env(GUI_NO_TIMING)]} {
6666
# Cleanup temporary variables
6767
unset sdc_file s design_stage
6868
}
69+
70+
if {[info exist env(GUI_SOURCE)]} {
71+
source $::env(GUI_SOURCE)
72+
}

flow/scripts/sta-synth.tcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
source $::env(SCRIPTS_DIR)/load.tcl
22
load_design 1_synth.v 1_synth.sdc
3+
4+
if {[info exist env(GUI_SOURCE)]} {
5+
source $::env(GUI_SOURCE)
6+
}

0 commit comments

Comments
 (0)