caravel/openlane/Makefile

118 lines
3.6 KiB
Makefile
Raw Normal View History

# SPDX-FileCopyrightText: 2020 Efabless Corporation
2022-02-25 12:47:04 -06:00
# 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')
2022-10-11 12:15:41 -05:00
OPENLANE_TAG ?= 2022.10.10
OPENLANE_IMAGE_NAME ?= efabless/openlane:$(OPENLANE_TAG)
IT_SCRIPT ?= ./interactive.tcl
designs = $(shell find * -maxdepth 0 -type d)
current_design = null
openlane_cmd = \
"flow.tcl \
-design $$(realpath ./$*) \
-save_path $$(realpath ..) \
-save \
-OPENLANE_RUN_TAG $(OPENLAN_RUN_TAG) \
-verbose 1 \
-overwrite"
openlane_cmd_interactive = "flow.tcl -ignore_mismatches -it -file $$(realpath ./$*/$(IT_SCRIPT))"
openlane_cmd_regression = "cd /openlane && ./run_designs.py \
--regression $$(realpath ./$*/regression.config) \
--threads 6 \
$$(realpath ./$*)"
docker_mounts = \
-v $$(realpath $(PWD)/..):$$(realpath $(PWD)/..) \
-v $(PDK_ROOT):$(PDK_ROOT) \
-v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \
-v $(PWD):$(PWD) \
-v $(HOME):$(HOME)
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) \
-w $(PWD)
ifneq ($(OPENLANE_ROOT),)
$(info openlane $(OPENLANE_ROOT))
docker_mounts += -v $(OPENLANE_ROOT):/openlane
docker_mounts += -v $(OPENLANE_ROOT):/openLANE_flow
endif
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)
regression-designs=$(designs:%=%-regression)
.PHONY: $(regression-designs)
$(regression-designs): %-regression: ./%/regression.config
$(docker_run) \
$(OPENLANE_IMAGE_NAME) sh -c $(openlane_cmd_regression)
.PHONY: $(designs)
$(designs) : % : ./%/config.tcl
ifneq (,$(wildcard ./$(MAKECMDGOALS)/interactive.tcl)))
$(docker_run) \
$(OPENLANE_IMAGE_NAME) sh -c $(openlane_cmd_interactive)
else
# $(MAKECMDGOALS)
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_RUN_TAG)/OPENLANE_VERSION ../signoff/$*/
@cp ./$*/runs/$(OPENLANE_RUN_TAG)/PDK_SOURCES ../signoff/$*/
@cp ./$*/runs/$(OPENLANE_RUN_TAG)/reports/*.csv ../signoff/$*/
.PHONY: openlane
- change litex tag to mpw-5c - warn before deleting when rerunning these targets: install_mcw openlane pdk - clone litex with depth=1 and single branch - simplified pdk targets by removing these targets: skywater-timing build-pdk skywater-library - add clean-pdk and clean-openlane - add make prerequisites in pdk (not sure if that's needed) - run openlane docker non interactive - export OPENLANE_IMAGE_NAME when running openlane docker - add check-openlane-env target Squashed commit of the following: commit b7904e08ae649116ae8af5808b5acbf66e300625 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 13:32:36 2022 -0800 typo commit 8507bcf1eef959e3e11ec872fcbcd38681511f42 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:51:42 2022 -0800 undo tag for testing commit 12114e08d2b27f839d6862138df8d533a6868897 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:50:41 2022 -0800 typo commit 1a15d4646a2ea429b403aaa1f51d03404fd5acbf Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:47:26 2022 -0800 fix folder not found check commit addf24a8b67a4c1d7295bc97c4f61201dd265032 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:03:31 2022 -0800 remove export path and ls that were for testing commit 91a305f365560524454b6582ab547aaa4b25b697 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:57:39 2022 -0800 typo commit 00c249db5cdd493281574371e0d7fb3d97d039ca Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:50:28 2022 -0800 - use tag for MCW_BRANCH - non phony install_mcw - clone with depth 1 commit ba14b7a6aa6b6d0ec07c3e34728f1e4a7826ba82 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:39:59 2022 -0800 the return of non phony commit f5657bbabf98b68c37e6f87c6a6b6c9758180168 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 05:04:51 2022 -0800 revert commit ids of openpdks, magic and openlane (we are going to set them in caravel_user_project) commit 0fc8c4dacdf213bfc96e3a692c45ab0581fe1ebe Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 04:46:37 2022 -0800 gen-source for sky130B commit c875a7b05897a3f2e825d968ee28cca743d0e515 Merge: 801b3dc ff403f5 Author: kareem <kareem.farid@efabless.com> Date: Wed Feb 23 14:16:25 2022 -0800 Merge remote-tracking branch 'upstream/main' into makefile commit 801b3dc28d7dddb3dd6f4b2938b3fdc5ea6ddc63 Author: kareem <kareem.farid@efabless.com> Date: Wed Feb 23 14:15:25 2022 -0800 also update openlane, magic, openpdks commit id commit 47091c6fba57a7faa4cc726b3eadd472a8a9bcf7 Author: kareem <kareem.farid@efabless.com> Date: Tue Feb 22 13:35:07 2022 -0800 more changes commit 67a49b0aa26fce7197216cf251c981854ef0a39c Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 17 11:56:56 2022 -0800 WIP actual usage of make targets
2022-02-25 12:39:11 -06:00
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 --branch=$(OPENLANE_TAG) --depth=1 $(OPENLANE_ROOT) && \
cd $(OPENLANE_ROOT) && \
- change litex tag to mpw-5c - warn before deleting when rerunning these targets: install_mcw openlane pdk - clone litex with depth=1 and single branch - simplified pdk targets by removing these targets: skywater-timing build-pdk skywater-library - add clean-pdk and clean-openlane - add make prerequisites in pdk (not sure if that's needed) - run openlane docker non interactive - export OPENLANE_IMAGE_NAME when running openlane docker - add check-openlane-env target Squashed commit of the following: commit b7904e08ae649116ae8af5808b5acbf66e300625 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 13:32:36 2022 -0800 typo commit 8507bcf1eef959e3e11ec872fcbcd38681511f42 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:51:42 2022 -0800 undo tag for testing commit 12114e08d2b27f839d6862138df8d533a6868897 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:50:41 2022 -0800 typo commit 1a15d4646a2ea429b403aaa1f51d03404fd5acbf Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:47:26 2022 -0800 fix folder not found check commit addf24a8b67a4c1d7295bc97c4f61201dd265032 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:03:31 2022 -0800 remove export path and ls that were for testing commit 91a305f365560524454b6582ab547aaa4b25b697 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:57:39 2022 -0800 typo commit 00c249db5cdd493281574371e0d7fb3d97d039ca Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:50:28 2022 -0800 - use tag for MCW_BRANCH - non phony install_mcw - clone with depth 1 commit ba14b7a6aa6b6d0ec07c3e34728f1e4a7826ba82 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:39:59 2022 -0800 the return of non phony commit f5657bbabf98b68c37e6f87c6a6b6c9758180168 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 05:04:51 2022 -0800 revert commit ids of openpdks, magic and openlane (we are going to set them in caravel_user_project) commit 0fc8c4dacdf213bfc96e3a692c45ab0581fe1ebe Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 04:46:37 2022 -0800 gen-source for sky130B commit c875a7b05897a3f2e825d968ee28cca743d0e515 Merge: 801b3dc ff403f5 Author: kareem <kareem.farid@efabless.com> Date: Wed Feb 23 14:16:25 2022 -0800 Merge remote-tracking branch 'upstream/main' into makefile commit 801b3dc28d7dddb3dd6f4b2938b3fdc5ea6ddc63 Author: kareem <kareem.farid@efabless.com> Date: Wed Feb 23 14:15:25 2022 -0800 also update openlane, magic, openpdks commit id commit 47091c6fba57a7faa4cc726b3eadd472a8a9bcf7 Author: kareem <kareem.farid@efabless.com> Date: Tue Feb 22 13:35:07 2022 -0800 more changes commit 67a49b0aa26fce7197216cf251c981854ef0a39c Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 17 11:56:56 2022 -0800 WIP actual usage of make targets
2022-02-25 12:39:11 -06:00
export OPENLANE_IMAGE_NAME=efabless/openlane:$(OPENLANE_TAG) && \
export IMAGE_NAME=efabless/openlane:$(OPENLANE_TAG) && \
$(MAKE) pull-openlane
- change litex tag to mpw-5c - warn before deleting when rerunning these targets: install_mcw openlane pdk - clone litex with depth=1 and single branch - simplified pdk targets by removing these targets: skywater-timing build-pdk skywater-library - add clean-pdk and clean-openlane - add make prerequisites in pdk (not sure if that's needed) - run openlane docker non interactive - export OPENLANE_IMAGE_NAME when running openlane docker - add check-openlane-env target Squashed commit of the following: commit b7904e08ae649116ae8af5808b5acbf66e300625 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 13:32:36 2022 -0800 typo commit 8507bcf1eef959e3e11ec872fcbcd38681511f42 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:51:42 2022 -0800 undo tag for testing commit 12114e08d2b27f839d6862138df8d533a6868897 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:50:41 2022 -0800 typo commit 1a15d4646a2ea429b403aaa1f51d03404fd5acbf Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:47:26 2022 -0800 fix folder not found check commit addf24a8b67a4c1d7295bc97c4f61201dd265032 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 11:03:31 2022 -0800 remove export path and ls that were for testing commit 91a305f365560524454b6582ab547aaa4b25b697 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:57:39 2022 -0800 typo commit 00c249db5cdd493281574371e0d7fb3d97d039ca Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:50:28 2022 -0800 - use tag for MCW_BRANCH - non phony install_mcw - clone with depth 1 commit ba14b7a6aa6b6d0ec07c3e34728f1e4a7826ba82 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 10:39:59 2022 -0800 the return of non phony commit f5657bbabf98b68c37e6f87c6a6b6c9758180168 Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 05:04:51 2022 -0800 revert commit ids of openpdks, magic and openlane (we are going to set them in caravel_user_project) commit 0fc8c4dacdf213bfc96e3a692c45ab0581fe1ebe Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 24 04:46:37 2022 -0800 gen-source for sky130B commit c875a7b05897a3f2e825d968ee28cca743d0e515 Merge: 801b3dc ff403f5 Author: kareem <kareem.farid@efabless.com> Date: Wed Feb 23 14:16:25 2022 -0800 Merge remote-tracking branch 'upstream/main' into makefile commit 801b3dc28d7dddb3dd6f4b2938b3fdc5ea6ddc63 Author: kareem <kareem.farid@efabless.com> Date: Wed Feb 23 14:15:25 2022 -0800 also update openlane, magic, openpdks commit id commit 47091c6fba57a7faa4cc726b3eadd472a8a9bcf7 Author: kareem <kareem.farid@efabless.com> Date: Tue Feb 22 13:35:07 2022 -0800 more changes commit 67a49b0aa26fce7197216cf251c981854ef0a39c Author: kareem <kareem.farid@efabless.com> Date: Thu Feb 17 11:56:56 2022 -0800 WIP actual usage of make targets
2022-02-25 12:39:11 -06:00
.PHONY: check-openlane-env
check-openlane-env:
ifeq ($(OPENLANE_ROOT),)
@echo "Please export OPENLANE_ROOT"
@exit 1
endif