agorararmard | 790b952 | 2020-10-21 19:39:39 +0200 | [diff] [blame] | 1 | # Copyright 2020 Efabless Corporation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # Adopted from OpenLANE's Makefile. |
| 16 | |
| 17 | OPEN_PDKS_ROOT ?= $(shell pwd)/.. |
| 18 | THREADS ?= $(shell nproc) |
| 19 | STD_CELL_LIBRARY ?= sky130_fd_sc_hd |
agorararmard | 4b61e51 | 2020-11-16 23:39:06 +0200 | [diff] [blame] | 20 | SKYWATER_COMMIT ?= d8e2cf1ba006ed01468aa60e7f4e85a1ece74ca4 |
agorararmard | 790b952 | 2020-10-21 19:39:39 +0200 | [diff] [blame] | 21 | |
| 22 | .DEFAULT_GOAL := all |
| 23 | |
| 24 | .PHONY: all |
| 25 | all: pdk |
| 26 | |
| 27 | .PHONY: pdk |
| 28 | pdk: skywater-pdk skywater-library build-pdk |
| 29 | |
| 30 | $(PDK_ROOT)/skywater-pdk: |
| 31 | git clone https://github.com/google/skywater-pdk.git $(PDK_ROOT)/skywater-pdk |
| 32 | |
| 33 | .PHONY: skywater-pdk |
| 34 | skywater-pdk: $(PDK_ROOT)/skywater-pdk |
| 35 | cd $(PDK_ROOT)/skywater-pdk && \ |
| 36 | git checkout -qf $(SKYWATER_COMMIT) |
| 37 | |
| 38 | .PHONY: skywater-library |
| 39 | skywater-library: $(PDK_ROOT)/skywater-pdk |
| 40 | cd $(PDK_ROOT)/skywater-pdk && \ |
| 41 | git submodule update --init libraries/$(STD_CELL_LIBRARY)/latest && \ |
| 42 | $(MAKE) -j$(THREADS) $(STD_CELL_LIBRARY) |
| 43 | |
| 44 | .PHONY: all-skywater-libraries |
| 45 | all-skywater-libraries: skywater-pdk |
| 46 | cd $(PDK_ROOT)/skywater-pdk && \ |
| 47 | git submodule update --init libraries/sky130_fd_sc_hd/latest && \ |
| 48 | git submodule update --init libraries/sky130_fd_sc_hs/latest && \ |
| 49 | git submodule update --init libraries/sky130_fd_sc_hdll/latest && \ |
| 50 | git submodule update --init libraries/sky130_fd_sc_ms/latest && \ |
| 51 | git submodule update --init libraries/sky130_fd_sc_ls/latest && \ |
agorararmard | 830fcc6 | 2020-11-16 23:20:26 +0200 | [diff] [blame] | 52 | git submodule update --init libraries/sky130_fd_sc_hvl/latest && \ |
agorararmard | 790b952 | 2020-10-21 19:39:39 +0200 | [diff] [blame] | 53 | $(MAKE) -j$(THREADS) timing |
| 54 | |
| 55 | .PHONY: build-pdk |
| 56 | build-pdk: $(PDK_ROOT)/skywater-pdk |
| 57 | [[ -d $(PDK_ROOT)/sky130A ]] && \ |
| 58 | (echo "Warning: A sky130A build already exists under $(PDK_ROOT). It will be deleted first!" && \ |
| 59 | sleep 5 && \ |
| 60 | rm -rf $(PDK_ROOT)/sky130A) || \ |
| 61 | true |
| 62 | cd $(OPEN_PDKS_ROOT) && \ |
| 63 | ./configure --with-sky130-source=$(PDK_ROOT)/skywater-pdk/libraries --with-sky130-local-path=$(PDK_ROOT) && \ |
| 64 | cd sky130 && \ |
| 65 | $(MAKE) veryclean && \ |
| 66 | $(MAKE) && \ |
| 67 | $(MAKE) install-local |