From 885ab13b20df7f2c33f357816da47276a79ebbf5 Mon Sep 17 00:00:00 2001 From: kareefardi Date: Tue, 22 Aug 2023 19:28:30 +0300 Subject: [PATCH] rename OPENLANE_* to OPENLANE2_ and resotre OPENLANE_TAG --- Makefile | 35 +++++++++++++++++++---------------- openlane/Makefile | 39 ++++++++++----------------------------- 2 files changed, 29 insertions(+), 45 deletions(-) diff --git a/Makefile b/Makefile index b66edbc4a..b830331b6 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,8 @@ export ROOTLESS ifeq ($(PDK),sky130A) SKYWATER_COMMIT=f70d8ca46961ff92719d8870a18a076370b85f6c export OPEN_PDKS_COMMIT?=78b7bc32ddb4b6f14f76883c2e2dc5b5de9d1cbc - export OPENLANE_TAG?=2.0.0-b8 + export OPENLANE_TAG=2023.07.19 + export OPENLANE2_TAG?=2.0.0-b8 MPW_TAG ?= mpw-9d ifeq ($(CARAVEL_LITE),1) @@ -60,7 +61,8 @@ endif ifeq ($(PDK),sky130B) SKYWATER_COMMIT=f70d8ca46961ff92719d8870a18a076370b85f6c export OPEN_PDKS_COMMIT?=78b7bc32ddb4b6f14f76883c2e2dc5b5de9d1cbc - export OPENLANE_TAG?=2.0.0-b8 + export OPENLANE_TAG=2023.07.19 + export OPENLANE2_TAG?=2.0.0-b8 MPW_TAG ?= mpw-9d ifeq ($(CARAVEL_LITE),1) @@ -82,14 +84,15 @@ ifeq ($(PDK),gf180mcuC) CARAVEL_REPO := https://github.com/efabless/caravel-gf180mcu CARAVEL_TAG := $(MPW_TAG) export OPEN_PDKS_COMMIT?=e6f9c8876da77220403014b116761b0b2d79aab4 - export OPENLANE_TAG?=2.0.0-b8 + export OPENLANE_TAG=2023.07.19 + export OPENLANE2_TAG?=2.0.0-b8 endif # Include Caravel Makefile Targets .PHONY: % : check-caravel %: - export CARAVEL_ROOT=$(CARAVEL_ROOT) && export PROJECT_ROOT=$(PROJECT_ROOT) && $(MAKE) -f $(CARAVEL_ROOT)/Makefile $@ + export CARAVEL_ROOT=$(CARAVEL_ROOT) && $(MAKE) -f $(CARAVEL_ROOT)/Makefile $@ .PHONY: install install: @@ -182,20 +185,20 @@ what: # Install Openlane .PHONY: openlane -openlane: openlane-venv +openlane: openlane2-venv openlane2-docker-container # openlane installed -OPENLANE_TAG_DOCKER=$(subst -,,$(OPENLANE_TAG)) -.PHONY: openlane-docker-container -openlane-docker-container: - docker pull ghcr.io/efabless/openlane2:$(OPENLANE_TAG_DOCKER) - -openlane-venv: $(PROJECT_ROOT)/openlane-venv/manifest.txt -$(PROJECT_ROOT)/openlane-venv/manifest.txt: - rm -rf openlane-venv - python3 -m venv $(PROJECT_ROOT)/openlane-venv - PYTHONPATH= $(PROJECT_ROOT)/openlane-venv/bin/python3 -m pip install openlane==$(OPENLANE_TAG) - PYTHONPATH= $(PROJECT_ROOT)/openlane-venv/bin/python3 -m pip freeze > $(PROJECT_ROOT)/openlane-venv/manifest.txt +OPENLANE2_TAG_DOCKER=$(subst -,,$(OPENLANE2_TAG)) +.PHONY: openlane2-docker-container +openlane2-docker-container: + docker pull ghcr.io/efabless/openlane2:$(OPENLANE2_TAG_DOCKER) + +openlane2-venv: $(PROJECT_ROOT)/openlane2-venv/manifest.txt +$(PROJECT_ROOT)/openlane2-venv/manifest.txt: + rm -rf openlane2-venv + python3 -m venv $(PROJECT_ROOT)/openlane2-venv + PYTHONPATH= $(PROJECT_ROOT)/openlane2-venv/bin/python3 -m pip install openlane==$(OPENLANE2_TAG) + PYTHONPATH= $(PROJECT_ROOT)/openlane2-venv/bin/python3 -m pip freeze > $(PROJECT_ROOT)/openlane2-venv/manifest.txt #### Not sure if the targets following are of any use diff --git a/openlane/Makefile b/openlane/Makefile index 224b752aa..8c7b364b4 100644 --- a/openlane/Makefile +++ b/openlane/Makefile @@ -17,15 +17,15 @@ MAKEFLAGS+=--warn-undefined-variables # set shell bash to the do while loop below SHELL := /usr/bin/env bash -export OPENLANE_RUN_TAG = $(shell date '+%y_%m_%d_%H_%M') +export OPENLANE2_RUN_TAG = $(shell date '+%y_%m_%d_%H_%M') export CARAVEL_ROOT:=$(CARAVEL_ROOT) export PDK:=$(PDK) export PDK_ROOT:=$(PDK_ROOT) -OPENLANE_TAG ?= 2023.07.19 -OPENLANE_IMAGE_NAME ?= efabless/openlane:$(OPENLANE_TAG) +OPENLANE2_TAG ?= 2023.07.19 +OPENLANE2_IMAGE_NAME ?= efabless/openlane:$(OPENLANE2_TAG) designs = $(shell cd $(PROJECT_ROOT)/openlane && find * -maxdepth 0 -type d) current_design = null -OPENLANE_USE_NIX ?= 0 +OPENLANE2_USE_NIX ?= 0 ROOTLESS ?= 0 USER_ARGS = -u $$(id -u $$USER):$$(id -g $$USER) ifeq ($(ROOTLESS), 1) @@ -33,7 +33,7 @@ ifeq ($(ROOTLESS), 1) endif openlane_args = \ - --run-tag $(OPENLANE_RUN_TAG) \ + --run-tag $(OPENLANE2_RUN_TAG) \ --manual-pdk \ --pdk-root $(PDK_ROOT) \ --pdk $(PDK) \ @@ -48,7 +48,7 @@ docker_env = \ -e PDK_ROOT=$(PDK_ROOT) \ -e PDK=$(PDK) \ -e CARAVEL_ROOT=$(CARAVEL_ROOT) \ - -e OPENLANE_RUN_TAG=$(OPENLANE_RUN_TAG) + -e OPENLANE2_RUN_TAG=$(OPENLANE2_RUN_TAG) ifneq ($(MCW_ROOT),) docker_env += -e MCW_ROOT=$(MCW_ROOT) @@ -71,16 +71,16 @@ list: $(designs) : export current_design=$@ $(designs) : % : $(PROJECT_ROOT)/openlane/%/config.json # $(current_design) - @rm -rf $(PROJECT_ROOT)/openlane/$*/runs/$(OPENLANE_RUN_TAG) -ifeq ($(OPENLANE_USE_NIX),1) + @rm -rf $(PROJECT_ROOT)/openlane/$*/runs/$(OPENLANE2_RUN_TAG) +ifeq ($(OPENLANE2_USE_NIX),1) nix-shell --pure --command "openlane $(openlane_args) $(openlane_extra_args)" else $(PROJECT_ROOT)/openlane-venv/bin/python3 -m openlane $(docker_mounts) --dockerized $(openlane_args) $(openlane_extra_args) endif @rm -rf $(PROJECT_ROOT)/openlane/$*/runs/$* - @ln -s $$(realpath $(PROJECT_ROOT)/openlane/$*/runs/$(OPENLANE_RUN_TAG)) $(PROJECT_ROOT)/openlane/$*/runs/$* + @ln -s $$(realpath $(PROJECT_ROOT)/openlane/$*/runs/$(OPENLANE2_RUN_TAG)) $(PROJECT_ROOT)/openlane/$*/runs/$* @mkdir -p $(PROJECT_ROOT)/signoff/$*/ - @echo $(OPENLANE_TAG) > $(PROJECT_ROOT)/signoff/$*/OPENLANE_VERSION + @echo $(OPENLANE2_TAG) > $(PROJECT_ROOT)/signoff/$*/OPENLANE_VERSION @cp $(PDK_ROOT)/$(PDK)/SOURCES $(PROJECT_ROOT)/signoff/$*/PDK_SOURCES @cp $(PROJECT_ROOT)/openlane/$*/runs/$*/final/*.csv $(PROJECT_ROOT)/signoff/$*/ @cp $(PROJECT_ROOT)/openlane/$*/runs/$*/final/def/* $(PROJECT_ROOT)/def/$*.def @@ -104,22 +104,3 @@ endif mkdir -p $$target_dir; \ cp $$file $$target_dir/$*.sdf; \ done < <(find $(PROJECT_ROOT)/openlane/$*/runs/$*/final/sdf -type 'f' -print0) - -.PHONY: openlane -openlane: check-openlane-env - if [ -d "$(OPENLANE_ROOT)" ]; then\ - echo "Deleting exisiting $(OPENLANE_ROOT)" && \ - rm -rf $(OPENLANE_ROOT) && sleep 2; \ - fi - git clone https://github.com/The-OpenROAD-Project/OpenLane -b $(OPENLANE_TAG) --depth=1 $(OPENLANE_ROOT) && \ - cd $(OPENLANE_ROOT) && \ - export OPENLANE_IMAGE_NAME=efabless/openlane:$(OPENLANE_TAG) && \ - export IMAGE_NAME=efabless/openlane:$(OPENLANE_TAG) && \ - $(MAKE) pull-openlane - -.PHONY: check-openlane-env -check-openlane-env: -ifeq ($(OPENLANE_ROOT),) - @echo "Please export OPENLANE_ROOT" - @exit 1 -endif