update openlane makefile - remove symlink to caravel's openlane makefile - add `openlane/Makefile` - mantain history of openlane runs
diff --git a/Makefile b/Makefile index 54ec2a8..a9d1752 100644 --- a/Makefile +++ b/Makefile
@@ -15,7 +15,7 @@ # SPDX-License-Identifier: Apache-2.0 MAKEFLAGS+=--warn-undefined-variables -CARAVEL_ROOT?=$(PWD)/caravel +export CARAVEL_ROOT?=$(PWD)/caravel PRECHECK_ROOT?=${HOME}/mpw_precheck MCW_ROOT?=$(PWD)/mgmt_core_wrapper SIM?=RTL @@ -65,20 +65,14 @@ simenv: docker pull efabless/dv_setup:latest -# this is a tmp workaround -# [WARN] please remove in the future -.PHONY: tmp-workaround -tmp-workaround: - @sed 's%final_summary_report%*%' $(CARAVEL_ROOT)/openlane/Makefile -i - .PHONY: setup -setup: install check-env install_mcw openlane pdk-with-volare tmp-workaround +setup: install check-env install_mcw openlane pdk-with-volare # Openlane blocks=$(shell cd openlane && find * -maxdepth 0 -type d) .PHONY: $(blocks) $(blocks): % : - export CARAVEL_ROOT=$(CARAVEL_ROOT) && cd openlane && $(MAKE) $* + $(MAKE) -C openlane $* dv_patterns=$(shell cd verilog/dv && find * -maxdepth 0 -type d) dv-targets-rtl=$(dv_patterns:%=verify-%-rtl)
diff --git a/openlane/Makefile b/openlane/Makefile deleted file mode 120000 index 48e5b4a..0000000 --- a/openlane/Makefile +++ /dev/null
@@ -1 +0,0 @@ -../caravel/openlane/Makefile \ No newline at end of file
diff --git a/openlane/Makefile b/openlane/Makefile new file mode 100644 index 0000000..f6d3c93 --- /dev/null +++ b/openlane/Makefile
@@ -0,0 +1,79 @@ +# SPDX-FileCopyrightText: 2020 Efabless Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +MAKEFLAGS+=--warn-undefined-variables + +export OPENLANE_RUN_TAG = $(shell date '+%y_%m_%d_%H_%M') +OPENLANE_TAG ?= 2021.11.23_01.42.34 +OPENLANE_IMAGE_NAME ?= efabless/openlane:$(OPENLANE_TAG) +designs = $(shell find * -maxdepth 0 -type d) +current_design = null + +openlane_cmd = \ + "flow.tcl \ + -design $$(realpath ./$*) \ + -save_path $$(realpath ..) \ + -save \ + -tag $(OPENLANE_RUN_TAG) \ + -overwrite" +openlane_cmd_interactive = "flow.tcl -it -file $$(realpath ./$*/interactive.tcl)" + +docker_mounts = \ + -v $$(realpath $(PWD)/..):$$(realpath $(PWD)/..) \ + -v $(PDK_ROOT):$(PDK_ROOT) \ + -v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \ + -v $(OPENLANE_ROOT):/openlane + +docker_env = \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e PDK=$(PDK) \ + -e MISMATCHES_OK=1 \ + -e CARAVEL_ROOT=$(CARAVEL_ROOT) \ + -e OPENLANE_RUN_TAG=$(OPENLANE_RUN_TAG) + +ifneq ($(MCW_ROOT),) +docker_env += -e MCW_ROOT=$(MCW_ROOT) +docker_mounts += -v $(MCW_ROOT):$(MCW_ROOT) +endif + +docker_startup_mode = $(shell test -t 0 && echo "-it" || echo "--rm" ) +docker_run = \ + docker run $(docker_startup_mode) \ + $(docker_mounts) \ + $(docker_env) \ + -u $(shell id -u $(USER)):$(shell id -g $(USER)) + +list: + @echo $(designs) + +.PHONY: $(designs) +$(designs) : export current_design=$@ +$(designs) : % : ./%/config.tcl +ifneq (,$(wildcard ./$(current_design)/interactive.tcl)) + $(docker_run) \ + $(OPENLANE_IMAGE_NAME) sh -c $(openlane_cmd_interactive) +else + # $(current_design) + mkdir -p ./$*/runs/$(OPENLANE_RUN_TAG) + rm -rf ./$*/runs/$* + ln -s $$(realpath ./$*/runs/$(OPENLANE_RUN_TAG)) ./$*/runs/$* + $(docker_run) \ + $(OPENLANE_IMAGE_NAME) sh -c $(openlane_cmd) +endif + @mkdir -p ../signoff/$*/ + @cp ./$*/runs/$*/OPENLANE_VERSION ../signoff/$*/ + @cp ./$*/runs/$*/PDK_SOURCES ../signoff/$*/ + @cp ./$*/runs/$*/reports/*.csv ../signoff/$*/ +