blob: 5f72ba94a8e2812ce0c625b88d1f990255bf60dc [file] [log] [blame]
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001# Makefile for efabless design kits for SkyWater Sky130:
2#
3# sky130A = 5-metal backend stack with dual MiM
Tim Edwards58b1a922022-01-17 15:55:42 -05004# sky130B = 5-metal backend stack with dual MiM and ReRAM
Tim Edwards55f4d0e2020-07-05 15:41:02 -04005#
6# Written by Tim Edwards March 2019
7# efabless corporation
8# updated October 2019
9# updated December 2019 (divide installation sections for individual tools)
10# updated March 2020 (refactored the install process)
11# updated May 2020 (changed to new process name Sky130)
Tim Edwards58b1a922022-01-17 15:55:42 -050012# updated January 2022 (divided into two variants A and B)
Tim Edwards55f4d0e2020-07-05 15:41:02 -040013#
14# Instructions:
15#
Tim Edwards7cbaaba2020-08-05 12:19:18 -040016# Run "configure" from the top level directory. Use the following
17# configuration options to match your environment:
Tim Edwards55f4d0e2020-07-05 15:41:02 -040018#
Tim Edwardsc7ab1ea2020-12-24 17:04:36 -050019# --enable-sky130-pdk[=<path>]
Tim Edwards942a14f2020-12-24 16:20:31 -050020# If enabled, install the skywater PDK. If <path> is specified,
21# then the skywater PDK is expected to be found rooted at the
22# given path. If not specified, then the skywater PDK will be
23# downloaded and installed to <repo root>/pdks.
24# If explicitly disabled, sky130 is skipped over entirely.
25#
Tim Edwards7cbaaba2020-08-05 12:19:18 -040026# --with-sky130-link-targets=<value>
27# where <value> is one of "none" or "source". If set to "source",
28# then where possible, the installed files are symbolic links
29# back to the source, rather than copies of the source. The
30# default value is "none" if the option is not specified.
31#
32# --with-ef-style
33# If specified, then the installation uses the efabless style,
34# which swaps the file hierarchy of file formats vs. IP libraries;
35# e.g., "gds/sky130_fd_sc_hd/" with ef-style, vs.
36# "sky130_fd_sc_hd/gds/" without it.
37#
Tim Edwards22fdb442020-12-02 12:40:03 -050038# Enable/disable for specific libraries to be installed (and downloaded if
39# needed). Libraries that are part of the open_pdks repository are enabled
40# by default and must be disabled by passing an option to configure. Libraries
41# that are not part of the open_pdks repository are disabled by default and
42# must be enabled by passing an option to configure.
43#
44# Internal libraries and tool setups that can be disabled are the following:
45#
46# --disable-magic
47# Do not install setup files for the magic layout tool.
48#
49# --disable-netgen
50# Do not install setup files for the netgen LVS tool.
51#
Tim Edwards367711e2021-01-27 10:35:12 -050052# --disable-irsim
53# Do not install setup files for the IRSIM simulation tool.
54#
Tim Edwards22fdb442020-12-02 12:40:03 -050055# --disable-qflow
56# Do not install setup files for the qflow synthesis flow.
57#
58# --disable-openlane
59# Do not install setup files for the openlane sythesis flow.
60#
61# --disable-klayout
62# Do not install setup files for the klayout layout tool.
63#
Tim Edwardsccaea722020-12-24 10:59:42 -050064#
65# NOTE: The comments below are for features that have not yet been
66# implemented.
67#
Tim Edwards9a17fca2021-02-11 17:44:04 -050068# External (third-party) libraries and tool setups are the following (enabled
69# by default):
Tim Edwards22fdb442020-12-02 12:40:03 -050070#
Tim Edwardscdfec5e2021-04-22 20:59:13 -040071# --enable-alpha-sky130[=<path>]
Tim Edwardsbcf59aa2020-12-17 16:55:13 -050072# If enabled, install the sky130_ml_xx_hd font library from
Tim Edwardscfe970c2021-02-26 14:35:51 -050073# Paul Schulz on github. If <path> is not specified, then the
74# font library will be cloned from the git repository and
75# installed.
Tim Edwards22fdb442020-12-02 12:40:03 -050076#
Tim Edwardscdfec5e2021-04-22 20:59:13 -040077# --enable-xschem-sky130[=<path>]
Tim Edwards22fdb442020-12-02 12:40:03 -050078# If enabled, install the Sky130 setup for the xschem schematic
79# editor. If <path> is specified, then the xschem setup is
80# expected to be found rooted at the given path. If not
81# specified, then the xschem setup will be cloned from the
82# repository and installed.
83#
Tim Edwardscdfec5e2021-04-22 20:59:13 -040084# External (third-party) libraries and tool setups are the following (disabled
85# by default):
86#
87# --enable-sram-sky130[=<path>]
Tim Edwardscfe970c2021-02-26 14:35:51 -050088# If enabled, install the sky130_sram_macros library from
89# efabless on github. If <path> is not specified, then
90# the SRAM library will be cloned from the repository and
91# installed.
92#
Tim Edwardscdfec5e2021-04-22 20:59:13 -040093# --enable-osu-t12-sky130[=<path>]
94# If enabled, install the sky130_osu_sc_t12 libraries from
95# foss-eda-tools on googlesource. If <path> is not
96# specified, then the OSU standard cell library will be
97# clones from the repository and installed.
98#
99# --enable-osu-t15-sky130[=<path>]
100# If enabled, install the sky130_osu_sc_t15 libraries from
101# foss-eda-tools on googlesource. If <path> is not
102# specified, then the OSU standard cell library will be
103# clones from the repository and installed.
104#
105# --enable-osu-t18-sky130[=<path>]
106# If enabled, install the sky130_osu_sc_t18 libraries from
107# foss-eda-tools on googlesource. If <path> is not
108# specified, then the OSU standard cell library will be
109# clones from the repository and installed.
110#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400111# The variables below are substituted from the configuration options:
112#
Tim Edwards6f01cd22022-01-17 19:23:53 -0500113# SKYWATER_PATH: Points to vendor sources
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400114# EF_STYLE: 1 for efabless style, 0 otherwise
Tim Edwards6f01cd22022-01-17 19:23:53 -0500115# LINK_TARGETS_A: If "source", link back to source when possible
Tim Edwards7fa92fd2022-01-19 11:13:51 -0500116# ENABLED_VARIANTS: If not "all", then compile/install only the specified variants
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400117#
118# Run "make" to stage the PDK for tool setup and vendor libraries
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400119#
Tim Edwards44e7efa2021-08-20 13:20:55 -0400120# Run "make install" to install all staged files.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400121#
122# Run "make clean" to remove all staging files.
123#
Tim Edwards9134eed2021-02-13 14:42:59 -0500124# Run "make veryclean" to remove all staging and make.log files.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400125#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400126# For the sake of simplicity, the "standard" installation can be done
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400127# with the usual
128#
129# make
130# make install
131# make clean
132#
133#--------------------------------------------------------------------
134# This Makefile contains bash-isms
Tim 'mithro' Ansell56527562021-11-23 09:37:07 -0800135SHELL := /bin/bash
136export SHELL
137# We use pipes to save output to files, without pipefail they will always be
138# seen by make as having succeeded.
139SHELLOPTS := pipefail
140export SHELLOPTS
Tristan Gingolda5854312020-10-15 18:28:16 +0200141MV = mv
Tim Edwards5a623ff2021-04-30 16:30:52 -0400142SED = @SED@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400143
Tim Edwards44e7efa2021-08-20 13:20:55 -0400144prefix = @prefix@
145datarootdir = @datarootdir@
146datadir = @datadir@
147
Tim Edwardsf04c4212021-03-18 10:12:16 -0400148# Use git revision if this is a cloned repo; otherwise get the revision
149# from the VERSION file in the directory above.
150GITREV = $(shell git describe --long)
151ifeq (${GITREV},)
152 REVISION = $(shell cat ../VERSION)
153else
154 REVISION = ${GITREV}
155endif
156TECH = sky130
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400157
Tim Edwardsaac3d1a2021-06-15 16:37:10 -0400158# The run-time environment uses PDKPATH to override the PDK location,
159# so prevent that from happening during PDK install.
160unexport PDKPATH
161
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400162# If EF_STYLE is set to 1, then efabless naming conventions are
163# used, otherwise the generic naming conventions are used.
164# Mainly, the hierarchy of library names and file types is reversed
165# (e.g., sky130_fd_sc_hd/lef vs. lef/sky130_fd_sc_hd).
166
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400167# EF_STYLE = 0 | 1
168EF_STYLE = @EF_STYLE@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400169
170# Normally it's fine to keep the staging path in a local directory,
171# although /tmp or a dedicated staging area are also fine, as long
172# as the install process can write to the path.
173
Tim Edwards1ffd99c2021-08-20 16:27:43 -0400174STAGING_PATH = $(shell pwd)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400175
mrgbea9d872021-11-08 13:43:42 -0800176SHARED_PDKS_PATH ?= $(datadir)/pdk
Tim Edwards44e7efa2021-08-20 13:20:55 -0400177
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400178# If LINK_TARGETS is set to "none", then files are copied
179# from the SkyWater sources to the target. If set to "source",
180# symbolic links are made in the target directories pointing
181# back to the SkyWater sources. If set to the name of another
182# PDK (e.g, "sky130A"), then symbolic links are made to the
183# same files in that PDK, where they exist, and are copied
184# from source, where they don't.
Tim Edwards6f01cd22022-01-17 19:23:53 -0500185#
186# Behavior is to let the link targets for variant A follow the
187# configuration option. Link targets for variant B will always
188# be the files of variant A (which may end up being symbolic
189# links to symbolic links if "source" was chosen for link-targets
190# in the configuration).
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400191
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400192# LINK_TARGETS = source | none | sky130A
Tim Edwards6f01cd22022-01-17 19:23:53 -0500193LINK_TARGETS_A = @SKY130_LINK_TARGETS@
194LINK_TARGETS_B = sky130A
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400195
Tim Edwards7fa92fd2022-01-19 11:13:51 -0500196# ENABLED_VARIANTS = all | A | B
197ENABLED_VARIANTS = @SKY130_ENABLED_VARIANTS@
198ifeq (${ENABLED_VARIANTS},)
199 VARIANTS += A B
200else
201 ifeq (${ENABLED_VARIANTS}, all)
202 VARIANTS += A B
203 else
204 VARIANTS += ${ENABLED_VARIANTS}
205 endif
206endif
207
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400208# Paths:
209
agorararmard3ee5f112021-02-03 19:49:09 +0200210# Path to skywater_pdk
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400211SKYWATER_PATH = @SKY130_SOURCE_PATH@
Tim Edwards66e53e52021-01-24 21:21:36 -0500212ifneq ($(SKYWATER_PATH),)
Tim Edwards6ee11532021-02-11 12:29:33 -0500213 SKYWATER_LIBS_PATH = ${SKYWATER_PATH}/libraries
214else
215 SKYWATER_LIBS_PATH =
Tim Edwards66e53e52021-01-24 21:21:36 -0500216endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400217
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500218# Path to independent library sources (to be added to configuration options).
Tim Edwards1168a8b2021-02-10 22:06:54 -0500219ALPHA_PATH = @SKY130_ML_XX_HD_PATH@
220XSCHEM_PATH = @XSCHEM_SKY130_PATH@
Tim Edwardscfe970c2021-02-26 14:35:51 -0500221SRAM_PATH = @SKY130_SRAM_MACROS_PATH@
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400222OSU_T12_PATH = @SKY130_OSU_T12_PATH@
223OSU_T15_PATH = @SKY130_OSU_T15_PATH@
224OSU_T18_PATH = @SKY130_OSU_T18_PATH@
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500225
Tim Edwards6ee11532021-02-11 12:29:33 -0500226PDK_URL = https://github.com/google/skywater-pdk
Tim Edwards8877f8f2021-06-10 21:35:36 -0400227ALPHA_URL = https://github.com/PaulSchulz/sky130_pschulz_xx_hd
228XSCHEM_URL = https://github.com/StefanSchippers/xschem_sky130
229SRAM_URL = https://github.com/efabless/sky130_sram_macros
Tim Edwards8877f8f2021-06-10 21:35:36 -0400230OSU_T12_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t12
231OSU_T15_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t15
232OSU_T18_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t18
Tim Edwards6ee11532021-02-11 12:29:33 -0500233
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400234# NOTE: Install destination is the git repository of the technology platform.
235# Once updated in git, the git project can be distributed to all hosts.
236#
237ifeq (${EF_STYLE}, 1)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400238 CONFIG_DIR = .ef-config
239 REV_DIR = ${REVISION}
240else
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400241 CONFIG_DIR = .config
242 REV_DIR = .
243endif
244
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400245# EF process nodes created from the master sources
246SKY130A = sky130A
Tim Edwards58b1a922022-01-17 15:55:42 -0500247SKY130B = sky130B
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400248
Tim Edwards6f01cd22022-01-17 19:23:53 -0500249DIST_LINK_TARGETS_A = ${LINK_TARGETS_A}
250DIST_LINK_TARGETS_B = ${SHARED_PDKS_PATH}/${LINK_TARGETS_B}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400251
252# Basic definitions for each EF process node
253SKY130A_DEFS = -DTECHNAME=sky130A -DREVISION=${REVISION}
Tim Edwards58b1a922022-01-17 15:55:42 -0500254SKY130B_DEFS = -DTECHNAME=sky130B -DREVISION=${REVISION}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400255
256# Module definitions for each process node
257# (Note that MOS is default and therefore not used anywhere)
Tim Edwards0a0272b2020-07-28 14:40:10 -0400258SKY130A_DEFS += -DMETAL5 -DMIM -DREDISTRIBUTION
Tim Edwards58b1a922022-01-17 15:55:42 -0500259SKY130B_DEFS += -DMETAL5 -DMIM -DREDISTRIBUTION
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400260
Tim Edwards58b1a922022-01-17 15:55:42 -0500261# NOTE: ReRAM support is what distinguishes variant B from variant A.
262SKY130B_DEFS += -DRERAM
Tim Edwards33e65982021-11-24 22:35:04 -0500263
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400264# Add staging path
265SKY130A_DEFS += -DSTAGING_PATH=${STAGING_PATH}
Tim Edwards58b1a922022-01-17 15:55:42 -0500266SKY130B_DEFS += -DSTAGING_PATH=${STAGING_PATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400267
Tim Edwards5d450d52022-01-22 15:31:32 -0500268# Get the timestamp of the open_pdks commit to use for stamping layouts.
269OPEN_PDKS_TIMESTAMP = $(shell git log -1 --format="%ad" --date=raw | cut -d' ' -f1)
270TIMESTAMP_OPT = -timestamp ${OPEN_PDKS_TIMESTAMP}
271
Tim Edwards8877f8f2021-06-10 21:35:36 -0400272# Record commit numbers for the nodeinfo.json file
273OPEN_PDKS_COMMIT = $(shell git rev-parse HEAD)
274ifeq (${OPEN_PDKS_COMMIT},)
275 COMMIT_DEFS = -DOPEN_PDKS_COMMIT=${REVISION}
276else
277 COMMIT_DEFS = -DOPEN_PDKS_COMMIT=${OPEN_PDKS_COMMIT}
278endif
279ifeq (${ALPHA_PATH},)
280 COMMIT_DEFS += -DALPHA_COMMIT="unknown"
281else
282 COMMIT_DEFS += -DALPHA_COMMIT=$(shell cd ${ALPHA_PATH} ; git rev-parse HEAD)
283endif
284ifeq (${SRAM_PATH},)
285 COMMIT_DEFS += -DSRAM_COMMIT="unknown"
286else
287 COMMIT_DEFS += -DSRAM_COMMIT=$(shell cd ${SRAM_PATH} ; git rev-parse HEAD)
288endif
Tim Edwards8877f8f2021-06-10 21:35:36 -0400289ifeq (${OSU_T12_PATH},)
290 COMMIT_DEFS += -DOSU_T12_COMMIT="unknown"
291else
292 COMMIT_DEFS += -DOSU_T12_COMMIT=$(shell cd ${OSU_T12_PATH} ; git rev-parse HEAD)
293endif
294ifeq (${OSU_T15_PATH},)
295 COMMIT_DEFS += -DOSU_T15_COMMIT="unknown"
296else
297 COMMIT_DEFS += -DOSU_T15_COMMIT=$(shell cd ${OSU_T15_PATH} ; git rev-parse HEAD)
298endif
299ifeq (${OSU_T18_PATH},)
300 COMMIT_DEFS += -DOSU_T18_COMMIT="unknown"
301else
302 COMMIT_DEFS += -DOSU_T18_COMMIT=$(shell cd ${OSU_T18_PATH} ; git rev-parse HEAD)
303endif
304ifeq (${SKYWATER_PATH},)
305 COMMIT_DEFS += -DFD_PR_COMMIT="unknown"
306 COMMIT_DEFS += -DFD_IO_COMMIT="unknown"
307 COMMIT_DEFS += -DFD_SC_HD_COMMIT="unknown"
308 COMMIT_DEFS += -DFD_SC_HDLL_COMMIT="unknown"
309 COMMIT_DEFS += -DFD_SC_HVL_COMMIT="unknown"
310 COMMIT_DEFS += -DFD_SC_HS_COMMIT="unknown"
311 COMMIT_DEFS += -DFD_SC_MS_COMMIT="unknown"
312 COMMIT_DEFS += -DFD_SC_LS_COMMIT="unknown"
313 COMMIT_DEFS += -DFD_SC_LP_COMMIT="unknown"
314else
Tim Edwards02b3c792021-09-08 22:25:13 -0400315 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_pr/latest/cells),)
316 COMMIT_DEFS += -DFD_PR_COMMIT="unknown"
317 else
318 COMMIT_DEFS += -DFD_PR_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_pr/latest)
319 endif
320 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_io/latest/cells),)
321 COMMIT_DEFS += -DFD_IO_COMMIT="unknown"
322 else
323 COMMIT_DEFS += -DFD_IO_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_io/latest)
324 endif
Tim Edwards93090392021-09-09 17:21:49 -0400325 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_hd/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400326 COMMIT_DEFS += -DFD_SC_HD_COMMIT="unknown"
327 else
328 COMMIT_DEFS += -DFD_SC_HD_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_hd/latest)
329 endif
Tim Edwards93090392021-09-09 17:21:49 -0400330 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_hdll/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400331 COMMIT_DEFS += -DFD_SC_HDLL_COMMIT="unknown"
332 else
333 COMMIT_DEFS += -DFD_SC_HDLL_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_hdll/latest)
334 endif
Tim Edwards93090392021-09-09 17:21:49 -0400335 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_hvl/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400336 COMMIT_DEFS += -DFD_SC_HVL_COMMIT="unknown"
337 else
338 COMMIT_DEFS += -DFD_SC_HVL_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_hvl/latest)
339 endif
Tim Edwards93090392021-09-09 17:21:49 -0400340 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_hs/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400341 COMMIT_DEFS += -DFD_SC_HS_COMMIT="unknown"
342 else
343 COMMIT_DEFS += -DFD_SC_HS_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_hs/latest)
344 endif
Tim Edwards93090392021-09-09 17:21:49 -0400345 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_ms/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400346 COMMIT_DEFS += -DFD_SC_MS_COMMIT="unknown"
347 else
348 COMMIT_DEFS += -DFD_SC_MS_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_ms/latest)
349 endif
Tim Edwards93090392021-09-09 17:21:49 -0400350 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_ls/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400351 COMMIT_DEFS += -DFD_SC_LS_COMMIT="unknown"
352 else
353 COMMIT_DEFS += -DFD_SC_LS_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_ls/latest)
354 endif
Tim Edwards93090392021-09-09 17:21:49 -0400355 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_lp/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400356 COMMIT_DEFS += -DFD_SC_LP_COMMIT="unknown"
357 else
358 COMMIT_DEFS += -DFD_SC_LP_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_lp/latest)
359 endif
Tim Edwards8877f8f2021-06-10 21:35:36 -0400360endif
Tim Edwards7d076162021-06-24 11:43:30 -0400361COMMIT_DEFS += -DMAGIC_VERSION=$(shell magic -dnull -noconsole --version)
362COMMIT_DEFS += -DOPEN_PDKS_VERSION=$(shell cat ../VERSION)
Tim Edwards8877f8f2021-06-10 21:35:36 -0400363
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400364ifeq (${EF_STYLE}, 1)
365 EF_FORMAT = -ef_format
366 SKY130A_DEFS += -DEF_FORMAT
Tim Edwards58b1a922022-01-17 15:55:42 -0500367 SKY130B_DEFS += -DEF_FORMAT
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400368else
369 EF_FORMAT = -std_format
370endif
371
372MAGICTOP = libs.tech/magic
373NETGENTOP = libs.tech/netgen
Tim Edwards367711e2021-01-27 10:35:12 -0500374IRSIMTOP = libs.tech/irsim
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400375QFLOWTOP = libs.tech/qflow
376KLAYOUTTOP = libs.tech/klayout
377OPENLANETOP = libs.tech/openlane
Tim Edwards1168a8b2021-02-10 22:06:54 -0500378XSCHEMTOP = libs.tech/xschem
Tim Edwardse4c44092021-02-12 10:18:56 -0500379XCIRCUITTOP = libs.tech/xcircuit
Tim Edwards25972f82021-04-27 21:45:58 -0400380NGSPICETOP = libs.tech/ngspice
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400381
382ifeq (${EF_STYLE}, 1)
383 MAGICPATH = ${MAGICTOP}/${REVISION}
Tim Edwards9134eed2021-02-13 14:42:59 -0500384 MAGICCURRENT = ${MAGICTOP}/current
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400385else
386 MAGICPATH = ${MAGICTOP}
Tim Edwards9134eed2021-02-13 14:42:59 -0500387 MAGICCURRENT = ${MAGICTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400388endif
389
Tim Edwards367711e2021-01-27 10:35:12 -0500390# Currently, netgen, qflow, irsim, and klayout do not use revisioning (needs to change!)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400391NETGENPATH = ${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500392IRSIMPATH = ${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400393QFLOWPATH = ${QFLOWTOP}
394KLAYOUTPATH = ${KLAYOUTTOP}
395OPENLANEPATH = ${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500396XSCHEMPATH = ${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500397XCIRCUITPATH = ${XCIRCUITTOP}
Tim Edwards25972f82021-04-27 21:45:58 -0400398NGSPICEPATH = ${NGSPICETOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400399
400MAGICTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICTOP}
401NETGENTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500402IRSIMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400403QFLOWTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWTOP}
404KLAYOUTTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTTOP}
405OPENLANETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500406XSCHEMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500407XCIRCUITTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITTOP}
Tim Edwards25972f82021-04-27 21:45:58 -0400408NGSPICETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NGSPICETOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400409
410MAGIC_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICPATH}
411NETGEN_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENPATH}
Tim Edwards367711e2021-01-27 10:35:12 -0500412IRSIM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400413QFLOW_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWPATH}
414KLAYOUT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTPATH}
415OPENLANE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANEPATH}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500416XSCHEM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMPATH}
Tim Edwardse4c44092021-02-12 10:18:56 -0500417XCIRCUIT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITPATH}
Tim Edwards25972f82021-04-27 21:45:58 -0400418NGSPICE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NGSPICEPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400419
Tim Edwards58b1a922022-01-17 15:55:42 -0500420MAGICTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${MAGICTOP}
421NETGENTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${NETGENTOP}
422IRSIMTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${IRSIMTOP}
423QFLOWTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${QFLOWTOP}
424KLAYOUTTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${KLAYOUTTOP}
425OPENLANETOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${OPENLANETOP}
426XSCHEMTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${XSCHEMTOP}
427XCIRCUITTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${XCIRCUITTOP}
428NGSPICETOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${NGSPICETOP}
429
430MAGIC_STAGING_B = ${STAGING_PATH}/${SKY130B}/${MAGICPATH}
431NETGEN_STAGING_B = ${STAGING_PATH}/${SKY130B}/${NETGENPATH}
432IRSIM_STAGING_B = ${STAGING_PATH}/${SKY130B}/${IRSIMPATH}
433QFLOW_STAGING_B = ${STAGING_PATH}/${SKY130B}/${QFLOWPATH}
434KLAYOUT_STAGING_B = ${STAGING_PATH}/${SKY130B}/${KLAYOUTPATH}
435OPENLANE_STAGING_B = ${STAGING_PATH}/${SKY130B}/${OPENLANEPATH}
436XSCHEM_STAGING_B = ${STAGING_PATH}/${SKY130B}/${XSCHEMPATH}
437XCIRCUIT_STAGING_B = ${STAGING_PATH}/${SKY130B}/${XCIRCUITPATH}
438NGSPICE_STAGING_B = ${STAGING_PATH}/${SKY130B}/${NGSPICEPATH}
439
Tim Edwards9134eed2021-02-13 14:42:59 -0500440SKY130A_DEFS += -DMAGIC_CURRENT=${MAGICCURRENT}
Tim Edwards58b1a922022-01-17 15:55:42 -0500441SKY130B_DEFS += -DMAGIC_CURRENT=${MAGICCURRENT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400442
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500443# Openlane has a number of files that are common to all digital
444# standard cell libraries, so these are collected in one definition
445# here:
agorararmard2ca46022021-02-11 21:43:51 +0200446OPENLANE_COMMON = config.tcl tracks.info no_synth.cells drc_exclude.cells
manarabdelaty2ecac4f2021-03-08 15:23:12 +0200447OPENLANE_COMMON += tribuff_map.v latch_map.v mux2_map.v mux4_map.v fa_map.v rca_map.v csa_map.v
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500448
Tim Edwards6f01cd22022-01-17 19:23:53 -0500449# Corners defined in IRSIM parameter files (this should be wild-carded!)
450IRSIM_CORNERS = 1v62_27 1v62_n40 1v62_n5 1v80_125 1v80_27 1v80_n40 1v80_n5 1v98_125 1v98_27 1v98_n40 1v98_n5
451
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400452# Where cpp syntax is followed, this is equivalent to cpp, but it does not
453# mangle non-C source files under the belief that they are actually C code.
454CPP = ../common/preproc.py
455
456# The following script in the ../common directory does most of the work of
457# copying or linking the foundry vendor files to the target directory.
Tim Edwards5d450d52022-01-22 15:31:32 -0500458STAGE = set -f ; ../common/foundry_install.py ${EF_FORMAT} ${TIMESTAMP_OPT}
Tim Edwards44e7efa2021-08-20 13:20:55 -0400459ifneq ($(DESTDIR), )
Tim 'mithro' Ansell19576632021-11-14 17:01:53 -0800460INSTALL = ../common/staging_install.py -writeto $(DESTDIR) ${EF_FORMAT}
Tim Edwards44e7efa2021-08-20 13:20:55 -0400461else
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400462INSTALL = ../common/staging_install.py ${EF_FORMAT}
Tim Edwards44e7efa2021-08-20 13:20:55 -0400463endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400464
465# The script(s) below are used for custom changes to the vendor PDK files
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200466ADDPROP = ../common/insert_property.py ${EF_FORMAT}
Tim Edwards22f014d2022-01-26 10:37:03 -0500467ADDLAYER = ../common/insert_layer.py ${EF_FORMAT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400468
469# List the EDA tools to install local setup files for
Tim Edwards44e7efa2021-08-20 13:20:55 -0400470TOOLS =
Tim Edwardsccaea722020-12-24 10:59:42 -0500471
472# KLAYOUT_DISABLED = 0 | 1
473KLAYOUT_DISABLED = @KLAYOUT_DISABLED@
474ifneq (${KLAYOUT_DISABLED}, 1)
475 TOOLS += klayout
476endif
477
478# OPENLANE_DISABLED = 0 | 1
479OPENLANE_DISABLED = @OPENLANE_DISABLED@
480ifneq (${OPENLANE_DISABLED}, 1)
481 TOOLS += openlane
482endif
483
484# QFLOW_DISABLED = 0 | 1
485QFLOW_DISABLED = @QFLOW_DISABLED@
486ifneq (${QFLOW_DISABLED}, 1)
487 TOOLS += qflow
488endif
489
490# MAGIC_DISABLED = 0 | 1
491MAGIC_DISABLED = @MAGIC_DISABLED@
492ifneq (${MAGIC_DISABLED}, 1)
493 TOOLS += magic
494endif
495
496# NETGEN_DISABLED = 0 | 1
497NETGEN_DISABLED = @NETGEN_DISABLED@
498ifneq (${NETGEN_DISABLED}, 1)
499 TOOLS += netgen
500endif
501
Tim Edwards367711e2021-01-27 10:35:12 -0500502# IRSIM_DISABLED = 0 | 1
503IRSIM_DISABLED = @IRSIM_DISABLED@
504ifneq (${IRSIM_DISABLED}, 1)
505 TOOLS += irsim
506endif
507
Tim Edwards1168a8b2021-02-10 22:06:54 -0500508# XSCHEM_DISABLED = 0 | 1
509XSCHEM_DISABLED = @XSCHEM_DISABLED@
510ifneq (${XSCHEM_DISABLED}, 1)
511 TOOLS += xschem
512endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400513
Tim Edwardse4c44092021-02-12 10:18:56 -0500514# XCIRCUIT_DISABLED = 0 | 1
515XCIRCUIT_DISABLED = @XCIRCUIT_DISABLED@
516ifneq (${XCIRCUIT_DISABLED}, 1)
517 TOOLS += xcircuit
518endif
519
Tim Edwards25972f82021-04-27 21:45:58 -0400520# These definitions depend on the setting of EF_STYLE
521ifeq (${EF_STYLE}, 1)
522 IO_VERILOG = verilog/sky130_fd_io
523 HD_VERILOG = verilog/sky130_fd_sc_hd
524 HDLL_VERILOG = verilog/sky130_fd_sc_hdll
525 HVL_VERILOG = verilog/sky130_fd_sc_hvl
526 HS_VERILOG = verilog/sky130_fd_sc_hs
527 MS_VERILOG = verilog/sky130_fd_sc_ms
528 LS_VERILOG = verilog/sky130_fd_sc_ls
529 LP_VERILOG = verilog/sky130_fd_sc_lp
530 HD_TECHLEF = techLEF/sky130_fd_sc_hd
531 HDLL_TECHLEF = techLEF/sky130_fd_sc_hdll
532 MLXX_SCRIPTS = scripts/sky130_ml_xx_hd
533 PR_SPICE = spi/sky130_fd_pr
Tim Edwardsf63ee052021-04-29 15:13:45 -0400534 HVL_SPICE = spi/sky130_fd_sc_hvl
Tim Edwards97274fd2021-07-13 15:15:03 -0400535 HD_SPICE = spi/sky130_fd_sc_hd
Tim Edwards16b050b2021-05-17 16:45:34 -0400536 HVL_PATCH4 = 4b
Tim Edwardsf63ee052021-04-29 15:13:45 -0400537 HVL_CDL = cdl/sky130_fd_sc_hvl
Tim Edwards12f00a02021-09-09 10:40:57 -0400538 SPIEXT = spi
Tim Edwards25972f82021-04-27 21:45:58 -0400539else
540 IO_VERILOG = sky130_fd_io/verilog
541 HD_VERILOG = sky130_fd_sc_hd/verilog
542 HDLL_VERILOG = sky130_fd_sc_hdll/verilog
543 HVL_VERILOG = sky130_fd_sc_hvl/verilog
544 HS_VERILOG = sky130_fd_sc_hs/verilog
545 MS_VERILOG = sky130_fd_sc_ms/verilog
546 LS_VERILOG = sky130_fd_sc_ls/verilog
547 LP_VERILOG = sky130_fd_sc_lp/verilog
548 HD_TECHLEF = sky130_fd_sc_hd/techlef
549 HDLL_TECHLEF = sky130_fd_sc_hdll/techlef
550 MLXX_SCRIPTS = sky130_ml_xx_hd/scripts
551 PR_SPICE = sky130_fd_pr/spice
Tim Edwardsf63ee052021-04-29 15:13:45 -0400552 HVL_SPICE = sky130_fd_sc_hvl/spice
Tim Edwards97274fd2021-07-13 15:15:03 -0400553 HD_SPICE = sky130_fd_sc_hd/spice
Tim Edwards16b050b2021-05-17 16:45:34 -0400554 HVL_PATCH4 = 4
Tim Edwardsf63ee052021-04-29 15:13:45 -0400555 HVL_CDL = sky130_fd_sc_hvl/cdl
Tim Edwards12f00a02021-09-09 10:40:57 -0400556 SPIEXT = spice
Tim Edwards25972f82021-04-27 21:45:58 -0400557endif
558
Tim Edwards7fa92fd2022-01-19 11:13:51 -0500559all: $(foreach var, ${VARIANTS}, all-$(var))
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400560
Tim Edwards6ee11532021-02-11 12:29:33 -0500561# Handle prerequisites (fetch and install the PDK and requested libraries)
Tim Edwards0b8fd2f2021-09-14 10:19:16 -0400562prerequisites: pdk-repo alpha-repo xschem-repo sram-repo osu-t12-repo osu-t15-repo osu-t18-repo
Tim Edwards6ee11532021-02-11 12:29:33 -0500563
564pdk-repo:
565 if test "x${SKYWATER_PATH}" != "x" ; then \
566 if test -d "${SKYWATER_PATH}" ; then \
567 echo "Using existing installation of SkyWater PDK from ${SKYWATER_PATH}" ; \
568 else \
569 echo "Downloading SkyWater PDK from ${PDK_URL}" ; \
570 custom/scripts/pdk_download.sh ${PDK_URL} ${SKYWATER_PATH} ; \
571 fi ; \
572 fi
573
574alpha-repo:
575 if test "x${ALPHA_PATH}" != "x" ; then \
576 if test -d "${ALPHA_PATH}" ; then \
577 echo "Using existing installation of alphanumeric library from ${ALPHA_PATH}" ; \
578 else \
579 echo "Downloading alphanumeric library from ${ALPHA_URL}" ; \
580 ../scripts/download.sh ${ALPHA_URL} ${ALPHA_PATH} ; \
581 fi ; \
582 fi
583
Tim Edwardscfe970c2021-02-26 14:35:51 -0500584sram-repo:
585 if test "x${SRAM_PATH}" != "x" ; then \
586 if test -d "${SRAM_PATH}" ; then \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400587 echo "Using existing installation of SRAM macro library from ${SRAM_PATH}" ; \
Tim Edwardscfe970c2021-02-26 14:35:51 -0500588 else \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400589 echo "Downloading SRAM macro library from ${SRAM_URL}" ; \
Tim Edwardscfe970c2021-02-26 14:35:51 -0500590 ../scripts/download.sh ${SRAM_URL} ${SRAM_PATH} ; \
591 fi ; \
592 fi
593
594xschem-repo:
595 if test "x${XSCHEM_PATH}" != "x" ; then \
596 if test -d "${XSCHEM_PATH}" ; then \
597 echo "Using existing installation of xschem setup from ${XSCHEM_PATH}" ; \
598 else \
599 echo "Downloading xschem setup from ${XSCHEM_URL}" ; \
600 ../scripts/download.sh ${XSCHEM_URL} ${XSCHEM_PATH} ; \
601 fi ; \
602 fi
603
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400604osu-t12-repo:
605 if test "x${OSU_T12_PATH}" != "x" ; then \
606 if test -d "${OSU_T12_PATH}" ; then \
607 echo "Using existing installation of OSU T12 standard cell library from ${OSU_T12_PATH}" ; \
608 else \
609 echo "Downloading OSU standard T12 cell library from ${OSU_T12_URL}" ; \
610 ../scripts/download.sh ${OSU_T12_URL} ${OSU_T12_PATH} 0 ; \
611 fi ; \
612 fi
613
614osu-t15-repo:
615 if test "x${OSU_T15_PATH}" != "x" ; then \
616 if test -d "${OSU_T15_PATH}" ; then \
617 echo "Using existing installation of OSU T15 standard cell library from ${OSU_T15_PATH}" ; \
618 else \
619 echo "Downloading OSU standard T15 cell library from ${OSU_T15_URL}" ; \
620 ../scripts/download.sh ${OSU_T15_URL} ${OSU_T15_PATH} 0 ; \
621 fi ; \
622 fi
623
624osu-t18-repo:
625 if test "x${OSU_T18_PATH}" != "x" ; then \
626 if test -d "${OSU_T18_PATH}" ; then \
627 echo "Using existing installation of OSU T18 standard cell library from ${OSU_T18_PATH}" ; \
628 else \
629 echo "Downloading OSU standard T18 cell library from ${OSU_T18_URL}" ; \
630 ../scripts/download.sh ${OSU_T18_URL} ${OSU_T18_PATH} 0 ; \
631 fi ; \
632 fi
633
Tim Edwards58b1a922022-01-17 15:55:42 -0500634all-%: prerequisites
635 echo "Starting sky130$* PDK staging on "`date` > ${SKY130$*}_make.log
636 ${MAKE} general-$*
637 ${MAKE} tools-$*
638 ${MAKE} vendor-$*
639 echo "Ended sky130$* PDK staging on "`date` >> ${SKY130$*}_make.log
Tim Edwardscfe970c2021-02-26 14:35:51 -0500640
Tim Edwards58b1a922022-01-17 15:55:42 -0500641general-%: ${TECH}.json
642 mkdir -p ${STAGING_PATH}/${SKY130$*}/${CONFIG_DIR}
643 rm -f ${STAGING_PATH}/${SKY130$*}/${CONFIG_DIR}/nodeinfo.json
644 ${CPP} ${SKY130$*_DEFS} ${COMMIT_DEFS} ${TECH}.json \
645 ${STAGING_PATH}/${SKY130$*}/${CONFIG_DIR}/nodeinfo.json
Tim Edwardscfe970c2021-02-26 14:35:51 -0500646
Tim Edwards58b1a922022-01-17 15:55:42 -0500647tools-A: $(addsuffix -A, $(TOOLS))
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400648
Tim Edwards58b1a922022-01-17 15:55:42 -0500649tools-B: $(addsuffix -B, $(TOOLS))
650
651magic-%: magic/${TECH}.tech magic/${TECH}gds.tech magic/${TECH}.magicrc magic/${TECH}.tcl
652 mkdir -p ${MAGICTOP_STAGING_$*}
653 mkdir -p ${MAGIC_STAGING_$*}
654 rm -f ${MAGICTOP_STAGING_$*}/current
655 rm -f ${MAGIC_STAGING_$*}/${SKY130$*}.tech
656 rm -f ${MAGIC_STAGING_$*}/${SKY130$*}-GDS.tech
657 rm -f ${MAGIC_STAGING_$*}/${SKY130$*}.tcl
658 rm -f ${MAGIC_STAGING_$*}/${SKY130$*}-BindKeys
659 rm -f ${MAGIC_STAGING_$*}/magicrc
Tim Edwards4db522f2021-05-04 13:34:40 -0400660 if test "${EF_STYLE}" == "1" ; then \
Tim Edwards58b1a922022-01-17 15:55:42 -0500661 (cd ${MAGICTOP_STAGING_$*} ; ln -s ${REV_DIR} current) ; \
Tim Edwards9134eed2021-02-13 14:42:59 -0500662 fi
Tim Edwards58b1a922022-01-17 15:55:42 -0500663 cp -rp custom/scripts/seal_ring_generator ${MAGIC_STAGING_$*}/.
664 cp -rp custom/scripts/bump_bond_generator ${MAGIC_STAGING_$*}/.
665 cp custom/scripts/generate_fill.py ${MAGIC_STAGING_$*}/.
666 cp custom/scripts/check_density.py ${MAGIC_STAGING_$*}/.
667 cp custom/scripts/run_standard_drc.py ${MAGIC_STAGING_$*}/.
668 cp custom/scripts/check_antenna.py ${MAGIC_STAGING_$*}/.
669 ${CPP} ${SKY130$*_DEFS} magic/${TECH}.tech ${MAGIC_STAGING_$*}/${SKY130$*}.tech
670 ${CPP} ${SKY130$*_DEFS} magic/${TECH}gds.tech ${MAGIC_STAGING_$*}/${SKY130$*}-GDS.tech
671 ${CPP} ${SKY130$*_DEFS} magic/${TECH}.magicrc ${MAGIC_STAGING_$*}/${SKY130$*}.magicrc
672 ${CPP} ${SKY130$*_DEFS} ../common/pdk.bindkeys ${MAGIC_STAGING_$*}/${SKY130$*}-BindKeys
673 ${CPP} ${SKY130$*_DEFS} magic/${TECH}.tcl ${MAGIC_STAGING_$*}/${SKY130$*}.tcl
674 ${CPP} ${SKY130$*_DEFS} ../common/pdk.tcl >> ${MAGIC_STAGING_$*}/${SKY130$*}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400675
Tim Edwards58b1a922022-01-17 15:55:42 -0500676qflow-%: qflow/${TECH}.sh qflow/${TECH}.par
677 mkdir -p ${QFLOWTOP_STAGING_$*}
678 mkdir -p ${QFLOW_STAGING_$*}
679 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hd.sh
680 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hd.par
681 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hdll.sh
682 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hdll.par
683 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hs.sh
684 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hs.par
685 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hvl.sh
686 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hvl.par
687 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_ls.sh
688 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_ls.par
689 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_lp.sh
690 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_lp.par
691 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_ms.sh
692 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_ms.par
693 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ls.sh
694 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ls.par
695 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ms.sh
696 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ms.par
697 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_hs.sh
698 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_hs.par
699 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ls.sh
700 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ls.par
701 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ms.sh
702 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ms.par
703 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_hs.sh
704 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_hs.par
705 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ls.sh
706 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ls.par
707 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ms.sh
708 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ms.par
709 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_hs.sh
710 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_hs.par
711 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_hd -DVOLTAGE=1v95 \
712 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_hd.sh
713 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_hdll -DVOLTAGE=1v95 \
714 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_hdll.sh
715 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_hvl -DVOLTAGE=4v95 \
716 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_hvl.sh
717 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_hs -DVOLTAGE=1v95 \
718 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_hs.sh
719 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_lp -DVOLTAGE=1v95 \
720 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_lp.sh
721 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_ls -DVOLTAGE=1v95 \
722 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_ls.sh
723 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_ms -DVOLTAGE=1v95 \
724 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_ms.sh
725 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_12t_ls qflow/sky130osu.sh \
726 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ls.sh
727 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_12t_ms qflow/sky130osu.sh \
728 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ms.sh
729 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_12t_hs qflow/sky130osu.sh \
730 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_hs.sh
731 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_15t_ls qflow/sky130osu.sh \
732 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ls.sh
733 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_15t_ms qflow/sky130osu.sh \
734 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ms.sh
735 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_15t_hs qflow/sky130osu.sh \
736 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_hs.sh
737 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_18t_ls qflow/sky130osu.sh \
738 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ls.sh
739 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_18t_ms qflow/sky130osu.sh \
740 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ms.sh
741 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_18t_hs qflow/sky130osu.sh \
742 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_hs.sh
743 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_hd.par
744 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_hdll.par
745 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_hvl.par
746 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_hs.par
747 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_ms.par
748 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_lp.par
749 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_ls.par
750 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
751 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ls.par
752 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
753 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ms.par
754 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
755 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_hs.par
756 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
757 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ls.par
758 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
759 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ms.par
760 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
761 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_hs.par
762 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
763 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ls.par
764 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
765 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ms.par
766 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
767 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_hs.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400768
Tim Edwards58b1a922022-01-17 15:55:42 -0500769netgen-%: netgen/${TECH}_setup.tcl
770 mkdir -p ${NETGENTOP_STAGING_$*}
771 mkdir -p ${NETGEN_STAGING_$*}
772 rm -f ${NETGEN_STAGING_$*}/${SKY130$*}_setup.tcl
773 rm -f ${NETGEN_STAGING_$*}/setup.tcl
774 ${CPP} ${SKY130$*_DEFS} netgen/${TECH}_setup.tcl \
775 ${NETGEN_STAGING_$*}/${SKY130$*}_setup.tcl
776 (cd ${NETGEN_STAGING_$*} ; ln -s ${SKY130$*}_setup.tcl setup.tcl)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400777
Tim Edwards58b1a922022-01-17 15:55:42 -0500778irsim-%: irsim
779 mkdir -p ${IRSIMTOP_STAGING_$*}
780 mkdir -p ${IRSIM_STAGING_$*}
781 rm -f ${IRSIM_STAGING_$*}/${SKY130$*}_*.prm
Tim Edwards6f01cd22022-01-17 19:23:53 -0500782 for corner in ${IRSIM_CORNERS} ; do \
783 cp irsim/sky130A_$$corner.prm \
784 ${IRSIM_STAGING_$*}/${SKY130$*}_$$corner.prm ; \
785 done
Tim Edwards367711e2021-01-27 10:35:12 -0500786
Tim Edwards58b1a922022-01-17 15:55:42 -0500787klayout-%: klayout/${TECH}.lyp klayout/${TECH}.lyt
788 mkdir -p ${KLAYOUTTOP_STAGING_$*}
789 mkdir -p ${KLAYOUT_STAGING_$*}
790 rm -f ${KLAYOUT_STAGING_$*}/${SKY130$*}.lyp
791 rm -f ${KLAYOUT_STAGING_$*}/${SKY130$*}.lyt
792 ${CPP} -utf8 ${SKY130$*_DEFS} klayout/${TECH}.lyp \
793 ${KLAYOUT_STAGING_$*}/${SKY130$*}.lyp
794 ${CPP} -utf8 ${SKY130$*_DEFS} klayout/${TECH}.lyt \
795 ${KLAYOUT_STAGING_$*}/${SKY130$*}.lyt
796 ${CPP} -utf8 ${SKY130$*_DEFS} klayout/${TECH}.lydrc \
797 ${KLAYOUT_STAGING_$*}/${SKY130$*}.lydrc
798 #./custom/scripts/gen_run_drc.py -l ${KLAYOUT_STAGING_$*}/${SKY130$*}.lydrc \
799 # -o ${KLAYOUT_STAGING_$*}/${SKY130$*}.drc
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400800
Tim Edwards58b1a922022-01-17 15:55:42 -0500801xcircuit-%: xcircuit/${TECH}.xcircuitrc
802 rm -rf ${XCIRCUIT_STAGING_$*}
803 mkdir -p ${XCIRCUITTOP_STAGING_$*}
804 mkdir -p ${XCIRCUIT_STAGING_$*}
805 rm -f ${XCIRCUIT_STAGING_$*}/*.lps
806 rm -f ${XCIRCUIT_STAGING_$*}/${SKY130$*}.xcircuitrc
807 ${CPP} ${SKY130$*_DEFS} xcircuit/ngspice.lps ${XCIRCUIT_STAGING_$*}/ngspice.lps
808 ${CPP} ${SKY130$*_DEFS} xcircuit/sky130_fd_pr.lps \
809 ${XCIRCUIT_STAGING_$*}/sky130_fd_pr.lps
810 ${CPP} ${SKY130$*_DEFS} -DHD_SPICE=${HD_SPICE} -DSPIEXT=${SPIEXT} \
811 xcircuit/sky130_fd_sc_hd.lps ${XCIRCUIT_STAGING_$*}/sky130_fd_sc_hd.lps
812 ${CPP} ${SKY130$*_DEFS} xcircuit/${TECH}.xcircuitrc \
813 ${XCIRCUIT_STAGING_$*}/${SKY130$*}.xcircuitrc
Tim Edwardse4c44092021-02-12 10:18:56 -0500814
Tim Edwards476f7422021-12-16 19:59:35 -0500815
816
817
Tim Edwards58b1a922022-01-17 15:55:42 -0500818xschem-%: ${XSCHEM_PATH}
819 rm -rf ${XSCHEM_STAGING_$*}
820 mkdir -p ${XSCHEMTOP_STAGING_$*}
821 mkdir -p ${XSCHEM_STAGING_$*}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500822 # Copy the entire repository (other than .git, if it exists)
823 if test "x${XSCHEM_PATH}" != "x" ; then \
Tim Edwards58b1a922022-01-17 15:55:42 -0500824 cp -rp ${XSCHEM_PATH}/* ${XSCHEM_STAGING_$*} ; \
Tim Edwards1168a8b2021-02-10 22:06:54 -0500825 fi
Tim Edwards503d53e2021-07-19 21:33:34 -0400826
827 #add the correct libraries into the test files
Tim Edwards58b1a922022-01-17 15:55:42 -0500828 for file in ${XSCHEM_STAGING_$*}/sky130_tests/* ; do \
Tim Edwards476f7422021-12-16 19:59:35 -0500829 ${SED} -i '/.include $$\:\:SKYWATER_MODELS/d' $$file ; \
830 grep -zl 'sky130.lib.spice' $$file || ${SED} -z 's|format="tcleval( @value )"\nvalue="|format="tcleval( @value )"\nvalue="\n.lib $$\:\:SKYWATER_MODELS/sky130.lib.spice tt |' -i $$file ; \
Tim Edwards503d53e2021-07-19 21:33:34 -0400831 done
832
Tim Edwards9a17fca2021-02-11 17:44:04 -0500833 # Re-copy the xschemrc, with one change to add the PDK install path as
834 # a component of XSCHEM_LIBRARY_PATH
835 cat ${XSCHEM_PATH}/xschemrc | \
Tim Edwards58b1a922022-01-17 15:55:42 -0500836 ${SED} -e "/PWD/aappend XSCHEM_LIBRARY_PATH :${XSCHEM_STAGING_$*}" | \
Tim Edwards476f7422021-12-16 19:59:35 -0500837 ${SED} -e '/netlist_dir/aset netlist_dir $$env(PWD)' | \
Tim Edwards58b1a922022-01-17 15:55:42 -0500838 ${SED} -e "/SKYWATER_MODELS/s#~/pdks/sky130$*/libs.tech/ngspice#${NGSPICE_STAGING_$*}#" | \
839 ${SED} -e "/SKYWATER_STDCELLS/s#~/pdks/sky130$*/libs.ref/sky130_fd_sc_hd/spice#${STAGING_PATH}/${SKY130$*}/libs.ref/${HD_SPICE}#" \
840 > ${XSCHEM_STAGING_$*}/xschemrc
Tim Edwards476f7422021-12-16 19:59:35 -0500841
Tim Edwards58b1a922022-01-17 15:55:42 -0500842openlane-%: openlane/config.tcl openlane/rcx_rules.info openlane/sky130_fd_sc_hd/config.tcl openlane/sky130_fd_sc_hs/config.tcl openlane/sky130_fd_sc_ms/config.tcl openlane/sky130_fd_sc_ls/config.tcl openlane/sky130_fd_sc_hdll/config.tcl openlane/sky130_osu_sc_t18/config.tcl
843 mkdir -p ${OPENLANETOP_STAGING_$*}
844 mkdir -p ${OPENLANE_STAGING_$*}
845 rm -rf ${OPENLANE_STAGING_$*}/custom_cells/*
846 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_hd
847 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_hs
848 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_ls
849 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_ms
850 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_hdll
851 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_hvl
852 mkdir -p ${OPENLANE_STAGING_$*}/sky130_osu_sc_t18
853 rm -f ${OPENLANE_STAGING_$*}/common_pdn.info
854 rm -f ${OPENLANE_STAGING_$*}/config.tcl
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500855 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500856 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_hd/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500857 done
858 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500859 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_hs/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500860 done
861 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500862 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_hdll/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500863 done
864 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500865 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_ls/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500866 done
867 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500868 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_ms/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500869 done
870 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500871 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_hvl/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500872 done
873 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500874 rm -f ${OPENLANE_STAGING_$*}/sky130_osu_sc_t18/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500875 done
876
Tim Edwards58b1a922022-01-17 15:55:42 -0500877 cp -r openlane/custom_cells ${OPENLANE_STAGING_$*}
878 ${CPP} ${SKY130$*_DEFS} openlane/config.tcl ${OPENLANE_STAGING_$*}/config.tcl
879 ${CPP} ${SKY130$*_DEFS} openlane/rcx_rules.info ${OPENLANE_STAGING_$*}/rcx_rules.info
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500880
881 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500882 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_hd/$$file \
883 ${OPENLANE_STAGING_$*}/sky130_fd_sc_hd/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500884 done
885 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500886 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_hs/$$file \
887 ${OPENLANE_STAGING_$*}/sky130_fd_sc_hs/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500888 done
889 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500890 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_ms/$$file \
891 ${OPENLANE_STAGING_$*}/sky130_fd_sc_ms/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500892 done
893 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500894 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_ls/$$file \
895 ${OPENLANE_STAGING_$*}/sky130_fd_sc_ls/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500896 done
897 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500898 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_hdll/$$file \
899 ${OPENLANE_STAGING_$*}/sky130_fd_sc_hdll/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500900 done
901 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -0500902 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_hvl/$$file \
903 ${OPENLANE_STAGING_$*}/sky130_fd_sc_hvl/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500904 done
905
Tim Edwards58b1a922022-01-17 15:55:42 -0500906 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_osu_sc_t18/config.tcl \
907 ${OPENLANE_STAGING_$*}/sky130_osu_sc_t18/config.tcl
908 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_osu_sc_t18/tracks.info \
909 ${OPENLANE_STAGING_$*}/sky130_osu_sc_t18/tracks.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400910
Tim Edwards58b1a922022-01-17 15:55:42 -0500911vendor-%:
Tim Edwardsdaad1062021-05-19 10:51:27 -0400912 # Build targets conditionally based on what repositories or submodules
913 # were selected or initialized. To be done: Allow a library version
914 # to be specified that overrides "latest".
915 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_pr/latest/cells ; then \
916 echo "Building primitives library and simulation models" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500917 make primitive-$*;\
Tim Edwardsdaad1062021-05-19 10:51:27 -0400918 fi
919 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_io/latest/cells ; then \
920 echo "Building padframe I/O libraries" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500921 make io-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -0400922 fi
923 # This assumes that at least the HD library submodule exists. Also it
924 # assumes that the same library version is used for all libraries, which
925 # is fine with "latest" but otherwise probably invalid.
926 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_hd/latest/cells ; then \
Tim Edwardsf1b28a02021-09-08 13:56:44 -0400927 echo "Building digital high-density standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500928 make digital-hd-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -0400929 fi
930 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_hvl/latest/cells ; then \
931 echo "Building digital high-voltage standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500932 make digital-hvl-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -0400933 fi
934 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_hdll/latest/cells ; then \
935 echo "Building digital high-density low-leakage standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500936 make digital-hdll-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -0400937 fi
938 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_lp/latest/cells ; then \
939 echo "Building digital low-power standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500940 make digital-lp-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -0400941 fi
942 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_hs/latest/cells ; then \
943 echo "Building digital high-speed standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500944 make digital-hs-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -0400945 fi
946 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_ms/latest/cells ; then \
947 echo "Building digital medium-speed standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500948 make digital-ms-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -0400949 fi
950 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_ls/latest/cells ; then \
951 echo "Building digital low-speed standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500952 make digital-ls-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -0400953 fi
Tim Edwardse5e43b52021-09-08 11:46:04 -0400954 if test "x${ALPHA_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -0400955 echo "Building alphanumeric layout libraries" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500956 make alpha-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -0400957 fi
Tim Edwardse5e43b52021-09-08 11:46:04 -0400958 if test "x${SRAM_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -0400959 echo "Building SRAM macro library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500960 make sram-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -0400961 fi
Tim Edwardse5e43b52021-09-08 11:46:04 -0400962 if test "x${OSU_T12_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -0400963 echo "Building OSU 12-track-high standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500964 make osu-t12-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -0400965 fi
Tim Edwardse5e43b52021-09-08 11:46:04 -0400966 if test "x${OSU_T15_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -0400967 echo "Building OSU 15-track-high standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500968 make osu-t15-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -0400969 fi
Tim Edwardse5e43b52021-09-08 11:46:04 -0400970 if test "x${OSU_T18_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -0400971 echo "Building OSU 18-track-high standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -0500972 make osu-t18-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -0400973 fi
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400974
Tim Edwards58b1a922022-01-17 15:55:42 -0500975primitive-%:
Tim Edwards106e38b2020-09-20 13:07:54 -0400976 # Install device subcircuits from vendor files
Tim Edwards58b1a922022-01-17 15:55:42 -0500977 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards995c1332020-09-25 15:33:58 -0400978 -ngspice sky130_fd_pr/latest/models/* \
Tim Edwardsfd20a0a2021-08-31 19:58:51 -0400979 filter=custom/scripts/rename_models.py \
Tim Edwards58b1a922022-01-17 15:55:42 -0500980 2>&1 | tee -a ${SKY130$*}_make.log
Tim 'mithro' Ansell3c6913c2021-06-13 10:35:33 -0700981 # Install device layouts from custom sources
Tim Edwards58b1a922022-01-17 15:55:42 -0500982 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards7e294962021-05-04 20:33:17 -0400983 -gds sky130_fd_pr/*.gds \
984 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -0500985 -library primitive sky130_fd_pr 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwards4697a172021-11-05 22:47:07 -0400986 # Install base device library from vendor files.
Tim Edwards58b1a922022-01-17 15:55:42 -0500987 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards7e294962021-05-04 20:33:17 -0400988 -gds %l/latest/cells/*/*.gds \
Tim Edwards4697a172021-11-05 22:47:07 -0400989 no-copy=custom/sky130_fd_pr/*.gds \
990 include=custom/sky130_fd_pr/*.gds \
Tim Edwards7e294962021-05-04 20:33:17 -0400991 compile-only \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -0400992 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards106e38b2020-09-20 13:07:54 -0400993 -cdl %l/latest/cells/*/*.cdl compile-only \
994 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwardsbfc82692020-09-20 21:33:08 -0400995 -spice %l/latest/cells/*/*.spice filter=custom/scripts/rename_cells.py \
Tim Edwards58b1a922022-01-17 15:55:42 -0500996 -library primitive sky130_fd_pr 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse60b4862020-11-23 16:56:52 -0500997 # Custom: Add "short" resistor model and subcircuit to the r+c models file
Tim Edwards42f79a32020-09-21 14:18:09 -0400998 cat ./custom/models/short.spice >> \
Tim Edwards58b1a922022-01-17 15:55:42 -0500999 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -05001000 # Custom: Add diodes as subcircuits to the r+c models file
1001 cat ./custom/models/diode.spice >> \
Tim Edwards58b1a922022-01-17 15:55:42 -05001002 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardsf63ee052021-04-29 15:13:45 -04001003 # Custom: Add resistors as subcircuits to the r+c models file
1004 cat ./custom/models/resistor.spice >> \
Tim Edwards58b1a922022-01-17 15:55:42 -05001005 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -05001006
Tim Edwards9134eed2021-02-13 14:42:59 -05001007 # Custom: Patch the models to work around ngspice issue with the relative
1008 # order of the "nf" and "mult" parameters.
Tim Edwards58b1a922022-01-17 15:55:42 -05001009 patch -p4 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE} \
Tim Edwards9134eed2021-02-13 14:42:59 -05001010 < custom/patches/sky130_fd_pr.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001011 2>&1 | tee -a ${SKY130$*}_make.log || true
1012 patch -p1 -f -d ${STAGING_PATH}/${SKY130$*} \
Tim Edwards25972f82021-04-27 21:45:58 -04001013 < custom/patches/sky130_fd_pr_2.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001014 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf499ad22021-05-04 16:55:21 -04001015 # Custom: Patch the models to remove the substrate pin from the PNP
1016 # device, which has no independent substrate pin (collector=substrate)
Tim Edwards58b1a922022-01-17 15:55:42 -05001017 patch -p4 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE} \
Tim Edwardsf499ad22021-05-04 16:55:21 -04001018 < custom/patches/sky130_fd_pr_3.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001019 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf63ee052021-04-29 15:13:45 -04001020 # Custom: Patch the ngspice models to add the HV diffusion resistor subcircuits
Tim Edwards58b1a922022-01-17 15:55:42 -05001021 patch -p2 -f -d ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice \
Tim Edwardsf63ee052021-04-29 15:13:45 -04001022 < custom/patches/sky130_fd_pr_5.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001023 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf499ad22021-05-04 16:55:21 -04001024 # Fix up the PNP model file before running the next modification
Tim Edwards58b1a922022-01-17 15:55:42 -05001025 head -15 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__pnp_05v5_W3p40L3p40.model.spice > ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/temp
1026 tail -39 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__pnp_05v5_W3p40L3p40.model.spice >> ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/temp
1027 mv ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/temp ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__pnp_05v5_W3p40L3p40.model.spice
Tim Edwardsb0cb0872021-08-27 09:43:55 -04001028 # Custom: Add the PNP 3.4x3.4um device model to the includes in "all.spice"
Tim Edwards8b5d6942021-09-08 11:12:50 -04001029 ./custom/scripts/fix_spice_includes.py ${EF_FORMAT} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001030 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/all.spice \
1031 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards9fdf5f02021-05-03 16:15:03 -04001032 # Custom: Parse the (commented out) statistics blocks and generate
1033 # ngspice-compatible monte carlo parameters for mismatch and process
Tim Edwards8b5d6942021-09-08 11:12:50 -04001034 ./custom/scripts/mismatch_params.py ${EF_FORMAT} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001035 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards8b5d6942021-09-08 11:12:50 -04001036 ./custom/scripts/mismatch_params.py ${EF_FORMAT} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001037 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice \
1038 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards00bfca52021-05-04 10:48:46 -04001039 ./custom/scripts/process_params.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001040 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards33ce97a2021-05-24 20:51:28 -04001041 ./custom/scripts/montecarlo_hack.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001042 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards1c74f852021-06-09 16:46:50 -04001043 # Custom: Change vt to local_vt in one file for Xyce compatibilty
1044 ./custom/scripts/xyce_hack.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001045 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__res_iso_pw.model.spice \
1046 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsc12c7952021-08-26 11:23:42 -04001047 # Custom: Remove ACM model parameters from BSIM3 devices
1048 ./custom/scripts/xyce_hack2.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001049 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__special_nfet_pass.pm3.spice \
1050 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsc12c7952021-08-26 11:23:42 -04001051 ./custom/scripts/xyce_hack2.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001052 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__special_pfet_pass.pm3.spice \
1053 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsc12c7952021-08-26 11:23:42 -04001054 ./custom/scripts/xyce_hack2.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001055 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__special_nfet_latch.pm3.spice \
1056 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsc12c7952021-08-26 11:23:42 -04001057
Tim Edwards3c8f63a2021-09-14 11:05:48 -04001058 # Install custom corrected/enhanced sky130.lib.spice
1059 cp custom/models/sky130.lib.spice \
Tim Edwards58b1a922022-01-17 15:55:42 -05001060 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice \
1061 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards956e3022021-05-27 20:43:26 -04001062 # Custom: Add special device ID layers to bipolar layouts in magic
1063 # to make the extraction models correct.
Tim Edwards8b5d6942021-09-08 11:12:50 -04001064 ./custom/scripts/add_bipolar_ids.py ${EF_FORMAT} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001065 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards9fdf5f02021-05-03 16:15:03 -04001066
Tim Edwards10aa9ab2021-03-15 17:46:29 -04001067 # Custom: Add "spinit" file
1068 cat ./custom/models/spinit >> \
Tim Edwards58b1a922022-01-17 15:55:42 -05001069 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/spinit
Tim Edwards10aa9ab2021-03-15 17:46:29 -04001070
Tim Edwards58b1a922022-01-17 15:55:42 -05001071io-%:
Ahmed Ghazy59370ab2020-10-29 02:04:45 +02001072 # Install custom additions to I/O pad library
Tim Edwards58b1a922022-01-17 15:55:42 -05001073 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsb063d372021-11-12 16:15:18 -05001074 -verilog %l/verilog/*.v compile-only rename=sky130_ef_io \
Ahmed Ghazy59370ab2020-10-29 02:04:45 +02001075 -cdl %l/cdl/*.cdl \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001076 -spice %l/spice/*.spice \
Tim Edwards89f6ff42021-12-02 09:48:21 -05001077 -lib %l/lib/*.lib \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -04001078 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
Tim Edwardsb063d372021-11-12 16:15:18 -05001079 -lef %l/lef/*.lef exclude=sky130_fd_io__top_xres4v2.lef \
1080 compile-only rename=sky130_ef_io \
1081 -lef %l/lef/sky130_fd_io__top_xres4v2.lef \
Tim Edwards58b1a922022-01-17 15:55:42 -05001082 -library general sky130_fd_io 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001083 # Install SkyWater I/O pad library
Tim Edwards58b1a922022-01-17 15:55:42 -05001084 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards1134fbc2020-10-12 22:35:42 -04001085 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
Tim Edwards4697a172021-11-05 22:47:07 -04001086 include=custom/sky130_fd_io/cdl/*.cdl \
emayecscbcb4652021-08-30 21:29:20 -04001087 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001088 -lef %l/latest/cells/*/*.lef annotate lefopts=-hide compile-only \
1089 no-copy=sky130_fd_io__top_xres4v2.lef \
1090 include=sky130_fd_io__top_xres4v2.lef \
Tim Edwards91ddc9a2021-06-24 22:50:30 -04001091 exclude=*.magic.lef,sky130_ef_io.lef \
emayecscbcb4652021-08-30 21:29:20 -04001092 sort=../common/sort_pdkfiles.py \
Tim Edwards1134fbc2020-10-12 22:35:42 -04001093 -doc %l/latest/cells/*/*.pdf \
1094 -lib %l/latest/timing/*.lib \
1095 -gds %l/latest/cells/*/*.gds compile-only \
emayecscbcb4652021-08-30 21:29:20 -04001096 sort=../common/sort_pdkfiles.py \
Tim Edwards26ab4962021-01-03 14:22:54 -05001097 options=custom/scripts/sky130_fd_io_import.tcl \
Tim Edwardsc9792022021-11-15 17:51:05 -05001098 -verilog %l/latest/cells/*/*.*.v \
Tim Edwardsb063d372021-11-12 16:15:18 -05001099 -verilog %l/latest/cells/*/*.v exclude=*.*.v,sky130_ef_io.v \
Tim Edwards1134fbc2020-10-12 22:35:42 -04001100 compile-only filter=custom/scripts/inc_verilog.py \
emayecscbcb4652021-08-30 21:29:20 -04001101 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001102 -library general sky130_fd_io 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwards1134fbc2020-10-12 22:35:42 -04001103 # Remove the base verilog files which have already been included into
1104 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001105 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_VERILOG}/*.*.v
Tim Edwardsf35c6072021-06-15 16:00:27 -04001106 # Add a maskhint set for the GPIO pad .mag view to prevent problems writing
1107 # when writing HVI to GDS during hierarchical adjustments.
Tim Edwards58b1a922022-01-17 15:55:42 -05001108 ${ADDPROP} ${STAGING_PATH}/${SKY130$*} sky130_fd_io sky130_fd_io__top_gpiov2 \
Tim Edwardsf35c6072021-06-15 16:00:27 -04001109 "MASKHINTS_HVI 1346 17198 5828 19224 13700 1890 15920 2360 24 17522 1778 20612" -mag
1110
Tim Edwards58b1a922022-01-17 15:55:42 -05001111digital-hd-%:
Tim Edwardsaac3d1a2021-06-15 16:37:10 -04001112 # Install custom additions to standard cell libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001113 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsaac3d1a2021-06-15 16:37:10 -04001114 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
1115 -lef %l/lef/*.lef \
1116 -verilog %l/verilog/*.v \
Tim Edwards58b1a922022-01-17 15:55:42 -05001117 -library digital sky130_fd_sc_hd 2>&1 | tee -a ${SKY130$*}_make.log
Ahmed Ghazya285ff42020-07-27 17:52:14 +02001118 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001119 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001120 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -04001121 -spice %l/latest/cells/*/*.spice compile-only \
emayecscbcb4652021-08-30 21:29:20 -04001122 sort=../common/sort_pdkfiles.py \
Tim Edwards99a5cf92021-05-16 16:42:49 -04001123 filter=custom/scripts/fix_device_models.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -04001124 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
emayecscbcb4652021-08-30 21:29:20 -04001125 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001126 -lef %l/latest/cells/*/*.lef \
1127 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwards4697a172021-11-05 22:47:07 -04001128 include=custom/sky130_fd_sc_hd/lef/sky130_ef*.lef \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001129 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001130 annotate compile-only \
emayecscbcb4652021-08-30 21:29:20 -04001131 sort=../common/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -04001132 -doc %l/latest/cells/*/*.pdf \
Tim Edwards7ea41662021-10-29 18:46:38 -04001133 -lib %l/latest/timing/*.lib filter=custom/scripts/add_wireloads.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -04001134 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards4697a172021-11-05 22:47:07 -04001135 no-copy=custom/sky130_fd_sc_hd/gds/sky130_fd*.gds \
1136 include=custom/sky130_fd_sc_hd/gds/sky130_ef*.gds \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -04001137 options=custom/scripts/gds_import_setup.tcl \
emayecscbcb4652021-08-30 21:29:20 -04001138 sort=../common/sort_pdkfiles.py \
Tim Edwards4697a172021-11-05 22:47:07 -04001139 -verilog %l/latest/models/*/*.v \
1140 exclude=*.*.v include=custom/sky130_fd_sc_hd/verilog/*.v \
1141 compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -04001142 rename=primitives filter=custom/scripts/inc_verilog.py \
emayecscbcb4652021-08-30 21:29:20 -04001143 sort=../common/sort_pdkfiles.py \
Tim Edwards995c1332020-09-25 15:33:58 -04001144 -verilog %l/latest/cells/*/*.*.v \
1145 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1146 compile-only filter=custom/scripts/inc_verilog.py \
emayecscbcb4652021-08-30 21:29:20 -04001147 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001148 -library digital sky130_fd_sc_hd 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001149 # Add a maskhint set for the tap cell .mag view to prevent problems writing
Tim Edwards16a9caa2021-01-08 13:10:06 -05001150 # when writing NSDM and PSDM to GDS during hierarchical adjustments.
Tim Edwards22f014d2022-01-26 10:37:03 -05001151 ${ADDPROP} ${STAGING_PATH}/${SKY130$*} sky130_fd_sc_hd \
1152 sky130_fd_sc_hd__tapvpwrvgnd_1 \
Tim Edwards772de8c2022-01-19 14:02:04 -05001153 "MASKHINTS_PSDM 0 38 92 195" -mag
Tim Edwards22f014d2022-01-26 10:37:03 -05001154 ${ADDPROP} ${STAGING_PATH}/${SKY130$*} sky130_fd_sc_hd \
1155 sky130_fd_sc_hd__tapvpwrvgnd_1 \
Tim Edwards772de8c2022-01-19 14:02:04 -05001156 "MASKHINTS_NSDM 0 279 92 506" -mag
Tim Edwards22f014d2022-01-26 10:37:03 -05001157 # Quick solution to extraction issue---connect VNB label pwell to rest
1158 ${ADDLAYER} ${STAGING_PATH}/${SKY130$*} sky130_fd_sc_hd \
1159 sky130_fd_sc_hd__a21bo_1 \
1160 pwell "29 17 69 157" -mag
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001161 # Remove the base verilog files which have already been included into
1162 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001163 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${HD_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001164 # Apply extra PDK patches until they get fixed properly in the source
Tim Edwards58b1a922022-01-17 15:55:42 -05001165 patch -p1 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${HD_TECHLEF} \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001166 < custom/patches/hd_minenclosed.squeaky.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001167 2>&1 | tee -a ${SKY130$*}_make.log || true
1168 patch -p1 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${HD_VERILOG} \
Tim Edwards24f29502021-10-13 15:49:00 -04001169 < custom/patches/hd_wire_syntax.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001170 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001171
Tim Edwards58b1a922022-01-17 15:55:42 -05001172digital-hdll-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001173 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001174 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001175 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001176 -spice %l/latest/cells/*/*.spice compile-only \
1177 sort=../common/sort_pdkfiles.py \
1178 filter=custom/scripts/fix_device_models.py \
1179 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1180 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001181 -lef %l/latest/cells/*/*.lef annotate compile-only \
1182 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001183 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001184 sort=../common/sort_pdkfiles.py \
1185 -doc %l/latest/cells/*/*.pdf \
Tim Edwards7ea41662021-10-29 18:46:38 -04001186 -lib %l/latest/timing/*.lib custom/scripts/add_wireloads.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001187 -gds %l/latest/cells/*/*.gds compile-only \
1188 options=custom/scripts/gds_import_setup.tcl \
1189 sort=../common/sort_pdkfiles.py \
1190 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1191 rename=primitives filter=custom/scripts/inc_verilog.py \
1192 sort=../common/sort_pdkfiles.py \
1193 -verilog %l/latest/cells/*/*.*.v \
1194 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1195 compile-only filter=custom/scripts/inc_verilog.py \
1196 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001197 -library digital sky130_fd_sc_hdll 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001198 # Remove the base verilog files which have already been included into
1199 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001200 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${HDLL_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001201 # Apply extra PDK patches until they get fixed properly in the source
Tim Edwards58b1a922022-01-17 15:55:42 -05001202 patch -p1 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${HDLL_TECHLEF} \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001203 < custom/patches/hdll_minenclosed.squeaky.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001204 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001205
Tim Edwards58b1a922022-01-17 15:55:42 -05001206digital-hvl-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001207 # Install custom additions to standard cell libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001208 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001209 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
Tim Edwards11fb9302021-12-28 21:26:02 -05001210 -spice %l/spice/*.spice \
Tim Edwards58b1a922022-01-17 15:55:42 -05001211 -library digital sky130_fd_sc_hvl 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001212 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001213 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001214 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001215 -spice %l/latest/cells/*/*.spice compile-only \
Tim Edwards11fb9302021-12-28 21:26:02 -05001216 no-copy=custom/sky130_fd_sc_hvl/spice/sky130_fd*.spice \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001217 sort=../common/sort_pdkfiles.py \
1218 filter=custom/scripts/fix_device_models.py \
1219 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1220 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001221 -lef %l/latest/cells/*/*.lef annotate compile-only \
1222 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001223 sort=../common/sort_pdkfiles.py \
1224 -doc %l/latest/cells/*/*.pdf \
Tim Edwards7ea41662021-10-29 18:46:38 -04001225 -lib %l/latest/timing/*.lib custom/scripts/add_wireloads.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001226 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards4697a172021-11-05 22:47:07 -04001227 include=custom/sky130_fd_sc_hvl/gds/sky130_ef*.gds \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001228 options=custom/scripts/gds_import_setup.tcl \
1229 sort=../common/sort_pdkfiles.py \
1230 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1231 rename=primitives filter=custom/scripts/inc_verilog.py \
1232 sort=../common/sort_pdkfiles.py \
1233 -verilog %l/latest/cells/*/*.*.v \
1234 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1235 compile-only filter=custom/scripts/inc_verilog.py \
1236 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001237 -library digital sky130_fd_sc_hvl 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf6a94bd2021-06-01 11:02:58 -04001238 # Add a maskhint to the HVL level shifter to represent the HVI layer as
1239 # drawn in the GDS, and so eliminate the HVI-to-nwell DRC error.
Tim Edwards58b1a922022-01-17 15:55:42 -05001240 ${ADDPROP} ${STAGING_PATH}/${SKY130$*} sky130_fd_sc_hvl sky130_fd_sc_hvl__lsbufhv2lv_1 \
Tim Edwardsf6a94bd2021-06-01 11:02:58 -04001241 "MASKHINTS_HVI 22 34 706 1316" -mag
Tim Edwards995c1332020-09-25 15:33:58 -04001242 # Remove the base verilog files which have already been included into
1243 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001244 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${HVL_VERILOG}/*.*.v
Tim Edwardsf63ee052021-04-29 15:13:45 -04001245 # Custom: Patch the HVL library to correct the resistor device names
Tim Edwards58b1a922022-01-17 15:55:42 -05001246 patch -p3 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${HVL_SPICE} \
Tim Edwards16b050b2021-05-17 16:45:34 -04001247 < custom/patches/sky130_fd_pr_${HVL_PATCH4}.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001248 2>&1 | tee -a ${SKY130$*}_make.log || true
1249 patch -p3 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${HVL_CDL} \
Tim Edwardsf63ee052021-04-29 15:13:45 -04001250 < custom/patches/sky130_fd_pr_6.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001251 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001252
Tim Edwards58b1a922022-01-17 15:55:42 -05001253digital-lp-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001254 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001255 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001256 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001257 -spice %l/latest/cells/*/*.spice compile-only \
1258 sort=../common/sort_pdkfiles.py \
1259 filter=custom/scripts/fix_device_models.py \
1260 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1261 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001262 -lef %l/latest/cells/*/*.lef annotate compile-only \
1263 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001264 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001265 sort=../common/sort_pdkfiles.py \
1266 -doc %l/latest/cells/*/*.pdf \
Tim Edwards7ea41662021-10-29 18:46:38 -04001267 -lib %l/latest/timing/*.lib custom/scripts/add_wireloads.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001268 -gds %l/latest/cells/*/*.gds compile-only \
1269 options=custom/scripts/gds_import_setup.tcl \
1270 sort=../common/sort_pdkfiles.py \
1271 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1272 rename=primitives filter=custom/scripts/inc_verilog.py \
1273 sort=../common/sort_pdkfiles.py \
1274 -verilog %l/latest/cells/*/*.*.v \
1275 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1276 compile-only filter=custom/scripts/inc_verilog.py \
1277 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001278 -library digital sky130_fd_sc_lp 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001279 # Remove the base verilog files which have already been included into
1280 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001281 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${LP_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001282
Tim Edwards58b1a922022-01-17 15:55:42 -05001283digital-hs-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001284 # Install custom additions to standard cell libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001285 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001286 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001287 -library digital sky130_fd_sc_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001288 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001289 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001290 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001291 -spice %l/latest/cells/*/*.spice compile-only \
1292 sort=../common/sort_pdkfiles.py \
1293 filter=custom/scripts/fix_device_models.py \
1294 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1295 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001296 -lef %l/latest/cells/*/*.lef annotate compile-only \
1297 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001298 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001299 sort=../common/sort_pdkfiles.py \
1300 -doc %l/latest/cells/*/*.pdf \
Tim Edwards7ea41662021-10-29 18:46:38 -04001301 -lib %l/latest/timing/*.lib custom/scripts/add_wireloads.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001302 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards4697a172021-11-05 22:47:07 -04001303 no-copy=custom/sky130_fd_sc_hs/gds/sky130_fd*.gds \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001304 options=custom/scripts/gds_import_setup.tcl \
1305 sort=../common/sort_pdkfiles.py \
1306 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1307 rename=primitives filter=custom/scripts/inc_verilog.py \
1308 sort=../common/sort_pdkfiles.py \
1309 -verilog %l/latest/cells/*/*.*.v \
1310 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1311 compile-only filter=custom/scripts/inc_verilog.py \
1312 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001313 -library digital sky130_fd_sc_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001314 # Remove the base verilog files which have already been included into
1315 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001316 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${HS_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001317
Tim Edwards58b1a922022-01-17 15:55:42 -05001318digital-ms-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001319 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001320 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001321 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001322 -spice %l/latest/cells/*/*.spice compile-only \
1323 sort=../common/sort_pdkfiles.py \
1324 filter=custom/scripts/fix_device_models.py \
1325 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1326 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001327 -lef %l/latest/cells/*/*.lef annotate compile-only \
1328 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001329 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001330 sort=../common/sort_pdkfiles.py \
1331 -doc %l/latest/cells/*/*.pdf \
Tim Edwards7ea41662021-10-29 18:46:38 -04001332 -lib %l/latest/timing/*.lib custom/scripts/add_wireloads.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001333 -gds %l/latest/cells/*/*.gds compile-only \
1334 options=custom/scripts/gds_import_setup.tcl \
1335 sort=../common/sort_pdkfiles.py \
1336 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1337 rename=primitives filter=custom/scripts/inc_verilog.py \
1338 sort=../common/sort_pdkfiles.py \
1339 -verilog %l/latest/cells/*/*.*.v \
1340 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1341 compile-only filter=custom/scripts/inc_verilog.py \
1342 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001343 -library digital sky130_fd_sc_ms 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001344 # Remove the base verilog files which have already been included into
1345 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001346 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${MS_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001347
Tim Edwards58b1a922022-01-17 15:55:42 -05001348digital-ls-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001349 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001350 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001351 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001352 -spice %l/latest/cells/*/*.spice compile-only \
1353 sort=../common/sort_pdkfiles.py \
1354 filter=custom/scripts/fix_device_models.py \
1355 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1356 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001357 -lef %l/latest/cells/*/*.lef annotate compile-only \
1358 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsb8c95cb2021-12-07 14:39:07 -05001359 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001360 sort=../common/sort_pdkfiles.py \
1361 -doc %l/latest/cells/*/*.pdf \
Tim Edwards7ea41662021-10-29 18:46:38 -04001362 -lib %l/latest/timing/*.lib custom/scripts/add_wireloads.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001363 -gds %l/latest/cells/*/*.gds compile-only \
1364 options=custom/scripts/gds_import_setup.tcl \
1365 sort=../common/sort_pdkfiles.py \
1366 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1367 rename=primitives filter=custom/scripts/inc_verilog.py \
1368 sort=../common/sort_pdkfiles.py \
1369 -verilog %l/latest/cells/*/*.*.v \
1370 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1371 compile-only filter=custom/scripts/inc_verilog.py \
1372 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001373 -library digital sky130_fd_sc_ls 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001374 # Remove the base verilog files which have already been included into
1375 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001376 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${LS_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001377
Tim Edwards58b1a922022-01-17 15:55:42 -05001378alpha-%:
Tim Edwardsbcf59aa2020-12-17 16:55:13 -05001379 # Install alphanumeric library.
Tim Edwards58b1a922022-01-17 15:55:42 -05001380 ${STAGE} -source ${ALPHA_PATH}/.. -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards88bd42e2020-12-18 15:29:48 -05001381 -mag %l/mag/*.mag filter=custom/scripts/text2m5.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001382 -library general sky130_ml_xx_hd 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001383 # Install text2mag.py script for alphanumeric library
Tim Edwards58b1a922022-01-17 15:55:42 -05001384 mkdir -p ${STAGING_PATH}/${SKY130$*}/libs.ref/${MLXX_SCRIPTS}
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001385 cp custom/scripts/text2mag.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001386 ${STAGING_PATH}/${SKY130$*}/libs.ref/${MLXX_SCRIPTS}
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001387
Tim Edwards58b1a922022-01-17 15:55:42 -05001388sram-%:
Tim Edwards8b96a1b2021-04-27 15:16:26 -04001389 # Install SRAM library. NOTE: SRAM macros share some of the same
1390 # cell names, so use special option script gds_import_sram.tcl
Tim Edwards68fc4e62021-06-12 22:31:21 -04001391 # To do: Add option to process each GDS file individually in magic,
1392 # instead of all at once.
Tim Edwards58b1a922022-01-17 15:55:42 -05001393 ${STAGE} -source ${SRAM_PATH}/.. -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardscfe970c2021-02-26 14:35:51 -05001394 -lef %l/*/*.lef \
1395 -lib %l/*/*.lib \
Tim Edwards8b96a1b2021-04-27 15:16:26 -04001396 -gds %l/*/*.gds options=custom/scripts/gds_import_sram.tcl \
D. Mitch Baileya23f0b22021-12-27 08:14:38 -08001397 -spice %l/*/*.lvs.sp filter=custom/scripts/sp_to_spice.py \
Tim Edwardscfe970c2021-02-26 14:35:51 -05001398 -verilog %l/*/*.v \
Tim Edwards58b1a922022-01-17 15:55:42 -05001399 -library general sky130_sram_macros 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001400
Tim Edwards58b1a922022-01-17 15:55:42 -05001401osu-t12-%:
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001402 # Install OSU T12 hs digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001403 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001404 -techlef sky130_osu_sc_12T.tlef rename=sky130_osu_sc_12t_hs.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001405 -spice 12T_hs/cdl/*.spice compile-only exclude=*.*.spice \
1406 -lef 12T_hs/lef/*.lef \
1407 -lib 12T_hs/lib/*.lib \
1408 -gds 12T_hs/gds/*.gds compile-only \
1409 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001410 -library digital sky130_osu_sc_12t_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001411 # Install OSU T12 ms digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001412 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001413 -techlef sky130_osu_sc_12T.tlef rename=sky130_osu_sc_12t_ms.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001414 -spice 12T_ms/cdl/*.spice compile-only exclude=*.*.spice \
1415 -lef 12T_ms/lef/*.lef \
1416 -lib 12T_ms/lib/*.lib \
1417 -gds 12T_ms/gds/*.gds compile-only \
1418 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001419 -library digital sky130_osu_sc_12t_ms 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001420 # Install OSU T12 ls digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001421 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001422 -techlef sky130_osu_sc_12T.tlef rename=sky130_osu_sc_12t_ls.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001423 -spice 12T_ls/cdl/*.spice compile-only exclude=*.*.spice \
1424 -lef 12T_ls/lef/*.lef \
1425 -lib 12T_ls/lib/*.lib \
1426 -gds 12T_ls/gds/*.gds compile-only \
1427 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001428 -library digital sky130_osu_sc_12t_ls 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001429
Tim Edwards58b1a922022-01-17 15:55:42 -05001430osu-t15-%:
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001431 # Install OSU T15 hs digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001432 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001433 -techlef sky130_osu_sc_15T.tlef rename=sky130_osu_sc_15t_hs.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001434 -spice 15T_hs/cdl/*.spice compile-only exclude=*.*.spice \
1435 -lef 15T_hs/lef/*.lef \
1436 -lib 15T_hs/lib/*.lib \
1437 -gds 15T_hs/gds/*.gds compile-only \
1438 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001439 -library digital sky130_osu_sc_15t_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001440 # Install OSU T15 ms digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001441 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001442 -techlef sky130_osu_sc_15T.tlef rename=sky130_osu_sc_15t_ms.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001443 -spice 15T_ms/cdl/*.spice compile-only exclude=*.*.spice \
1444 -lef 15T_ms/lef/*.lef \
1445 -lib 15T_ms/lib/*.lib \
1446 -gds 15T_ms/gds/*.gds compile-only \
1447 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001448 -library digital sky130_osu_sc_15t_ms 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001449 # Install OSU T15 ls digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001450 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001451 -techlef sky130_osu_sc_15T.tlef rename=sky130_osu_sc_15t_ls.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001452 -spice 15T_ls/cdl/*.spice compile-only exclude=*.*.spice \
1453 -lef 15T_ls/lef/*.lef \
1454 -lib 15T_ls/lib/*.lib \
1455 -gds 15T_ls/gds/*.gds compile-only \
1456 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001457 -library digital sky130_osu_sc_15t_ls 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001458
Tim Edwards58b1a922022-01-17 15:55:42 -05001459osu-t18-%:
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001460 # Install OSU T18 hs digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001461 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001462 -techlef sky130_osu_sc_18T.tlef rename=sky130_osu_sc_18t_hs.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001463 -spice 18T_hs/cdl/*.spice compile-only exclude=*.*.spice \
1464 -lef 18T_hs/lef/*.lef \
1465 -lib 18T_hs/lib/*.lib \
1466 -gds 18T_hs/gds/*.gds compile-only \
1467 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001468 -library digital sky130_osu_sc_18t_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001469 # Install OSU T18 ms digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001470 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001471 -techlef sky130_osu_sc_18T.tlef rename=sky130_osu_sc_18t_ms.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001472 -spice 18T_ms/cdl/*.spice compile-only exclude=*.*.spice \
1473 -lef 18T_ms/lef/*.lef \
1474 -lib 18T_ms/lib/*.lib \
1475 -gds 18T_ms/gds/*.gds compile-only \
1476 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001477 -library digital sky130_osu_sc_18t_ms 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001478 # Install OSU T18 ls digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001479 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001480 -techlef sky130_osu_sc_18T.tlef rename=sky130_osu_sc_18t_ls.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001481 -spice 18T_ls/cdl/*.spice compile-only exclude=*.*.spice \
1482 -lef 18T_ls/lef/*.lef \
1483 -lib 18T_ls/lib/*.lib \
1484 -gds 18T_ls/gds/*.gds compile-only \
1485 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001486 -library digital sky130_osu_sc_18t_ls 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001487
Tim Edwards7fa92fd2022-01-19 11:13:51 -05001488install: $(foreach var, ${VARIANTS}, install-$(var))
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001489
Tim Edwards58b1a922022-01-17 15:55:42 -05001490install-A:
Tim Edwards9134eed2021-02-13 14:42:59 -05001491 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_install.log
Tim Edwards44e7efa2021-08-20 13:20:55 -04001492 ${INSTALL} \
1493 -source ${STAGING_PATH}/${SKY130A} \
Tim 'mithro' Ansell19576632021-11-14 17:01:53 -08001494 -finalpath ${SHARED_PDKS_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -05001495 -variable PDKPATH \
Tim Edwards6f01cd22022-01-17 19:23:53 -05001496 -link_from ${DIST_LINK_TARGETS_A} 2>&1 | tee -a ${SKY130A}_install.log
Tim Edwards9134eed2021-02-13 14:42:59 -05001497 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001498
Tim Edwards58b1a922022-01-17 15:55:42 -05001499install-B:
1500 echo "Starting SKY130 PDK migration on "`date` > ${SKY130B}_install.log
1501 ${INSTALL} \
1502 -source ${STAGING_PATH}/${SKY130B} \
1503 -finalpath ${SHARED_PDKS_PATH}/${SKY130B} \
1504 -variable PDKPATH \
Tim Edwards6f01cd22022-01-17 19:23:53 -05001505 -link_from ${DIST_LINK_TARGETS_B} 2>&1 | tee -a ${SKY130B}_install.log
Tim Edwards58b1a922022-01-17 15:55:42 -05001506 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130B}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001507
Tim Edwards7fa92fd2022-01-19 11:13:51 -05001508uninstall: $(foreach var, ${VARIANTS}, uninstall-$(var))
Tim Edwards58b1a922022-01-17 15:55:42 -05001509
1510uninstall-A:
Tim Edwards44e7efa2021-08-20 13:20:55 -04001511 echo "Uninstalling SKY130 PDK from ${SHARED_PDKS_PATH}"
1512 if test "x${SHARED_PDKS_PATH}" != "x" ; then \
1513 ${RM} -rf ${SHARED_PDKS_PATH}/${SKY130A} ; \
Tim Edwards8830dfe2021-02-25 11:29:59 -05001514 fi
1515 echo "Finished SKY130 PDK uninstall"
1516
Tim Edwards58b1a922022-01-17 15:55:42 -05001517uninstall-B:
1518 echo "Uninstalling SKY130 PDK from ${SHARED_PDKS_PATH}"
1519 if test "x${SHARED_PDKS_PATH}" != "x" ; then \
1520 ${RM} -rf ${SHARED_PDKS_PATH}/${SKY130B} ; \
1521 fi
1522 echo "Finished SKY130 PDK uninstall"
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001523
Tim Edwards7fa92fd2022-01-19 11:13:51 -05001524clean: $(foreach var, ${VARIANTS}, clean-$(var))
Tim Edwards58b1a922022-01-17 15:55:42 -05001525
1526clean-A:
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001527 ${STAGE} -target ${STAGING_PATH}/${SKY130A} -clean
1528
Tim Edwards58b1a922022-01-17 15:55:42 -05001529clean-B:
1530 ${STAGE} -target ${STAGING_PATH}/${SKY130B} -clean
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001531
Tim Edwards7fa92fd2022-01-19 11:13:51 -05001532veryclean: $(foreach var, ${VARIANTS}, veryclean-$(var))
Tim Edwards58b1a922022-01-17 15:55:42 -05001533
1534veryclean-A: clean-A
Tim Edwards9134eed2021-02-13 14:42:59 -05001535 ${RM} ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001536 ${RM} ${SKY130A}_install.log
Tim Edwards9134eed2021-02-13 14:42:59 -05001537 # Legacy name
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001538 ${RM} ${SKY130A}_migrate.log
Tim Edwards6ee11532021-02-11 12:29:33 -05001539
Tim Edwards58b1a922022-01-17 15:55:42 -05001540veryclean-B: clean-B
1541 ${RM} ${SKY130B}_make.log
1542 ${RM} ${SKY130B}_install.log
1543
Tim Edwards8a4b1602021-08-20 14:05:53 -04001544# Old aliases (retained for compatibility)
Tim Edwards44e7efa2021-08-20 13:20:55 -04001545install-dist:
1546 $(warning "'make install-dist' has been replaced with 'make install'")
1547 make install
Tim Edwards8a4b1602021-08-20 14:05:53 -04001548
Tim Edwards44e7efa2021-08-20 13:20:55 -04001549install-local:
1550 $(warning "'make install-local' has been replaced with 'make install'")
1551 make install
emayecsf31fb7a2021-08-04 16:27:55 -04001552
Tim Edwards44e7efa2021-08-20 13:20:55 -04001553uninstall-dist:
1554 $(warning "'make uninstall-dist' has been replaced with 'make uninstall'")
1555 make uninstall
Tim Edwards8a4b1602021-08-20 14:05:53 -04001556
Tim Edwards44e7efa2021-08-20 13:20:55 -04001557uninstall-local:
1558 $(warning "'make uninstall-local' has been replaced with 'make uninstall'")
1559 make uninstall
1560
Tim Edwards58b1a922022-01-17 15:55:42 -05001561install-dist-A:
1562 $(warning "'make install-dist-A' has been replaced with 'make install'")
Tim Edwards44e7efa2021-08-20 13:20:55 -04001563 make install
Tim Edwards8a4b1602021-08-20 14:05:53 -04001564
Tim Edwards58b1a922022-01-17 15:55:42 -05001565install-local-A:
1566 $(warning "'make install-local-A' has been replaced with 'make install'")
Tim Edwards44e7efa2021-08-20 13:20:55 -04001567 make install
1568
Tim Edwards58b1a922022-01-17 15:55:42 -05001569uninstall-dist-A:
1570 $(warning "'make uninstall-dist-A' has been replaced with 'make uninstall'")
Tim Edwards44e7efa2021-08-20 13:20:55 -04001571 make uninstall
Tim Edwards8a4b1602021-08-20 14:05:53 -04001572
Tim Edwards58b1a922022-01-17 15:55:42 -05001573uninstall-local-A:
1574 $(warning "'make uninstall-local-A' has been replaced with 'make uninstall'")
Tim Edwards44e7efa2021-08-20 13:20:55 -04001575 make uninstall