2021-11-15 07:50:43 -06:00
|
|
|
# SPDX-FileCopyrightText: 2020 Efabless Corporation
|
2022-02-25 12:39:11 -06:00
|
|
|
# # Licensed under the Apache License, Version 2.0 (the "License");
|
2021-11-15 07:50:43 -06:00
|
|
|
# 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
|
|
|
|
|
|
|
|
BLOCKS = $(shell find * -maxdepth 0 -type d)
|
|
|
|
CONFIG = $(foreach block,$(BLOCKS), ./$(block)/config.tcl)
|
|
|
|
CLEAN = $(foreach block,$(BLOCKS), clean-$(block))
|
|
|
|
|
2021-11-25 04:54:22 -06:00
|
|
|
OPENLANE_TAG ?= 2021.11.23_01.42.34
|
2021-11-15 07:50:43 -06:00
|
|
|
OPENLANE_IMAGE_NAME ?= efabless/openlane:$(OPENLANE_TAG)
|
2021-11-22 15:07:13 -06:00
|
|
|
OPENLANE_BASIC_COMMAND = "cd $(PWD)/../openlane && flow.tcl -design ./$* -save_path .. -save -tag $* -overwrite"
|
|
|
|
OPENLANE_INTERACTIVE_COMMAND = "cd $(PWD)/../openlane && flow.tcl -it -file ./$*/interactive.tcl"
|
2021-11-15 07:50:43 -06:00
|
|
|
|
|
|
|
all: $(BLOCKS)
|
|
|
|
|
|
|
|
$(CONFIG) :
|
|
|
|
@echo "Missing $@. Please create a configuration for that design"
|
|
|
|
@exit 1
|
|
|
|
|
2022-02-25 12:39:11 -06:00
|
|
|
.PHONY: $(BLOCKS)
|
|
|
|
$(BLOCKS) : % : ./%/config.tcl
|
2021-11-15 07:50:43 -06:00
|
|
|
ifeq ($(OPENLANE_ROOT),)
|
|
|
|
@echo "Please export OPENLANE_ROOT"
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
ifeq ($(PDK_ROOT),)
|
|
|
|
@echo "Please export PDK_ROOT"
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
@echo "###############################################"
|
|
|
|
@sleep 1
|
|
|
|
|
|
|
|
@if [ -f ./$*/interactive.tcl ]; then\
|
2022-02-25 12:39:11 -06:00
|
|
|
docker run --rm -v $(OPENLANE_ROOT):/openlane \
|
2021-11-15 07:50:43 -06:00
|
|
|
-v $(PDK_ROOT):$(PDK_ROOT) \
|
2021-11-22 15:07:13 -06:00
|
|
|
-v $(PWD)/..:$(PWD)/.. \
|
2021-11-15 07:50:43 -06:00
|
|
|
-v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \
|
2021-11-22 15:07:13 -06:00
|
|
|
-v $(MGMT_AREA_ROOT):$(MGMT_AREA_ROOT) \
|
2021-11-15 07:50:43 -06:00
|
|
|
-e PDK_ROOT=$(PDK_ROOT) \
|
|
|
|
-e CARAVEL_ROOT=$(CARAVEL_ROOT) \
|
|
|
|
-u $(shell id -u $(USER)):$(shell id -g $(USER)) \
|
|
|
|
$(OPENLANE_IMAGE_NAME) sh -c $(OPENLANE_INTERACTIVE_COMMAND);\
|
|
|
|
else\
|
2022-02-25 12:39:11 -06:00
|
|
|
docker run --rm -v $(OPENLANE_ROOT):/openlane \
|
2021-11-15 07:50:43 -06:00
|
|
|
-v $(PDK_ROOT):$(PDK_ROOT) \
|
2021-11-22 15:07:13 -06:00
|
|
|
-v $(PWD)/..:$(PWD)/.. \
|
2021-11-15 07:50:43 -06:00
|
|
|
-v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \
|
2021-11-22 15:07:13 -06:00
|
|
|
-v $(MGMT_AREA_ROOT):$(MGMT_AREA_ROOT) \
|
2021-11-15 07:50:43 -06:00
|
|
|
-e PDK_ROOT=$(PDK_ROOT) \
|
|
|
|
-e CARAVEL_ROOT=$(CARAVEL_ROOT) \
|
|
|
|
-u $(shell id -u $(USER)):$(shell id -g $(USER)) \
|
|
|
|
$(OPENLANE_IMAGE_NAME) sh -c $(OPENLANE_BASIC_COMMAND);\
|
|
|
|
fi
|
|
|
|
mkdir -p ../signoff/$*/
|
|
|
|
cp $*/runs/$*/OPENLANE_VERSION ../signoff/$*/
|
|
|
|
cp $*/runs/$*/PDK_SOURCES ../signoff/$*/
|
|
|
|
cp $*/runs/$*/reports/final_summary_report.csv ../signoff/$*/
|
|
|
|
|
|
|
|
.PHONY: openlane
|
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
|
2021-11-15 07:50:43 -06:00
|
|
|
git clone https://github.com/The-OpenROAD-Project/OpenLane --branch=$(OPENLANE_TAG) --depth=1 $(OPENLANE_ROOT) && \
|
|
|
|
cd $(OPENLANE_ROOT) && \
|
2022-02-25 12:39:11 -06:00
|
|
|
export OPENLANE_IMAGE_NAME=efabless/openlane:$(OPENLANE_TAG) && \
|
2021-11-15 07:50:43 -06:00
|
|
|
export IMAGE_NAME=efabless/openlane:$(OPENLANE_TAG) && \
|
2022-02-03 12:10:53 -06:00
|
|
|
$(MAKE) pull-openlane
|
2021-11-15 07:50:43 -06:00
|
|
|
|
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
|
|
|
|
|
2021-11-15 07:50:43 -06:00
|
|
|
FORCE:
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Use clean_all to clean everything :)"
|
|
|
|
|
|
|
|
clean_all: $(CLEAN)
|
|
|
|
|
|
|
|
$(CLEAN): clean-% :
|
|
|
|
rm -rf runs/$*
|
|
|
|
rm -rf ../gds/$**
|
|
|
|
rm -rf ../mag/$**
|
|
|
|
rm -rf ../lef/$**
|