mirror of
https://github.com/The-OpenROAD-Project/OpenLane.git
synced 2026-05-29 00:23:55 +08:00
Please excuse the last commit lacking a changelog. + PDK installation uses Volare, transparently to the user: all they have to do is type "make", where it will get OpenLane and the PDK + CI now uses Volare to either **get** or **build** the PDK (if not found), which speeds up the fastest test set by around 60%. + Added rudimentary dependency installation instructions. + pyyaml folded into the repo, so users without pip can still run issue surveys ~ Open PDKs updated: Parasitics are now extracted using a rules file based on [spef-extractor](https://github.com/Cloud-V/spef-extractor) as a ***temporary*** measure ~ Issue survey no longer checks for click and pyyaml: a venv is used in those scenarios. ~ OpenLane build no longer uses the host filesystem as an intermediary, instead using a templated dockerfile with an N-stage build for N tools, saving IO operations (40% improvement measured) ~ Old PDK targets renamed to build-pdk-conda, includes SRAM by default ~ Replaced python3 ./env.py issue-survey with `make survey` - Removed Fault from documentation (until I get the chance to work on it)
97 lines
3.6 KiB
Makefile
97 lines
3.6 KiB
Makefile
#DOCKER_BUILD_OPTS ?= --rm --no-cache
|
|
OPENLANE_IMAGE_NAME ?= efabless/openlane:current
|
|
TOOL_REPOSITORY ?= efabless/openlane-tools
|
|
|
|
OS_NAME ?= centos-7
|
|
OS_IMAGE ?= centos:centos7
|
|
|
|
DOCKER_BUILD_OPTS ?= --rm
|
|
DOCKER_BUILD_INVOCATION ?= docker build # docker buildx build --platform linux/amd64 --load
|
|
BUILD_COMMAND = $(DOCKER_BUILD_INVOCATION) $(DOCKER_BUILD_OPTS)
|
|
|
|
NO_PDKS_ARGS =
|
|
NO_PDKS ?= 1
|
|
ifeq ($(NO_PDKS), 1)
|
|
NO_PDKS_ARGS = --no-pdks
|
|
endif
|
|
|
|
PYTHON_BIN ?= python3
|
|
TOOLS = $(shell $(PYTHON_BIN) ../dependencies/tool.py --containerized $(NO_PDKS_ARGS) .)
|
|
OPENLANE_SKELETON=configuration dependencies designs regression_results scripts AUTHORS.md env.py flow.tcl LICENSE run_designs.py
|
|
TOOL_BUILD_TARGETS = $(foreach tool,$(TOOLS),build-$(tool))
|
|
TOOL_EXPORT_TARGETS = $(foreach tool,$(TOOLS),pull-$(tool))
|
|
|
|
|
|
# ==============================================================================
|
|
# Build Tools
|
|
# ==============================================================================
|
|
all: openlane
|
|
|
|
build-all: $(TOOL_BUILD_TARGETS)
|
|
build_base_image: ./build_base/Dockerfile
|
|
cat ../dependencies/centos-7/precompile_time.txt > ./build_base/yum_precompile_dependencies.txt
|
|
cat ../dependencies/centos-7/compile_time.txt > ./build_base/yum_compile_dependencies.txt
|
|
cat ../dependencies/centos-7/run_time.txt > ./build_base/yum_dependencies.txt
|
|
cat ../dependencies/python/precompile_time.txt > ./build_base/pip_precompile_dependencies.txt
|
|
cat ../dependencies/python/compile_time.txt > ./build_base/pip_compile_dependencies.txt
|
|
cat ../dependencies/python/run_time.txt > ./build_base/pip_dependencies.txt
|
|
mkdir -p logs
|
|
$(BUILD_COMMAND) -t openlane-build-base --build-arg OS_IMAGE=$(OS_IMAGE) build_base | tee logs/base.build.txt
|
|
|
|
run_base_image: ./run_base/Dockerfile
|
|
cat ../dependencies/python/run_time.txt > ./run_base/pip_dependencies.txt
|
|
cat ../dependencies/centos-7/precompile_time.txt > ./run_base/yum_repos.txt
|
|
cat ../dependencies/centos-7/run_time.txt > ./run_base/yum_dependencies.txt
|
|
mkdir -p logs
|
|
$(BUILD_COMMAND) -t openlane-run-base --build-arg OS_IMAGE=$(OS_IMAGE) run_base | tee logs/base.run.txt
|
|
|
|
|
|
$(TOOL_BUILD_TARGETS): build-% : ./%/Dockerfile build_base_image run_base_image
|
|
mkdir -p logs
|
|
cp ./utils.py $*
|
|
$(BUILD_COMMAND)\
|
|
$(shell $(PYTHON_BIN) ../dependencies/tool.py --docker-args $*)\
|
|
--target runnable\
|
|
-t $(TOOL_REPOSITORY):$(shell $(PYTHON_BIN) ../dependencies/tool.py --docker-tag-for-os=$(OS_NAME) $*)\
|
|
$* |\
|
|
tee logs/$*.build.txt
|
|
|
|
# ==============================================================================
|
|
# Export Tools
|
|
# ==============================================================================
|
|
$(TOOL_EXPORT_TARGETS): pull-% : FORCE
|
|
$(PYTHON_BIN) ./utils.py pull-if-doesnt-exist --repository $(TOOL_REPOSITORY) --os $(OS_NAME) $*
|
|
|
|
./tar/openlane: FORCE
|
|
rm -rf ./tar/openlane
|
|
mkdir -p ./tar/openlane
|
|
for file in $(OPENLANE_SKELETON); do \
|
|
cp -r ../$$file ./tar/openlane/$$file ; \
|
|
done
|
|
|
|
.PHONY: merge openlane
|
|
openlane: merge
|
|
merge: run_base_image $(TOOL_EXPORT_TARGETS) ./tar/openlane ../dependencies/tool_metadata.yml
|
|
cat ../dependencies/tool_metadata.yml > ./tar/tool_metadata.yml
|
|
printf "$(shell git rev-parse HEAD)" > ./tar/git_version
|
|
printf "$(shell git rev-parse --short=7 HEAD)" > ./tar/git_version_short
|
|
$(PYTHON_BIN) ./utils.py process-dockerfile-tpl --repository $(TOOL_REPOSITORY) --os $(OS_NAME) $(TOOLS) > ./openlane/Dockerfile
|
|
mkdir -p logs/tar
|
|
$(BUILD_COMMAND)\
|
|
-t $(OPENLANE_IMAGE_NAME)\
|
|
-f ./openlane/Dockerfile ./tar\
|
|
| tee logs/$<.build.txt
|
|
rm -rf ./tar/openlane
|
|
|
|
.PHONY: clean
|
|
clean: clean_export clean_merge
|
|
|
|
.PHONY: clean_merge
|
|
clean_merge:
|
|
rm -rf ./tar/openlane
|
|
|
|
.PHONY: clean_export
|
|
clean_export:
|
|
rm -rf export/*.tar.gz
|
|
|
|
FORCE: |