@@ -1267,90 +1267,47 @@ endif
12671267
12681268
12691269# ##########################################################################
1270+ .PHONY : pdk pdk-with-sram
1271+ pdk-with-sram : pdk
1272+ pdk : check-env pdk-with-volare
12701273
12711274.PHONY : pdk-with-volare
1272- pdk-with-volare : check-python install-volare
1275+ pdk-with-volare : check-env venv/manifest.txt
12731276 ./venv/bin/volare enable ${OPEN_PDKS_COMMIT}
12741277
1275- check-python :
1276- ifeq ($(shell which python3) ,)
1277- $(error Please install python 3.6+)
1278- endif
1279-
1280- .PHONY : install-volare
1281- install-volare :
1282- rm -rf ./venv
1283- $(PYTHON_BIN ) -m venv ./venv
1284- ./venv/bin/$(PYTHON_BIN ) -m pip install --upgrade --no-cache-dir pip
1285- ./venv/bin/$(PYTHON_BIN ) -m pip install --upgrade --no-cache-dir volare
1286-
1287-
1288- # ##########################################################################
1289- pdk-with-sram : pdk
1290- .PHONY : pdk
1291- pdk : check-env skywater-pdk open-pdks sky130 gen-sources
1292-
12931278.PHONY : clean-pdk
12941279clean-pdk :
12951280 rm -rf $(PDK_ROOT )
12961281
1297- .PHONY : skywater-pdk
1298- skywater-pdk :
1299- if [ -d " $( PDK_ROOT) /skywater-pdk" ]; then\
1300- echo " Deleting existing $( PDK_ROOT) /skywater-pdk" && \
1301- rm -rf $(PDK_ROOT ) /skywater-pdk && sleep 2; \
1302- fi
1303- git clone https://github.com/google/skywater-pdk.git $(PDK_ROOT ) /skywater-pdk
1304- cd $(PDK_ROOT ) /skywater-pdk && \
1305- git checkout main && git pull && \
1306- git checkout -qf $(SKYWATER_COMMIT ) && \
1307- git submodule update --init libraries/$(STD_CELL_LIBRARY ) /latest && \
1308- git submodule update --init libraries/$(IO_LIBRARY ) /latest && \
1309- git submodule update --init libraries/$(SPECIAL_VOLTAGE_LIBRARY ) /latest && \
1310- git submodule update --init libraries/$(PRIMITIVES_LIBRARY ) /latest && \
1311- $(MAKE ) timing
1312-
1313- # ## OPEN_PDKS
1314- .PHONY : open-pdks
1315- open-pdks :
1316- if [ -d " $( PDK_ROOT) /open_pdks" ]; then \
1317- echo " Deleting existing $( PDK_ROOT) /open_pdks" && \
1318- rm -rf $(PDK_ROOT ) /open_pdks && sleep 2; \
1319- fi
1320- git clone git://opencircuitdesign.com/open_pdks $(PDK_ROOT ) /open_pdks
1321- cd $(PDK_ROOT ) /open_pdks && \
1322- git checkout master && git pull && \
1323- git checkout -qf $(OPEN_PDKS_COMMIT )
1324-
1325- .PHONY : sky130
1326- sky130 :
1327- if [ -d " $( PDK_ROOT) /$( PDK) " ]; then \
1328- echo " Deleting existing $( PDK_ROOT) /$( PDK) " && \
1329- rm -rf $(PDK_ROOT ) /$(PDK ) && sleep 2; \
1330- fi
1331- docker run --rm\
1332- -v $(PDK_ROOT ) :$(PDK_ROOT ) \
1333- -u $(shell id -u $(USER ) ) :$(shell id -g $(USER ) ) \
1334- -e PDK_ROOT=$(PDK_ROOT ) \
1335- -e GIT_COMMITTER_NAME=" caravel" \
1336- -e GIT_COMMITTER_EMAIL=" caravel@caravel.caravel" \
1337- efabless/openlane-tools:magic-$(PDK_MAGIC_COMMIT ) -centos-7\
1338- sh -c " \
1339- cd $(PDK_ROOT ) /open_pdks && \
1340- ./configure --enable-sky130-pdk=$(PDK_ROOT ) /skywater-pdk --enable-sram-sky130 && \
1341- make && \
1342- make SHARED_PDKS_PATH=$(PDK_ROOT ) install && \
1343- make clean \
1344- "
1345- .PHONY : gen-sources
1346- gen-sources :
1347- touch $(PDK_ROOT ) /$(PDK ) /SOURCES
1348- printf " skywater-pdk " >> $(PDK_ROOT ) /$(PDK ) /SOURCES
1349- cd $(PDK_ROOT ) /skywater-pdk && git rev-parse HEAD >> $(PDK_ROOT ) /$(PDK ) /SOURCES
1350- printf " open_pdks " >> $(PDK_ROOT ) /$(PDK ) /SOURCES
1351- cd $(PDK_ROOT ) /open_pdks && git rev-parse HEAD >> $(PDK_ROOT ) /$(PDK ) /SOURCES
1352- printf " magic $( PDK_MAGIC_COMMIT) " >> $(PDK_ROOT ) /$(PDK ) /SOURCES
1282+ # Make README.rst
1283+ 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
1284+ rm -f README.rst && \
1285+ ./venv/bin/rst_include include README.src.rst - | \
1286+ sed \
1287+ -e' s@\.\/\_static@\/docs\/source\/\_static@g' \
1288+ -e' s@:doc:`tool-versioning`@`tool-versioning.rst <./docs/source/tool-versioning.rst>`__@g' \
1289+ -e' s@.. note::@**NOTE:**@g' \
1290+ -e' s@.. warning::@**WARNING:**@g' \
1291+ > README.rst && \
1292+ ./venv/bin/rst_include include openlane/README.src.rst - | \
1293+ sed \
1294+ -e' s@https://github.com/efabless/caravel/blob/master/verilog@../verilog@g' \
1295+ -e' s@:ref:`getting-started`@`README.rst <../README.rst>`__@g' \
1296+ -e' s@https://github.com/efabless/caravel/blob/master/openlane/@./@g' \
1297+ -e' s@.. note::@**NOTE:**@g' \
1298+ -e' s@.. warning::@**WARNING:**@g' \
1299+ > openlane/README.rst
1300+
1301+ venv/manifest.txt : ./requirements.txt
1302+ $(MAKE ) check-python
1303+ rm -rf ./venv
1304+ $(PYTHON_BIN ) -m venv ./venv
1305+ ./venv/bin/python3 -m pip install --upgrade --no-cache-dir pip
1306+ ./venv/bin/python3 -m pip install --upgrade --no-cache-dir -r requirements.txt
1307+ ./venv/bin/python3 -m pip freeze > $@
13531308
1309+ # ##########################################################################
1310+
13541311.RECIPE : manifest
13551312manifest : mag/ maglef/ verilog/rtl/ Makefile
13561313 touch manifest && \
@@ -1397,26 +1354,14 @@ check-mcw:
13971354 echo " MCW Root: " $(MCW_ROOT ) " doesn't exists, please export the correct path before running make. " ; \
13981355 exit 1; \
13991356 fi
1400-
1401- # Make README.rst
1402- 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
1403- pip -q install rst_include && \
1404- rm -f README.rst && \
1405- rst_include include README.src.rst - | \
1406- sed \
1407- -e' s@\.\/\_static@\/docs\/source\/\_static@g' \
1408- -e' s@:doc:`tool-versioning`@`tool-versioning.rst <./docs/source/tool-versioning.rst>`__@g' \
1409- -e' s@.. note::@**NOTE:**@g' \
1410- -e' s@.. warning::@**WARNING:**@g' \
1411- > README.rst && \
1412- rst_include include openlane/README.src.rst - | \
1413- sed \
1414- -e' s@https://github.com/efabless/caravel/blob/master/verilog@../verilog@g' \
1415- -e' s@:ref:`getting-started`@`README.rst <../README.rst>`__@g' \
1416- -e' s@https://github.com/efabless/caravel/blob/master/openlane/@./@g' \
1417- -e' s@.. note::@**NOTE:**@g' \
1418- -e' s@.. warning::@**WARNING:**@g' \
1419- > openlane/README.rst
1357+
1358+ check-python :
1359+ @if ! command -v $(PYTHON_BIN ) > /dev/null; then\
1360+ echo " Python 3 binary '$( PYTHON_BIN) ' not found." ; \
1361+ exit 1; \
1362+ fi
1363+ @$(PYTHON_BIN ) -c " import sys; assert sys.version_info >= (3, 6), 'Python version less than 3.6'"
1364+ @echo " Python >=3.8 found."
14201365
14211366.PHONY : clean-openlane
14221367clean-openlane :
0 commit comments