blob: 6382bfffee34eb83d751f5f490f58dc4bd36763f [file] [log] [blame]
agorararmard790b9522020-10-21 19:39:39 +02001# 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
17OPEN_PDKS_ROOT ?= $(shell pwd)/..
18THREADS ?= $(shell nproc)
19STD_CELL_LIBRARY ?= sky130_fd_sc_hd
agorararmard4b61e512020-11-16 23:39:06 +020020SKYWATER_COMMIT ?= d8e2cf1ba006ed01468aa60e7f4e85a1ece74ca4
agorararmard790b9522020-10-21 19:39:39 +020021
22.DEFAULT_GOAL := all
23
24.PHONY: all
25all: pdk
26
27.PHONY: pdk
28pdk: 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
34skywater-pdk: $(PDK_ROOT)/skywater-pdk
35 cd $(PDK_ROOT)/skywater-pdk && \
36 git checkout -qf $(SKYWATER_COMMIT)
37
38.PHONY: skywater-library
39skywater-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
45all-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 && \
agorararmard830fcc62020-11-16 23:20:26 +020052 git submodule update --init libraries/sky130_fd_sc_hvl/latest && \
agorararmard790b9522020-10-21 19:39:39 +020053 $(MAKE) -j$(THREADS) timing
54
55.PHONY: build-pdk
56build-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