From ce8f884a5fad00bfcff05251bd11cdd7ce9d9a38 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 17 Dec 2023 17:24:25 +0200 Subject: [PATCH] added open-gui command --- Makefile | 12 ++++++++++++ docs/source/index.rst | 16 ++++++++++++++++ openlane/Makefile | 21 +++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/Makefile b/Makefile index 5ca0d1e6d..98ec8ee50 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,18 @@ blocks=$(shell cd openlane && find * -maxdepth 0 -type d) $(blocks): % : check_versions $(MAKE) -C openlane $* +# Openlane open last step gui using klayout +blocks=$(shell cd openlane && find * -maxdepth 0 -type d) +.PHONY: open-gui-% +open-gui-% : + $(MAKE) -C openlane open-gui-$* + +# Openlane open last step gui using openroad +blocks=$(shell cd openlane && find * -maxdepth 0 -type d) +.PHONY: open-odb-gui-% +open-odb-gui-% : + $(MAKE) -C openlane open-odb-gui-$* + .PHONY: clean_log clean_log: @rm -f setup.log diff --git a/docs/source/index.rst b/docs/source/index.rst index e27638240..400302666 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -116,6 +116,22 @@ Starting your project .. For an example of hardening a project please refer to `Hardening the User Project using OpenLane`_. . + + * In case a failure happens, view the last generated layout before failure: + - Last generated def file using klayout: + + .. code:: bash + + make open-gui- + .. + + - Last generated odb file using openroad-gui: + + .. code:: bash + + make open-odb-gui- + .. + #. Integrate modules into the user_project_wrapper diff --git a/openlane/Makefile b/openlane/Makefile index d2a52864c..dc72ba52e 100644 --- a/openlane/Makefile +++ b/openlane/Makefile @@ -37,6 +37,9 @@ openlane_cmd = \ -ignore_mismatches" openlane_cmd_interactive = "flow.tcl -it -file $$(realpath ./$*/interactive.tcl)" +openlane_gui_klayout_cmd = "python3 $(OPENLANE_ROOT)/gui.py --viewer klayout --format def $$(realpath ./$*/runs/$*)" +openlane_gui_openroad_cmd = "python3 $(OPENLANE_ROOT)/gui.py --viewer openroad --format odb $$(realpath ./$*/runs/$*)" + docker_mounts = \ -v $$(realpath $(PWD)/..):$$(realpath $(PWD)/..) \ -v $(PDK_ROOT):$(PDK_ROOT) \ @@ -50,6 +53,13 @@ docker_env = \ -e CARAVEL_ROOT=$(CARAVEL_ROOT) \ -e OPENLANE_RUN_TAG=$(OPENLANE_RUN_TAG) +docker_extra_args = \ + -e DISPLAY=$(DISPLAY) \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -v $(HOME)/.Xauthority:/.Xauthority \ + --network host \ + --security-opt seccomp=unconfined + ifneq ($(MCW_ROOT),) docker_env += -e MCW_ROOT=$(MCW_ROOT) docker_mounts += -v $(MCW_ROOT):$(MCW_ROOT) @@ -102,3 +112,14 @@ ifeq ($(OPENLANE_ROOT),) @echo "Please export OPENLANE_ROOT" @exit 1 endif + +.PHONY: open-gui-% +open-gui-%: + $(docker_run) $(docker_extra_args) \ + $(OPENLANE_IMAGE_NAME) sh -c $(openlane_gui_klayout_cmd) + +.PHONY: open-odb-gui-% +open-odb-gui-%: + $(docker_run) $(docker_extra_args) \ + $(OPENLANE_IMAGE_NAME) sh -c $(openlane_gui_openroad_cmd) +