Remove PDK build targets from Makefile

- pdk can now only be fetched with volare -- users who want to build their own PDK should know what they're doing
- volare, rst_include now share a venv
- venv no longer needlessly recreated every single time volare is installed
- venv added to gitignore
- check-python reimplemented
This commit is contained in:
Mohamed Gaber 2025-02-07 19:34:47 +02:00
parent 27cbe49c90
commit e9201f6877
No known key found for this signature in database
3 changed files with 43 additions and 95 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/mgmt_core_wrapper/* /mgmt_core_wrapper/*
gds/*.gds gds/*.gds
/venv

135
Makefile
View File

@ -1267,90 +1267,47 @@ endif
########################################################################### ###########################################################################
.PHONY: pdk pdk-with-sram
pdk-with-sram: pdk
pdk: check-env pdk-with-volare
.PHONY: pdk-with-volare .PHONY: pdk-with-volare
pdk-with-volare: check-python install-volare pdk-with-volare: check-env venv/manifest.txt
./venv/bin/volare enable ${OPEN_PDKS_COMMIT} ./venv/bin/volare enable ${OPEN_PDKS_COMMIT}
check-python:
ifeq ($(shell which python3),)
$(error Please install python 3.6+)
endif
.PHONY: install-volare
install-volare:
rm -rf ./venv
$(PYTHON_BIN) -m venv ./venv
./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir pip
./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir volare
###########################################################################
pdk-with-sram: pdk
.PHONY: pdk
pdk: check-env skywater-pdk open-pdks sky130 gen-sources
.PHONY: clean-pdk .PHONY: clean-pdk
clean-pdk: clean-pdk:
rm -rf $(PDK_ROOT) rm -rf $(PDK_ROOT)
.PHONY: skywater-pdk # Make README.rst
skywater-pdk: README.rst: README.src.rst docs/source/getting-started.rst docs/source/tool-versioning.rst openlane/README.src.rst docs/source/caravel-with-openlane.rst Makefile ./venv/manifest.txt
if [ -d "$(PDK_ROOT)/skywater-pdk" ]; then\ rm -f README.rst && \
echo "Deleting existing $(PDK_ROOT)/skywater-pdk" && \ ./venv/bin/rst_include include README.src.rst - | \
rm -rf $(PDK_ROOT)/skywater-pdk && sleep 2;\ sed \
fi -e's@\.\/\_static@\/docs\/source\/\_static@g' \
git clone https://github.com/google/skywater-pdk.git $(PDK_ROOT)/skywater-pdk -e's@:doc:`tool-versioning`@`tool-versioning.rst <./docs/source/tool-versioning.rst>`__@g' \
cd $(PDK_ROOT)/skywater-pdk && \ -e's@.. note::@**NOTE:**@g' \
git checkout main && git pull && \ -e's@.. warning::@**WARNING:**@g' \
git checkout -qf $(SKYWATER_COMMIT) && \ > README.rst && \
git submodule update --init libraries/$(STD_CELL_LIBRARY)/latest && \ ./venv/bin/rst_include include openlane/README.src.rst - | \
git submodule update --init libraries/$(IO_LIBRARY)/latest && \ sed \
git submodule update --init libraries/$(SPECIAL_VOLTAGE_LIBRARY)/latest && \ -e's@https://github.com/efabless/caravel/blob/master/verilog@../verilog@g' \
git submodule update --init libraries/$(PRIMITIVES_LIBRARY)/latest && \ -e's@:ref:`getting-started`@`README.rst <../README.rst>`__@g' \
$(MAKE) timing -e's@https://github.com/efabless/caravel/blob/master/openlane/@./@g' \
-e's@.. note::@**NOTE:**@g' \
### OPEN_PDKS -e's@.. warning::@**WARNING:**@g' \
.PHONY: open-pdks > openlane/README.rst
open-pdks:
if [ -d "$(PDK_ROOT)/open_pdks" ]; then \ venv/manifest.txt: ./requirements.txt
echo "Deleting existing $(PDK_ROOT)/open_pdks" && \ $(MAKE) check-python
rm -rf $(PDK_ROOT)/open_pdks && sleep 2; \ rm -rf ./venv
fi $(PYTHON_BIN) -m venv ./venv
git clone git://opencircuitdesign.com/open_pdks $(PDK_ROOT)/open_pdks ./venv/bin/python3 -m pip install --upgrade --no-cache-dir pip
cd $(PDK_ROOT)/open_pdks && \ ./venv/bin/python3 -m pip install --upgrade --no-cache-dir -r requirements.txt
git checkout master && git pull && \ ./venv/bin/python3 -m pip freeze > $@
git checkout -qf $(OPEN_PDKS_COMMIT)
.PHONY: sky130
sky130:
if [ -d "$(PDK_ROOT)/$(PDK)" ]; then \
echo "Deleting existing $(PDK_ROOT)/$(PDK)" && \
rm -rf $(PDK_ROOT)/$(PDK) && sleep 2;\
fi
docker run --rm\
-v $(PDK_ROOT):$(PDK_ROOT)\
-u $(shell id -u $(USER)):$(shell id -g $(USER)) \
-e PDK_ROOT=$(PDK_ROOT)\
-e GIT_COMMITTER_NAME="caravel"\
-e GIT_COMMITTER_EMAIL="caravel@caravel.caravel"\
efabless/openlane-tools:magic-$(PDK_MAGIC_COMMIT)-centos-7\
sh -c "\
cd $(PDK_ROOT)/open_pdks && \
./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk --enable-sram-sky130 && \
make && \
make SHARED_PDKS_PATH=$(PDK_ROOT) install && \
make clean \
"
.PHONY: gen-sources
gen-sources:
touch $(PDK_ROOT)/$(PDK)/SOURCES
printf "skywater-pdk " >> $(PDK_ROOT)/$(PDK)/SOURCES
cd $(PDK_ROOT)/skywater-pdk && git rev-parse HEAD >> $(PDK_ROOT)/$(PDK)/SOURCES
printf "open_pdks " >> $(PDK_ROOT)/$(PDK)/SOURCES
cd $(PDK_ROOT)/open_pdks && git rev-parse HEAD >> $(PDK_ROOT)/$(PDK)/SOURCES
printf "magic $(PDK_MAGIC_COMMIT)" >> $(PDK_ROOT)/$(PDK)/SOURCES
###########################################################################
.RECIPE: manifest .RECIPE: manifest
manifest: mag/ maglef/ verilog/rtl/ Makefile manifest: mag/ maglef/ verilog/rtl/ Makefile
touch manifest && \ touch manifest && \
@ -1397,26 +1354,14 @@ check-mcw:
echo "MCW Root: "$(MCW_ROOT)" doesn't exists, please export the correct path before running make. "; \ echo "MCW Root: "$(MCW_ROOT)" doesn't exists, please export the correct path before running make. "; \
exit 1; \ exit 1; \
fi fi
# Make README.rst check-python:
README.rst: README.src.rst docs/source/getting-started.rst docs/source/tool-versioning.rst openlane/README.src.rst docs/source/caravel-with-openlane.rst Makefile @if ! command -v $(PYTHON_BIN) > /dev/null; then\
pip -q install rst_include && \ echo "Python 3 binary '$(PYTHON_BIN)' not found.";\
rm -f README.rst && \ exit 1;\
rst_include include README.src.rst - | \ fi
sed \ @$(PYTHON_BIN) -c "import sys; assert sys.version_info >= (3, 6), 'Python version less than 3.6'"
-e's@\.\/\_static@\/docs\/source\/\_static@g' \ @echo "Python >=3.8 found."
-e's@:doc:`tool-versioning`@`tool-versioning.rst <./docs/source/tool-versioning.rst>`__@g' \
-e's@.. note::@**NOTE:**@g' \
-e's@.. warning::@**WARNING:**@g' \
> README.rst && \
rst_include include openlane/README.src.rst - | \
sed \
-e's@https://github.com/efabless/caravel/blob/master/verilog@../verilog@g' \
-e's@:ref:`getting-started`@`README.rst <../README.rst>`__@g' \
-e's@https://github.com/efabless/caravel/blob/master/openlane/@./@g' \
-e's@.. note::@**NOTE:**@g' \
-e's@.. warning::@**WARNING:**@g' \
> openlane/README.rst
.PHONY: clean-openlane .PHONY: clean-openlane
clean-openlane: clean-openlane:

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
volare
rst_include