blob: ab9cec6624d725132057299156acb9895f7aa0f3 [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 Edwards5ed94ff2022-06-16 15:07:53 -040084# --enable-klayout-sky130[=<path>]
85# If enabled, install the Sky130 setup for the klayout layout
86# editor. If <path> is specified, then the klayout setup is
87# expected to be found rooted at the given path. If not
88# specified, then the klayout setup will be cloned from the
89# repository and installed.
90#
Tim Edwardscdfec5e2021-04-22 20:59:13 -040091# External (third-party) libraries and tool setups are the following (disabled
92# by default):
93#
94# --enable-sram-sky130[=<path>]
Tim Edwardscfe970c2021-02-26 14:35:51 -050095# If enabled, install the sky130_sram_macros library from
96# efabless on github. If <path> is not specified, then
97# the SRAM library will be cloned from the repository and
98# installed.
99#
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500100# --enable-sram-space-sky130[=<path>]
101# If enabled, install the sky130_fd_bd_sram library from
102# google on github. If <path> is not specified, then the
103# library will be cloned from the repository and installed.
104#
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400105# --enable-osu-t12-sky130[=<path>]
106# If enabled, install the sky130_osu_sc_t12 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#
111# --enable-osu-t15-sky130[=<path>]
112# If enabled, install the sky130_osu_sc_t15 libraries from
113# foss-eda-tools on googlesource. If <path> is not
114# specified, then the OSU standard cell library will be
115# clones from the repository and installed.
116#
117# --enable-osu-t18-sky130[=<path>]
118# If enabled, install the sky130_osu_sc_t18 libraries from
119# foss-eda-tools on googlesource. If <path> is not
120# specified, then the OSU standard cell library will be
121# clones from the repository and installed.
122#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400123# The variables below are substituted from the configuration options:
124#
Tim Edwards6f01cd22022-01-17 19:23:53 -0500125# SKYWATER_PATH: Points to vendor sources
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400126# EF_STYLE: 1 for efabless style, 0 otherwise
Tim Edwards6f01cd22022-01-17 19:23:53 -0500127# LINK_TARGETS_A: If "source", link back to source when possible
Tim Edwards7fa92fd2022-01-19 11:13:51 -0500128# ENABLED_VARIANTS: If not "all", then compile/install only the specified variants
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400129#
130# Run "make" to stage the PDK for tool setup and vendor libraries
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400131#
Tim Edwards44e7efa2021-08-20 13:20:55 -0400132# Run "make install" to install all staged files.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400133#
134# Run "make clean" to remove all staging files.
135#
Tim Edwards9134eed2021-02-13 14:42:59 -0500136# Run "make veryclean" to remove all staging and make.log files.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400137#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400138# For the sake of simplicity, the "standard" installation can be done
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400139# with the usual
140#
141# make
142# make install
143# make clean
144#
145#--------------------------------------------------------------------
146# This Makefile contains bash-isms
Tim 'mithro' Ansell56527562021-11-23 09:37:07 -0800147SHELL := /bin/bash
148export SHELL
149# We use pipes to save output to files, without pipefail they will always be
150# seen by make as having succeeded.
151SHELLOPTS := pipefail
152export SHELLOPTS
Tristan Gingolda5854312020-10-15 18:28:16 +0200153MV = mv
Tim Edwardsb94b6c12022-02-05 16:47:22 -0500154PATCH = patch
Tim Edwards5a623ff2021-04-30 16:30:52 -0400155SED = @SED@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400156
Tim Edwards44e7efa2021-08-20 13:20:55 -0400157prefix = @prefix@
158datarootdir = @datarootdir@
159datadir = @datadir@
160
Tim Edwardsf04c4212021-03-18 10:12:16 -0400161# Use git revision if this is a cloned repo; otherwise get the revision
162# from the VERSION file in the directory above.
163GITREV = $(shell git describe --long)
164ifeq (${GITREV},)
165 REVISION = $(shell cat ../VERSION)
166else
167 REVISION = ${GITREV}
168endif
169TECH = sky130
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400170
Tim Edwardsaac3d1a2021-06-15 16:37:10 -0400171# The run-time environment uses PDKPATH to override the PDK location,
Tim Edwardsae78ab72022-02-28 20:41:08 -0500172# so prevent that from happening during PDK install. This will also
173# happen with PDK_ROOT, so avoid that as well.
Tim Edwardsaac3d1a2021-06-15 16:37:10 -0400174unexport PDKPATH
Tim Edwardsae78ab72022-02-28 20:41:08 -0500175unexport PDK_ROOT
Tim Edwardsaac3d1a2021-06-15 16:37:10 -0400176
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400177# If EF_STYLE is set to 1, then efabless naming conventions are
178# used, otherwise the generic naming conventions are used.
179# Mainly, the hierarchy of library names and file types is reversed
180# (e.g., sky130_fd_sc_hd/lef vs. lef/sky130_fd_sc_hd).
181
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400182# EF_STYLE = 0 | 1
183EF_STYLE = @EF_STYLE@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400184
185# Normally it's fine to keep the staging path in a local directory,
186# although /tmp or a dedicated staging area are also fine, as long
187# as the install process can write to the path.
188
Tim Edwards1ffd99c2021-08-20 16:27:43 -0400189STAGING_PATH = $(shell pwd)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400190
mrgbea9d872021-11-08 13:43:42 -0800191SHARED_PDKS_PATH ?= $(datadir)/pdk
Tim Edwards44e7efa2021-08-20 13:20:55 -0400192
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400193# If LINK_TARGETS is set to "none", then files are copied
194# from the SkyWater sources to the target. If set to "source",
195# symbolic links are made in the target directories pointing
196# back to the SkyWater sources. If set to the name of another
197# PDK (e.g, "sky130A"), then symbolic links are made to the
198# same files in that PDK, where they exist, and are copied
199# from source, where they don't.
Tim Edwards6f01cd22022-01-17 19:23:53 -0500200#
201# Behavior is to let the link targets for variant A follow the
202# configuration option. Link targets for variant B will always
203# be the files of variant A (which may end up being symbolic
204# links to symbolic links if "source" was chosen for link-targets
205# in the configuration).
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400206
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400207# LINK_TARGETS = source | none | sky130A
Tim Edwards6f01cd22022-01-17 19:23:53 -0500208LINK_TARGETS_A = @SKY130_LINK_TARGETS@
209LINK_TARGETS_B = sky130A
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400210
Tim Edwards7fa92fd2022-01-19 11:13:51 -0500211# ENABLED_VARIANTS = all | A | B
212ENABLED_VARIANTS = @SKY130_ENABLED_VARIANTS@
213ifeq (${ENABLED_VARIANTS},)
214 VARIANTS += A B
215else
216 ifeq (${ENABLED_VARIANTS}, all)
217 VARIANTS += A B
218 else
219 VARIANTS += ${ENABLED_VARIANTS}
220 endif
221endif
222
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400223# Paths:
224
agorararmard3ee5f112021-02-03 19:49:09 +0200225# Path to skywater_pdk
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400226SKYWATER_PATH = @SKY130_SOURCE_PATH@
Tim Edwards66e53e52021-01-24 21:21:36 -0500227ifneq ($(SKYWATER_PATH),)
Tim Edwards6ee11532021-02-11 12:29:33 -0500228 SKYWATER_LIBS_PATH = ${SKYWATER_PATH}/libraries
229else
230 SKYWATER_LIBS_PATH =
Tim Edwards66e53e52021-01-24 21:21:36 -0500231endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400232
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500233# Path to independent library sources (to be added to configuration options).
Tim Edwards1168a8b2021-02-10 22:06:54 -0500234ALPHA_PATH = @SKY130_ML_XX_HD_PATH@
235XSCHEM_PATH = @XSCHEM_SKY130_PATH@
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400236KLAYOUT_PATH = @KLAYOUT_SKY130_PATH@
237PRECHECK_PATH = @PRECHECK_SKY130_PATH@
Tim Edwardscfe970c2021-02-26 14:35:51 -0500238SRAM_PATH = @SKY130_SRAM_MACROS_PATH@
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500239SRAM_SPACE_PATH = @SKY130_FD_BD_SRAM_PATH@
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400240OSU_T12_PATH = @SKY130_OSU_T12_PATH@
241OSU_T15_PATH = @SKY130_OSU_T15_PATH@
242OSU_T18_PATH = @SKY130_OSU_T18_PATH@
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500243
Tim Edwards6ee11532021-02-11 12:29:33 -0500244PDK_URL = https://github.com/google/skywater-pdk
Tim Edwards8877f8f2021-06-10 21:35:36 -0400245ALPHA_URL = https://github.com/PaulSchulz/sky130_pschulz_xx_hd
246XSCHEM_URL = https://github.com/StefanSchippers/xschem_sky130
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400247KLAYOUT_URL = https://github.com/mabrains/sky130_klayout_pdk
248PRECHECK_URL = https://github.com/efabless/mpw_precheck
Tim Edwards8877f8f2021-06-10 21:35:36 -0400249SRAM_URL = https://github.com/efabless/sky130_sram_macros
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500250SRAM_SPACE_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_fd_bd_sram
Tim Edwards8877f8f2021-06-10 21:35:36 -0400251OSU_T12_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t12
252OSU_T15_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t15
253OSU_T18_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t18
Tim Edwards6ee11532021-02-11 12:29:33 -0500254
Tim Edwards2f7032e2022-12-16 17:51:45 -0500255USE_REFERENCE = @USE_REFERENCE@
256
Tim Edwardsc74daac2023-01-05 15:38:30 -0500257ifeq (${USE_REFERENCE}, 1)
258 REFERENCE_JSON = ${TECH}.json
259else
260 REFERENCE_JSON =
261endif
262
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400263# NOTE: Install destination is the git repository of the technology platform.
264# Once updated in git, the git project can be distributed to all hosts.
265#
266ifeq (${EF_STYLE}, 1)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400267 CONFIG_DIR = .ef-config
268 REV_DIR = ${REVISION}
269else
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400270 CONFIG_DIR = .config
271 REV_DIR = .
272endif
273
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400274# EF process nodes created from the master sources
275SKY130A = sky130A
Tim Edwards58b1a922022-01-17 15:55:42 -0500276SKY130B = sky130B
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400277
Tim Edwards6f01cd22022-01-17 19:23:53 -0500278DIST_LINK_TARGETS_A = ${LINK_TARGETS_A}
279DIST_LINK_TARGETS_B = ${SHARED_PDKS_PATH}/${LINK_TARGETS_B}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400280
281# Basic definitions for each EF process node
282SKY130A_DEFS = -DTECHNAME=sky130A -DREVISION=${REVISION}
Tim Edwards58b1a922022-01-17 15:55:42 -0500283SKY130B_DEFS = -DTECHNAME=sky130B -DREVISION=${REVISION}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400284
285# Module definitions for each process node
286# (Note that MOS is default and therefore not used anywhere)
Tim Edwards0a0272b2020-07-28 14:40:10 -0400287SKY130A_DEFS += -DMETAL5 -DMIM -DREDISTRIBUTION
Tim Edwards58b1a922022-01-17 15:55:42 -0500288SKY130B_DEFS += -DMETAL5 -DMIM -DREDISTRIBUTION
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400289
Tim Edwards58b1a922022-01-17 15:55:42 -0500290# NOTE: ReRAM support is what distinguishes variant B from variant A.
291SKY130B_DEFS += -DRERAM
Tim Edwards33e65982021-11-24 22:35:04 -0500292
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400293# Add staging path
294SKY130A_DEFS += -DSTAGING_PATH=${STAGING_PATH}
Tim Edwards58b1a922022-01-17 15:55:42 -0500295SKY130B_DEFS += -DSTAGING_PATH=${STAGING_PATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400296
Tim Edwards5d450d52022-01-22 15:31:32 -0500297# Get the timestamp of the open_pdks commit to use for stamping layouts.
298OPEN_PDKS_TIMESTAMP = $(shell git log -1 --format="%ad" --date=raw | cut -d' ' -f1)
299TIMESTAMP_OPT = -timestamp ${OPEN_PDKS_TIMESTAMP}
300
Tim Edwards8877f8f2021-06-10 21:35:36 -0400301# Record commit numbers for the nodeinfo.json file
302OPEN_PDKS_COMMIT = $(shell git rev-parse HEAD)
303ifeq (${OPEN_PDKS_COMMIT},)
304 COMMIT_DEFS = -DOPEN_PDKS_COMMIT=${REVISION}
305else
306 COMMIT_DEFS = -DOPEN_PDKS_COMMIT=${OPEN_PDKS_COMMIT}
307endif
Tim Edwardscc0029b2022-08-01 18:11:30 -0400308
Tim Edwardsc74daac2023-01-05 15:38:30 -0500309ifeq (${SKYWATER_PATH},)
310 COMMIT_DEFS += -DSKYWATER_COMMIT="unknown"
311else
312 COMMIT_DEFS += -DSKYWATER_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse HEAD)
313endif
Tim Edwardscc0029b2022-08-01 18:11:30 -0400314ifeq (${XSCHEM_PATH},)
315 COMMIT_DEFS += -DXSCHEM_COMMIT="unknown"
316else
317 COMMIT_DEFS += -DXSCHEM_COMMIT=$(shell cd ${XSCHEM_PATH} ; git rev-parse HEAD)
318endif
319ifeq (${KLAYOUT_PATH},)
320 COMMIT_DEFS += -DKLAYOUT_COMMIT="unknown"
321else
322 COMMIT_DEFS += -DKLAYOUT_COMMIT=$(shell cd ${KLAYOUT_PATH} ; git rev-parse HEAD)
323endif
324ifeq (${PRECHECK_PATH},)
325 COMMIT_DEFS += -DPRECHECK_COMMIT="unknown"
326else
327 COMMIT_DEFS += -DPRECHECK_COMMIT=$(shell cd ${PRECHECK_PATH} ; git rev-parse HEAD)
328endif
Tim Edwards8877f8f2021-06-10 21:35:36 -0400329ifeq (${ALPHA_PATH},)
330 COMMIT_DEFS += -DALPHA_COMMIT="unknown"
331else
332 COMMIT_DEFS += -DALPHA_COMMIT=$(shell cd ${ALPHA_PATH} ; git rev-parse HEAD)
333endif
334ifeq (${SRAM_PATH},)
335 COMMIT_DEFS += -DSRAM_COMMIT="unknown"
336else
337 COMMIT_DEFS += -DSRAM_COMMIT=$(shell cd ${SRAM_PATH} ; git rev-parse HEAD)
338endif
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500339ifeq (${SRAM_SPACE_PATH},)
340 COMMIT_DEFS += -DSRAM_SPACE_COMMIT="unknown"
341else
342 COMMIT_DEFS += -DSRAM_SPACE_COMMIT=$(shell cd ${SRAM_SPACE_PATH} ; git rev-parse HEAD)
343endif
Tim Edwards8877f8f2021-06-10 21:35:36 -0400344ifeq (${OSU_T12_PATH},)
345 COMMIT_DEFS += -DOSU_T12_COMMIT="unknown"
346else
347 COMMIT_DEFS += -DOSU_T12_COMMIT=$(shell cd ${OSU_T12_PATH} ; git rev-parse HEAD)
348endif
349ifeq (${OSU_T15_PATH},)
350 COMMIT_DEFS += -DOSU_T15_COMMIT="unknown"
351else
352 COMMIT_DEFS += -DOSU_T15_COMMIT=$(shell cd ${OSU_T15_PATH} ; git rev-parse HEAD)
353endif
354ifeq (${OSU_T18_PATH},)
355 COMMIT_DEFS += -DOSU_T18_COMMIT="unknown"
356else
357 COMMIT_DEFS += -DOSU_T18_COMMIT=$(shell cd ${OSU_T18_PATH} ; git rev-parse HEAD)
358endif
359ifeq (${SKYWATER_PATH},)
360 COMMIT_DEFS += -DFD_PR_COMMIT="unknown"
361 COMMIT_DEFS += -DFD_IO_COMMIT="unknown"
362 COMMIT_DEFS += -DFD_SC_HD_COMMIT="unknown"
363 COMMIT_DEFS += -DFD_SC_HDLL_COMMIT="unknown"
364 COMMIT_DEFS += -DFD_SC_HVL_COMMIT="unknown"
365 COMMIT_DEFS += -DFD_SC_HS_COMMIT="unknown"
366 COMMIT_DEFS += -DFD_SC_MS_COMMIT="unknown"
367 COMMIT_DEFS += -DFD_SC_LS_COMMIT="unknown"
368 COMMIT_DEFS += -DFD_SC_LP_COMMIT="unknown"
369else
Tim Edwards02b3c792021-09-08 22:25:13 -0400370 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_pr/latest/cells),)
371 COMMIT_DEFS += -DFD_PR_COMMIT="unknown"
372 else
373 COMMIT_DEFS += -DFD_PR_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_pr/latest)
374 endif
375 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_io/latest/cells),)
376 COMMIT_DEFS += -DFD_IO_COMMIT="unknown"
377 else
378 COMMIT_DEFS += -DFD_IO_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_io/latest)
379 endif
Tim Edwards93090392021-09-09 17:21:49 -0400380 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_hd/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400381 COMMIT_DEFS += -DFD_SC_HD_COMMIT="unknown"
382 else
383 COMMIT_DEFS += -DFD_SC_HD_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_hd/latest)
384 endif
Tim Edwards93090392021-09-09 17:21:49 -0400385 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_hdll/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400386 COMMIT_DEFS += -DFD_SC_HDLL_COMMIT="unknown"
387 else
388 COMMIT_DEFS += -DFD_SC_HDLL_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_hdll/latest)
389 endif
Tim Edwards93090392021-09-09 17:21:49 -0400390 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_hvl/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400391 COMMIT_DEFS += -DFD_SC_HVL_COMMIT="unknown"
392 else
393 COMMIT_DEFS += -DFD_SC_HVL_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_hvl/latest)
394 endif
Tim Edwards93090392021-09-09 17:21:49 -0400395 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_hs/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400396 COMMIT_DEFS += -DFD_SC_HS_COMMIT="unknown"
397 else
398 COMMIT_DEFS += -DFD_SC_HS_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_hs/latest)
399 endif
Tim Edwards93090392021-09-09 17:21:49 -0400400 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_ms/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400401 COMMIT_DEFS += -DFD_SC_MS_COMMIT="unknown"
402 else
403 COMMIT_DEFS += -DFD_SC_MS_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_ms/latest)
404 endif
Tim Edwards93090392021-09-09 17:21:49 -0400405 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_ls/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400406 COMMIT_DEFS += -DFD_SC_LS_COMMIT="unknown"
407 else
408 COMMIT_DEFS += -DFD_SC_LS_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_ls/latest)
409 endif
Tim Edwards93090392021-09-09 17:21:49 -0400410 ifeq ($(wildcard ${SKYWATER_PATH}/libraries/sky130_fd_sc_lp/latest/cells),)
Tim Edwards02b3c792021-09-08 22:25:13 -0400411 COMMIT_DEFS += -DFD_SC_LP_COMMIT="unknown"
412 else
413 COMMIT_DEFS += -DFD_SC_LP_COMMIT=$(shell cd ${SKYWATER_PATH} ; git rev-parse @:libraries/sky130_fd_sc_lp/latest)
414 endif
Tim Edwards8877f8f2021-06-10 21:35:36 -0400415endif
Tim Edwardse281e082022-02-25 09:58:31 -0500416COMMIT_DEFS += -DMAGIC_COMMIT=$(shell magic -dnull -noconsole --commit)
Tim Edwards7d076162021-06-24 11:43:30 -0400417COMMIT_DEFS += -DMAGIC_VERSION=$(shell magic -dnull -noconsole --version)
418COMMIT_DEFS += -DOPEN_PDKS_VERSION=$(shell cat ../VERSION)
Tim Edwards8877f8f2021-06-10 21:35:36 -0400419
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400420ifeq (${EF_STYLE}, 1)
421 EF_FORMAT = -ef_format
422 SKY130A_DEFS += -DEF_FORMAT
Tim Edwards58b1a922022-01-17 15:55:42 -0500423 SKY130B_DEFS += -DEF_FORMAT
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400424else
425 EF_FORMAT = -std_format
426endif
427
428MAGICTOP = libs.tech/magic
429NETGENTOP = libs.tech/netgen
Tim Edwards367711e2021-01-27 10:35:12 -0500430IRSIMTOP = libs.tech/irsim
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400431QFLOWTOP = libs.tech/qflow
432KLAYOUTTOP = libs.tech/klayout
433OPENLANETOP = libs.tech/openlane
Tim Edwards1168a8b2021-02-10 22:06:54 -0500434XSCHEMTOP = libs.tech/xschem
Tim Edwardse4c44092021-02-12 10:18:56 -0500435XCIRCUITTOP = libs.tech/xcircuit
Tim Edwards25972f82021-04-27 21:45:58 -0400436NGSPICETOP = libs.tech/ngspice
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400437
438ifeq (${EF_STYLE}, 1)
439 MAGICPATH = ${MAGICTOP}/${REVISION}
Tim Edwards9134eed2021-02-13 14:42:59 -0500440 MAGICCURRENT = ${MAGICTOP}/current
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400441else
442 MAGICPATH = ${MAGICTOP}
Tim Edwards9134eed2021-02-13 14:42:59 -0500443 MAGICCURRENT = ${MAGICTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400444endif
445
Tim Edwards367711e2021-01-27 10:35:12 -0500446# Currently, netgen, qflow, irsim, and klayout do not use revisioning (needs to change!)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400447NETGENPATH = ${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500448IRSIMPATH = ${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400449QFLOWPATH = ${QFLOWTOP}
450KLAYOUTPATH = ${KLAYOUTTOP}
451OPENLANEPATH = ${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500452XSCHEMPATH = ${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500453XCIRCUITPATH = ${XCIRCUITTOP}
Tim Edwards25972f82021-04-27 21:45:58 -0400454NGSPICEPATH = ${NGSPICETOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400455
456MAGICTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICTOP}
457NETGENTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500458IRSIMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400459QFLOWTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWTOP}
460KLAYOUTTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTTOP}
461OPENLANETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500462XSCHEMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500463XCIRCUITTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITTOP}
Tim Edwards25972f82021-04-27 21:45:58 -0400464NGSPICETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NGSPICETOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400465
466MAGIC_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICPATH}
467NETGEN_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENPATH}
Tim Edwards367711e2021-01-27 10:35:12 -0500468IRSIM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400469QFLOW_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWPATH}
470KLAYOUT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTPATH}
471OPENLANE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANEPATH}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500472XSCHEM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMPATH}
Tim Edwardse4c44092021-02-12 10:18:56 -0500473XCIRCUIT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITPATH}
Tim Edwards25972f82021-04-27 21:45:58 -0400474NGSPICE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NGSPICEPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400475
Tim Edwards58b1a922022-01-17 15:55:42 -0500476MAGICTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${MAGICTOP}
477NETGENTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${NETGENTOP}
478IRSIMTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${IRSIMTOP}
479QFLOWTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${QFLOWTOP}
480KLAYOUTTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${KLAYOUTTOP}
481OPENLANETOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${OPENLANETOP}
482XSCHEMTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${XSCHEMTOP}
483XCIRCUITTOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${XCIRCUITTOP}
484NGSPICETOP_STAGING_B = ${STAGING_PATH}/${SKY130B}/${NGSPICETOP}
485
486MAGIC_STAGING_B = ${STAGING_PATH}/${SKY130B}/${MAGICPATH}
487NETGEN_STAGING_B = ${STAGING_PATH}/${SKY130B}/${NETGENPATH}
488IRSIM_STAGING_B = ${STAGING_PATH}/${SKY130B}/${IRSIMPATH}
489QFLOW_STAGING_B = ${STAGING_PATH}/${SKY130B}/${QFLOWPATH}
490KLAYOUT_STAGING_B = ${STAGING_PATH}/${SKY130B}/${KLAYOUTPATH}
491OPENLANE_STAGING_B = ${STAGING_PATH}/${SKY130B}/${OPENLANEPATH}
492XSCHEM_STAGING_B = ${STAGING_PATH}/${SKY130B}/${XSCHEMPATH}
493XCIRCUIT_STAGING_B = ${STAGING_PATH}/${SKY130B}/${XCIRCUITPATH}
494NGSPICE_STAGING_B = ${STAGING_PATH}/${SKY130B}/${NGSPICEPATH}
495
Tim Edwards9134eed2021-02-13 14:42:59 -0500496SKY130A_DEFS += -DMAGIC_CURRENT=${MAGICCURRENT}
Tim Edwards58b1a922022-01-17 15:55:42 -0500497SKY130B_DEFS += -DMAGIC_CURRENT=${MAGICCURRENT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400498
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500499# Openlane has a number of files that are common to all digital
500# standard cell libraries, so these are collected in one definition
501# here:
agorararmard2ca46022021-02-11 21:43:51 +0200502OPENLANE_COMMON = config.tcl tracks.info no_synth.cells drc_exclude.cells
manarabdelaty2ecac4f2021-03-08 15:23:12 +0200503OPENLANE_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 -0500504
Tim Edwardsd7c3a522022-10-01 17:58:29 -0400505# Corners defined in IRSIM parameter files (wild-carded)
506IRSIM_CORNERS = `ls irsim/*.prm | cut -c14-`
Tim Edwards6f01cd22022-01-17 19:23:53 -0500507
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400508# Where cpp syntax is followed, this is equivalent to cpp, but it does not
509# mangle non-C source files under the belief that they are actually C code.
510CPP = ../common/preproc.py
511
512# The following script in the ../common directory does most of the work of
513# copying or linking the foundry vendor files to the target directory.
Tim Edwards5d450d52022-01-22 15:31:32 -0500514STAGE = set -f ; ../common/foundry_install.py ${EF_FORMAT} ${TIMESTAMP_OPT}
Tim Edwards44e7efa2021-08-20 13:20:55 -0400515ifneq ($(DESTDIR), )
Tim 'mithro' Ansell19576632021-11-14 17:01:53 -0800516INSTALL = ../common/staging_install.py -writeto $(DESTDIR) ${EF_FORMAT}
Tim Edwards44e7efa2021-08-20 13:20:55 -0400517else
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400518INSTALL = ../common/staging_install.py ${EF_FORMAT}
Tim Edwards44e7efa2021-08-20 13:20:55 -0400519endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400520
521# The script(s) below are used for custom changes to the vendor PDK files
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200522ADDPROP = ../common/insert_property.py ${EF_FORMAT}
Tim Edwards22f014d2022-01-26 10:37:03 -0500523ADDLAYER = ../common/insert_layer.py ${EF_FORMAT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400524
525# List the EDA tools to install local setup files for
Tim Edwards44e7efa2021-08-20 13:20:55 -0400526TOOLS =
Tim Edwardsccaea722020-12-24 10:59:42 -0500527
528# KLAYOUT_DISABLED = 0 | 1
529KLAYOUT_DISABLED = @KLAYOUT_DISABLED@
530ifneq (${KLAYOUT_DISABLED}, 1)
531 TOOLS += klayout
532endif
533
534# OPENLANE_DISABLED = 0 | 1
535OPENLANE_DISABLED = @OPENLANE_DISABLED@
536ifneq (${OPENLANE_DISABLED}, 1)
537 TOOLS += openlane
538endif
539
540# QFLOW_DISABLED = 0 | 1
541QFLOW_DISABLED = @QFLOW_DISABLED@
542ifneq (${QFLOW_DISABLED}, 1)
543 TOOLS += qflow
544endif
545
546# MAGIC_DISABLED = 0 | 1
547MAGIC_DISABLED = @MAGIC_DISABLED@
548ifneq (${MAGIC_DISABLED}, 1)
549 TOOLS += magic
550endif
551
552# NETGEN_DISABLED = 0 | 1
553NETGEN_DISABLED = @NETGEN_DISABLED@
554ifneq (${NETGEN_DISABLED}, 1)
555 TOOLS += netgen
556endif
557
Tim Edwards367711e2021-01-27 10:35:12 -0500558# IRSIM_DISABLED = 0 | 1
559IRSIM_DISABLED = @IRSIM_DISABLED@
560ifneq (${IRSIM_DISABLED}, 1)
561 TOOLS += irsim
562endif
563
Tim Edwards1168a8b2021-02-10 22:06:54 -0500564# XSCHEM_DISABLED = 0 | 1
565XSCHEM_DISABLED = @XSCHEM_DISABLED@
566ifneq (${XSCHEM_DISABLED}, 1)
567 TOOLS += xschem
568endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400569
Tim Edwardse4c44092021-02-12 10:18:56 -0500570# XCIRCUIT_DISABLED = 0 | 1
571XCIRCUIT_DISABLED = @XCIRCUIT_DISABLED@
572ifneq (${XCIRCUIT_DISABLED}, 1)
573 TOOLS += xcircuit
574endif
575
Tim Edwards25972f82021-04-27 21:45:58 -0400576# These definitions depend on the setting of EF_STYLE
577ifeq (${EF_STYLE}, 1)
578 IO_VERILOG = verilog/sky130_fd_io
Tim Edwardsb5bfca82022-03-04 11:29:56 -0500579 IO_GDS = gds/sky130_fd_io
Tim Edwards25972f82021-04-27 21:45:58 -0400580 HD_VERILOG = verilog/sky130_fd_sc_hd
581 HDLL_VERILOG = verilog/sky130_fd_sc_hdll
582 HVL_VERILOG = verilog/sky130_fd_sc_hvl
583 HS_VERILOG = verilog/sky130_fd_sc_hs
584 MS_VERILOG = verilog/sky130_fd_sc_ms
585 LS_VERILOG = verilog/sky130_fd_sc_ls
586 LP_VERILOG = verilog/sky130_fd_sc_lp
587 HD_TECHLEF = techLEF/sky130_fd_sc_hd
588 HDLL_TECHLEF = techLEF/sky130_fd_sc_hdll
589 MLXX_SCRIPTS = scripts/sky130_ml_xx_hd
590 PR_SPICE = spi/sky130_fd_pr
Tim Edwardsf63ee052021-04-29 15:13:45 -0400591 HVL_SPICE = spi/sky130_fd_sc_hvl
Tim Edwards97274fd2021-07-13 15:15:03 -0400592 HD_SPICE = spi/sky130_fd_sc_hd
Tim Edwards16b050b2021-05-17 16:45:34 -0400593 HVL_PATCH4 = 4b
Tim Edwardsf63ee052021-04-29 15:13:45 -0400594 HVL_CDL = cdl/sky130_fd_sc_hvl
Tim Edwards12f00a02021-09-09 10:40:57 -0400595 SPIEXT = spi
Tim Edwards25972f82021-04-27 21:45:58 -0400596else
597 IO_VERILOG = sky130_fd_io/verilog
Tim Edwardsb5bfca82022-03-04 11:29:56 -0500598 IO_GDS = sky130_fd_io/gds
Tim Edwards25972f82021-04-27 21:45:58 -0400599 HD_VERILOG = sky130_fd_sc_hd/verilog
600 HDLL_VERILOG = sky130_fd_sc_hdll/verilog
601 HVL_VERILOG = sky130_fd_sc_hvl/verilog
602 HS_VERILOG = sky130_fd_sc_hs/verilog
603 MS_VERILOG = sky130_fd_sc_ms/verilog
604 LS_VERILOG = sky130_fd_sc_ls/verilog
605 LP_VERILOG = sky130_fd_sc_lp/verilog
606 HD_TECHLEF = sky130_fd_sc_hd/techlef
607 HDLL_TECHLEF = sky130_fd_sc_hdll/techlef
608 MLXX_SCRIPTS = sky130_ml_xx_hd/scripts
609 PR_SPICE = sky130_fd_pr/spice
Tim Edwardsf63ee052021-04-29 15:13:45 -0400610 HVL_SPICE = sky130_fd_sc_hvl/spice
Tim Edwards97274fd2021-07-13 15:15:03 -0400611 HD_SPICE = sky130_fd_sc_hd/spice
Tim Edwards16b050b2021-05-17 16:45:34 -0400612 HVL_PATCH4 = 4
Tim Edwardsf63ee052021-04-29 15:13:45 -0400613 HVL_CDL = sky130_fd_sc_hvl/cdl
Tim Edwards12f00a02021-09-09 10:40:57 -0400614 SPIEXT = spice
Tim Edwards25972f82021-04-27 21:45:58 -0400615endif
616
Tim Edwards2f7032e2022-12-16 17:51:45 -0500617all: $(foreach var, ${VARIANTS}, all-$(var))
618
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400619reference: ${TECH}.json
620 # Rewrite the ${TECH}.json file to change the commit values in
621 # "reference" to reflect the state of the system when "make
622 # reference" was run. This is then committed to the open_pdks
623 # repository to create a known reference configuration of all
624 # tools.
625 ../common/save_commit_refs.py ${COMMIT_DEFS} ${TECH}.json
626
Tim Edwards6ee11532021-02-11 12:29:33 -0500627# Handle prerequisites (fetch and install the PDK and requested libraries)
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500628prerequisites: pdk-repo alpha-repo xschem-repo klayout-repo precheck-repo sram-repo sram-space-repo osu-t12-repo osu-t15-repo osu-t18-repo
Tim Edwards6ee11532021-02-11 12:29:33 -0500629
630pdk-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500631 if test "x${REFERENCE_JSON}" != "x"; then \
632 SKYWATER_COMMIT = `cat ${REFERENCE_JSON} | grep skywater_pdk | grep -v COMMIT | cut -d'"' -f4` ; \
633 fi
Tim Edwards6ee11532021-02-11 12:29:33 -0500634 if test "x${SKYWATER_PATH}" != "x" ; then \
635 if test -d "${SKYWATER_PATH}" ; then \
636 echo "Using existing installation of SkyWater PDK from ${SKYWATER_PATH}" ; \
637 else \
638 echo "Downloading SkyWater PDK from ${PDK_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500639 custom/scripts/pdk_download.sh ${PDK_URL} ${SKYWATER_PATH} ${SKYWATER_COMMIT} ; \
Tim Edwards6ee11532021-02-11 12:29:33 -0500640 fi ; \
641 fi
642
643alpha-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500644 if test "x${REFERENCE_JSON}" != "x"; then \
645 ALPHA_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_ml_xx_hd | grep -v COMMIT | cut -d'"' -f4` ; \
646 fi
Tim Edwards6ee11532021-02-11 12:29:33 -0500647 if test "x${ALPHA_PATH}" != "x" ; then \
648 if test -d "${ALPHA_PATH}" ; then \
649 echo "Using existing installation of alphanumeric library from ${ALPHA_PATH}" ; \
650 else \
651 echo "Downloading alphanumeric library from ${ALPHA_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500652 ../scripts/download.sh ${ALPHA_URL} ${ALPHA_PATH} ${ALPHA_COMMIT} ; \
Tim Edwards6ee11532021-02-11 12:29:33 -0500653 fi ; \
654 fi
655
Tim Edwardscfe970c2021-02-26 14:35:51 -0500656sram-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500657 if test "x${REFERENCE_JSON}" != "x"; then \
658 SRAM_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_sram_macros | grep -v COMMIT | cut -d'"' -f4` ; \
659 fi
Tim Edwardscfe970c2021-02-26 14:35:51 -0500660 if test "x${SRAM_PATH}" != "x" ; then \
661 if test -d "${SRAM_PATH}" ; then \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400662 echo "Using existing installation of SRAM macro library from ${SRAM_PATH}" ; \
Tim Edwardscfe970c2021-02-26 14:35:51 -0500663 else \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400664 echo "Downloading SRAM macro library from ${SRAM_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500665 ../scripts/download.sh ${SRAM_URL} ${SRAM_PATH} ${SRAM_COMMIT}; \
Tim Edwardscfe970c2021-02-26 14:35:51 -0500666 fi ; \
667 fi
668
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500669sram-space-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500670 if test "x${REFERENCE_JSON}" != "x"; then \
671 SRAM_SPACE_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_fd_bd_sram | grep -v COMMIT | cut -d'"' -f4` ; \
672 fi
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500673 if test "x${SRAM_SPACE_PATH}" != "x" ; then \
674 if test -d "${SRAM_SPACE_PATH}" ; then \
675 echo "Using existing installation of SRAM build-space library from ${SRAM_SPACE_PATH}" ; \
676 else \
677 echo "Downloading SRAM build-space library from ${SRAM_SPACE_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500678 ../scripts/download.sh ${SRAM_SPACE_URL} ${SRAM_SPACE_PATH} ${SRAM_SPACE_COMMIT} ; \
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500679 fi ; \
680 fi
681
Tim Edwardscfe970c2021-02-26 14:35:51 -0500682xschem-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500683 if test "x${REFERENCE_JSON}" != "x"; then \
684 XSCHEM_COMMIT = `cat ${REFERENCE_JSON} | grep xschem_sky130 | grep -v COMMIT | cut -d'"' -f4` ; \
685 fi
Tim Edwardscfe970c2021-02-26 14:35:51 -0500686 if test "x${XSCHEM_PATH}" != "x" ; then \
687 if test -d "${XSCHEM_PATH}" ; then \
688 echo "Using existing installation of xschem setup from ${XSCHEM_PATH}" ; \
689 else \
690 echo "Downloading xschem setup from ${XSCHEM_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500691 ../scripts/download.sh ${XSCHEM_URL} ${XSCHEM_PATH} ${XSCHEM_COMMIT} ; \
Tim Edwardscfe970c2021-02-26 14:35:51 -0500692 fi ; \
693 fi
694
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400695klayout-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500696 if test "x${REFERENCE_JSON}" != "x"; then \
697 KLAYOUT_COMMIT = `cat ${REFERENCE_JSON} | grep klayout_sky130 | grep -v COMMIT | cut -d'"' -f4` ; \
698 fi
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400699 if test "x${KLAYOUT_PATH}" != "x" ; then \
700 if test -d "${KLAYOUT_PATH}" ; then \
701 echo "Using existing installation of klayout setup from ${KLAYOUT_PATH}" ; \
702 else \
703 echo "Downloading klayout setup from ${KLAYOUT_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500704 ../scripts/download.sh ${KLAYOUT_URL} ${KLAYOUT_PATH} ${KLAYOUT_COMMIT} ; \
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400705 fi ; \
706 fi
707
708precheck-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500709 if test "x${REFERENCE_JSON}" != "x"; then \
710 PRECHECK_COMMIT = `cat ${REFERENCE_JSON} | grep precheck_sky130 | grep -v COMMIT | cut -d'"' -f4` ; \
711 fi
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400712 if test "x${PRECHECK_PATH}" != "x" ; then \
713 if test -d "${PRECHECK_PATH}" ; then \
714 echo "Using existing installation of klayout setup from ${PRECHECK_PATH}" ; \
715 else \
716 echo "Downloading klayout setup from ${PRECHECK_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500717 ../scripts/download.sh ${PRECHECK_URL} ${PRECHECK_PATH} ${PRECHECK_COMMIT} ; \
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400718 fi ; \
719 fi
720
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400721osu-t12-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500722 if test "x${REFERENCE_JSON}" != "x"; then \
723 OSU_T12_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_osu_sc_t12 | grep -v COMMIT | cut -d'"' -f4` ; \
724 fi
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400725 if test "x${OSU_T12_PATH}" != "x" ; then \
726 if test -d "${OSU_T12_PATH}" ; then \
727 echo "Using existing installation of OSU T12 standard cell library from ${OSU_T12_PATH}" ; \
728 else \
729 echo "Downloading OSU standard T12 cell library from ${OSU_T12_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500730 ../scripts/download.sh ${OSU_T12_URL} ${OSU_T12_PATH} ${OSU_T12_COMMIT} ; \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400731 fi ; \
732 fi
733
734osu-t15-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500735 if test "x${REFERENCE_JSON}" != "x"; then \
736 OSU_T15_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_osu_sc_t15 | grep -v COMMIT | cut -d'"' -f4` ; \
737 fi
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400738 if test "x${OSU_T15_PATH}" != "x" ; then \
739 if test -d "${OSU_T15_PATH}" ; then \
740 echo "Using existing installation of OSU T15 standard cell library from ${OSU_T15_PATH}" ; \
741 else \
742 echo "Downloading OSU standard T15 cell library from ${OSU_T15_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500743 ../scripts/download.sh ${OSU_T15_URL} ${OSU_T15_PATH} ${OSU_T15_COMMIT} ; \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400744 fi ; \
745 fi
746
747osu-t18-repo:
Tim Edwardsc74daac2023-01-05 15:38:30 -0500748 if test "x${REFERENCE_JSON}" != "x"; then \
749 OSU_T18_COMMIT = `cat ${REFERENCE_JSON} | grep sky130_osu_sc_t18 | grep -v COMMIT | cut -d'"' -f4` ; \
750 fi
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400751 if test "x${OSU_T18_PATH}" != "x" ; then \
752 if test -d "${OSU_T18_PATH}" ; then \
753 echo "Using existing installation of OSU T18 standard cell library from ${OSU_T18_PATH}" ; \
754 else \
755 echo "Downloading OSU standard T18 cell library from ${OSU_T18_URL}" ; \
Tim Edwardsc74daac2023-01-05 15:38:30 -0500756 ../scripts/download.sh ${OSU_T18_URL} ${OSU_T18_PATH} ${OSU_T18_COMMIT} ; \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400757 fi ; \
758 fi
759
Tim Edwards52af7762022-02-18 13:49:23 -0500760# Update prerequisites
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500761update: update-pdk-repo update-alpha-repo update-xschem-repo update-klayout-repo update-precheck-repo update-sram-repo update-sram-space-repo update-osu-t12-repo update-osu-t15-repo update-osu-t18-repo
Tim Edwards52af7762022-02-18 13:49:23 -0500762
763update-pdk-repo:
764 if test "x${SKYWATER_PATH}" != "x" ; then \
765 echo "Updating SkyWater PDK from ${PDK_URL}" ; \
766 custom/scripts/pdk_update.sh ${SKYWATER_PATH} ; \
767 fi
768
769update-alpha-repo:
770 if test "x${ALPHA_PATH}" != "x" ; then \
771 echo "Updating alphanumeric library from ${ALPHA_URL}" ; \
772 ../scripts/update.sh ${ALPHA_PATH} ; \
773 fi
774
775update-sram-repo:
776 if test "x${SRAM_PATH}" != "x" ; then \
777 echo "Updating SRAM macro library from ${SRAM_URL}" ; \
778 ../scripts/update.sh ${SRAM_PATH} ; \
779 fi
780
Tim Edwardsd6c91b42023-01-04 17:03:58 -0500781update-sram-space-repo:
782 if test "x${SRAM_SPACE_PATH}" != "x" ; then \
783 echo "Updating SRAM build-space library from ${SRAM_SPACE_URL}" ; \
784 ../scripts/update.sh ${SRAM_SPACE_PATH} ; \
785 fi
786
Tim Edwards52af7762022-02-18 13:49:23 -0500787update-xschem-repo:
788 if test "x${XSCHEM_PATH}" != "x" ; then \
789 echo "Updating xschem setup from ${XSCHEM_URL}" ; \
790 ../scripts/update.sh ${XSCHEM_PATH} ; \
791 fi
792
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400793update-klayout-repo:
794 if test "x${KLAYOUT_PATH}" != "x" ; then \
795 echo "Updating klayout setup from ${KLAYOUT_URL}" ; \
796 ../scripts/update.sh ${KLAYOUT_PATH} ; \
797 fi
798
799update-precheck-repo:
800 if test "x${PRECHECK_PATH}" != "x" ; then \
801 echo "Updating klayout setup from ${PRECHECK_URL}" ; \
802 ../scripts/update.sh ${PRECHECK_PATH} ; \
803 fi
804
Tim Edwards52af7762022-02-18 13:49:23 -0500805update-osu-t12-repo:
806 if test "x${OSU_T12_PATH}" != "x" ; then \
807 echo "Updating OSU standard T12 cell library from ${OSU_T12_URL}" ; \
808 ../scripts/update.sh ${OSU_T12_PATH} ; \
809 fi
810
811update-osu-t15-repo:
812 if test "x${OSU_T15_PATH}" != "x" ; then \
813 echo "Updating OSU standard T15 cell library from ${OSU_T15_URL}" ; \
814 ../scripts/update.sh ${OSU_T15_PATH} ; \
815 fi
816
817update-osu-t18-repo:
818 if test "x${OSU_T18_PATH}" != "x" ; then \
819 echo "Updating OSU standard T18 cell library from ${OSU_T18_URL}" ; \
820 ../scripts/update.sh ${OSU_T18_PATH} ; \
821 fi
822
Tim Edwards58b1a922022-01-17 15:55:42 -0500823all-%: prerequisites
824 echo "Starting sky130$* PDK staging on "`date` > ${SKY130$*}_make.log
825 ${MAKE} general-$*
826 ${MAKE} tools-$*
827 ${MAKE} vendor-$*
828 echo "Ended sky130$* PDK staging on "`date` >> ${SKY130$*}_make.log
Tim Edwardscfe970c2021-02-26 14:35:51 -0500829
Tim Edwards58b1a922022-01-17 15:55:42 -0500830general-%: ${TECH}.json
831 mkdir -p ${STAGING_PATH}/${SKY130$*}/${CONFIG_DIR}
832 rm -f ${STAGING_PATH}/${SKY130$*}/${CONFIG_DIR}/nodeinfo.json
833 ${CPP} ${SKY130$*_DEFS} ${COMMIT_DEFS} ${TECH}.json \
834 ${STAGING_PATH}/${SKY130$*}/${CONFIG_DIR}/nodeinfo.json
Tim Edwardscfe970c2021-02-26 14:35:51 -0500835
Tim Edwards58b1a922022-01-17 15:55:42 -0500836tools-A: $(addsuffix -A, $(TOOLS))
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400837
Tim Edwards58b1a922022-01-17 15:55:42 -0500838tools-B: $(addsuffix -B, $(TOOLS))
839
840magic-%: magic/${TECH}.tech magic/${TECH}gds.tech magic/${TECH}.magicrc magic/${TECH}.tcl
841 mkdir -p ${MAGICTOP_STAGING_$*}
842 mkdir -p ${MAGIC_STAGING_$*}
843 rm -f ${MAGICTOP_STAGING_$*}/current
844 rm -f ${MAGIC_STAGING_$*}/${SKY130$*}.tech
845 rm -f ${MAGIC_STAGING_$*}/${SKY130$*}-GDS.tech
846 rm -f ${MAGIC_STAGING_$*}/${SKY130$*}.tcl
847 rm -f ${MAGIC_STAGING_$*}/${SKY130$*}-BindKeys
848 rm -f ${MAGIC_STAGING_$*}/magicrc
Tim Edwards4db522f2021-05-04 13:34:40 -0400849 if test "${EF_STYLE}" == "1" ; then \
Tim Edwards58b1a922022-01-17 15:55:42 -0500850 (cd ${MAGICTOP_STAGING_$*} ; ln -s ${REV_DIR} current) ; \
Tim Edwards9134eed2021-02-13 14:42:59 -0500851 fi
Tim Edwards58b1a922022-01-17 15:55:42 -0500852 cp -rp custom/scripts/seal_ring_generator ${MAGIC_STAGING_$*}/.
853 cp -rp custom/scripts/bump_bond_generator ${MAGIC_STAGING_$*}/.
Tim Edwards58b1a922022-01-17 15:55:42 -0500854 cp custom/scripts/run_standard_drc.py ${MAGIC_STAGING_$*}/.
Tim Edwards7325e442022-03-03 16:51:52 -0500855 ${CPP} ${SKY130$*_DEFS} custom/scripts/generate_fill.py \
856 ${MAGIC_STAGING_$*}/generate_fill.py
857 ${CPP} ${SKY130$*_DEFS} custom/scripts/check_density.py \
858 ${MAGIC_STAGING_$*}/check_density.py
859 ${CPP} ${SKY130$*_DEFS} custom/scripts/check_antenna.py \
860 ${MAGIC_STAGING_$*}/check_antenna.py
Tim Edwards58b1a922022-01-17 15:55:42 -0500861 ${CPP} ${SKY130$*_DEFS} magic/${TECH}.tech ${MAGIC_STAGING_$*}/${SKY130$*}.tech
862 ${CPP} ${SKY130$*_DEFS} magic/${TECH}gds.tech ${MAGIC_STAGING_$*}/${SKY130$*}-GDS.tech
863 ${CPP} ${SKY130$*_DEFS} magic/${TECH}.magicrc ${MAGIC_STAGING_$*}/${SKY130$*}.magicrc
864 ${CPP} ${SKY130$*_DEFS} ../common/pdk.bindkeys ${MAGIC_STAGING_$*}/${SKY130$*}-BindKeys
865 ${CPP} ${SKY130$*_DEFS} magic/${TECH}.tcl ${MAGIC_STAGING_$*}/${SKY130$*}.tcl
866 ${CPP} ${SKY130$*_DEFS} ../common/pdk.tcl >> ${MAGIC_STAGING_$*}/${SKY130$*}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400867
Tim Edwards58b1a922022-01-17 15:55:42 -0500868qflow-%: qflow/${TECH}.sh qflow/${TECH}.par
869 mkdir -p ${QFLOWTOP_STAGING_$*}
870 mkdir -p ${QFLOW_STAGING_$*}
871 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hd.sh
872 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hd.par
873 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hdll.sh
874 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hdll.par
875 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hs.sh
876 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hs.par
877 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hvl.sh
878 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_hvl.par
879 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_ls.sh
880 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_ls.par
881 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_lp.sh
882 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_lp.par
883 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_ms.sh
884 rm -f ${QFLOW_STAGING_$*}/sky130_fd_sc_ms.par
885 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ls.sh
886 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ls.par
887 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ms.sh
888 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ms.par
889 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_hs.sh
890 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_hs.par
891 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ls.sh
892 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ls.par
893 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ms.sh
894 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ms.par
895 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_hs.sh
896 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_hs.par
897 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ls.sh
898 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ls.par
899 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ms.sh
900 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ms.par
901 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_hs.sh
902 rm -f ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_hs.par
903 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_hd -DVOLTAGE=1v95 \
904 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_hd.sh
905 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_hdll -DVOLTAGE=1v95 \
906 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_hdll.sh
907 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_hvl -DVOLTAGE=4v95 \
908 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_hvl.sh
909 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_hs -DVOLTAGE=1v95 \
910 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_hs.sh
911 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_lp -DVOLTAGE=1v95 \
912 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_lp.sh
913 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_ls -DVOLTAGE=1v95 \
914 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_ls.sh
915 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_fd_sc_ms -DVOLTAGE=1v95 \
916 qflow/${TECH}.sh ${QFLOW_STAGING_$*}/sky130_fd_sc_ms.sh
917 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_12t_ls qflow/sky130osu.sh \
918 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ls.sh
919 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_12t_ms qflow/sky130osu.sh \
920 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ms.sh
921 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_12t_hs qflow/sky130osu.sh \
922 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_hs.sh
923 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_15t_ls qflow/sky130osu.sh \
924 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ls.sh
925 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_15t_ms qflow/sky130osu.sh \
926 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ms.sh
927 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_15t_hs qflow/sky130osu.sh \
928 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_hs.sh
929 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_18t_ls qflow/sky130osu.sh \
930 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ls.sh
931 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_18t_ms qflow/sky130osu.sh \
932 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ms.sh
933 ${CPP} ${SKY130$*_DEFS} -DLIBRARY=sky130_osu_sc_18t_hs qflow/sky130osu.sh \
934 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_hs.sh
935 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_hd.par
936 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_hdll.par
937 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_hvl.par
938 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_hs.par
939 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_ms.par
940 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_lp.par
941 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_$*}/sky130_fd_sc_ls.par
942 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
943 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ls.par
944 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
945 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_ms.par
946 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
947 ${QFLOW_STAGING_$*}/sky130_osu_sc_12t_hs.par
948 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
949 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ls.par
950 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
951 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_ms.par
952 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
953 ${QFLOW_STAGING_$*}/sky130_osu_sc_15t_hs.par
954 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
955 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ls.par
956 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
957 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_ms.par
958 ${CPP} ${SKY130$*_DEFS} qflow/${TECH}.par \
959 ${QFLOW_STAGING_$*}/sky130_osu_sc_18t_hs.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400960
Tim Edwards58b1a922022-01-17 15:55:42 -0500961netgen-%: netgen/${TECH}_setup.tcl
962 mkdir -p ${NETGENTOP_STAGING_$*}
963 mkdir -p ${NETGEN_STAGING_$*}
964 rm -f ${NETGEN_STAGING_$*}/${SKY130$*}_setup.tcl
965 rm -f ${NETGEN_STAGING_$*}/setup.tcl
966 ${CPP} ${SKY130$*_DEFS} netgen/${TECH}_setup.tcl \
967 ${NETGEN_STAGING_$*}/${SKY130$*}_setup.tcl
968 (cd ${NETGEN_STAGING_$*} ; ln -s ${SKY130$*}_setup.tcl setup.tcl)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400969
Tim Edwards58b1a922022-01-17 15:55:42 -0500970irsim-%: irsim
971 mkdir -p ${IRSIMTOP_STAGING_$*}
972 mkdir -p ${IRSIM_STAGING_$*}
973 rm -f ${IRSIM_STAGING_$*}/${SKY130$*}_*.prm
Tim Edwards6f01cd22022-01-17 19:23:53 -0500974 for corner in ${IRSIM_CORNERS} ; do \
Tim Edwardsd7c3a522022-10-01 17:58:29 -0400975 cat irsim/header.txt irsim/sky130_$$corner > \
976 ${IRSIM_STAGING_$*}/${SKY130$*}_$$corner ; \
Tim Edwards6f01cd22022-01-17 19:23:53 -0500977 done
Tim Edwards367711e2021-01-27 10:35:12 -0500978
Tim Edwards58b1a922022-01-17 15:55:42 -0500979xcircuit-%: xcircuit/${TECH}.xcircuitrc
980 rm -rf ${XCIRCUIT_STAGING_$*}
981 mkdir -p ${XCIRCUITTOP_STAGING_$*}
982 mkdir -p ${XCIRCUIT_STAGING_$*}
983 rm -f ${XCIRCUIT_STAGING_$*}/*.lps
984 rm -f ${XCIRCUIT_STAGING_$*}/${SKY130$*}.xcircuitrc
985 ${CPP} ${SKY130$*_DEFS} xcircuit/ngspice.lps ${XCIRCUIT_STAGING_$*}/ngspice.lps
986 ${CPP} ${SKY130$*_DEFS} xcircuit/sky130_fd_pr.lps \
987 ${XCIRCUIT_STAGING_$*}/sky130_fd_pr.lps
988 ${CPP} ${SKY130$*_DEFS} -DHD_SPICE=${HD_SPICE} -DSPIEXT=${SPIEXT} \
989 xcircuit/sky130_fd_sc_hd.lps ${XCIRCUIT_STAGING_$*}/sky130_fd_sc_hd.lps
990 ${CPP} ${SKY130$*_DEFS} xcircuit/${TECH}.xcircuitrc \
991 ${XCIRCUIT_STAGING_$*}/${SKY130$*}.xcircuitrc
Tim Edwardse4c44092021-02-12 10:18:56 -0500992
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400993klayout-%: ${KLAYOUT_PATH}
994 if test "x${KLAYOUT_PATH}" != "x" ; then \
995 rm -rf ${KLAYOUT_STAGING_$*} ; \
996 mkdir -p ${KLAYOUT_STAGING_$*} ; \
997 mkdir -p ${KLAYOUT_STAGING_$*}/tech ; \
998 mkdir -p ${KLAYOUT_STAGING_$*}/drc ; \
999 mkdir -p ${KLAYOUT_STAGING_$*}/lvs ; \
1000 mkdir -p ${KLAYOUT_STAGING_$*}/scripts ; \
1001 mkdir -p ${KLAYOUT_STAGING_$*}/pymacros ; \
1002 fi
1003 # Copy lvs and pymacro directories from the repository. Other files
Tim Edwardsebfa1082022-11-02 10:11:53 -04001004 # are rearranged to the preferred structure. Do not recursively copy
1005 # the lvs/ directory, as the subdirectory testing/ is huge and
1006 # nonessential.
Tim Edwards5ed94ff2022-06-16 15:07:53 -04001007 if test "x${KLAYOUT_PATH}" != "x" ; then \
Tim Edwardsebfa1082022-11-02 10:11:53 -04001008 cp -p ${KLAYOUT_PATH}/sky130_tech/tech/sky130/lvs/* ${KLAYOUT_STAGING_$*}/lvs/ ; \
Tim Edwards5ed94ff2022-06-16 15:07:53 -04001009 cp -rp ${KLAYOUT_PATH}/sky130_tech/tech/sky130/pymacros/* ${KLAYOUT_STAGING_$*}/pymacros/ ; \
1010 cp ${KLAYOUT_PATH}/sky130_tech/tech/sky130/${TECH}.lyp ${KLAYOUT_STAGING_$*}/tech/${SKY130$*}.lyp ; \
1011 cp ${KLAYOUT_PATH}/sky130_tech/tech/sky130/${TECH}.lyt ${KLAYOUT_STAGING_$*}/tech/${SKY130$*}.lyt ; \
1012 cp -rp ${KLAYOUT_PATH}/scripts/* ${KLAYOUT_STAGING_$*}/scripts/ ; \
1013 fi
Tim Edwardsb6224692022-10-14 12:46:58 -04001014 # Copy original DRC deck from open_pdks (is this useful?)
1015 cp klayout/sky130.lydrc ${KLAYOUT_STAGING_$*}/drc/${SKY130$*}.lydrc
Tim Edwards5ed94ff2022-06-16 15:07:53 -04001016 # Copy drc directory contents from the Efabless Open MPW precheck repository
1017 if test "x${PRECHECK_PATH}" != "x" ; then \
1018 cp ${PRECHECK_PATH}/checks/tech-files/sky130A_mr.drc ${KLAYOUT_STAGING_$*}/drc/${SKY130$*}_mr.drc ; \
1019 cp -rp ${PRECHECK_PATH}/checks/drc_checks/klayout/* ${KLAYOUT_STAGING_$*}/drc/ ; \
1020 fi
1021
Tim Edwards58b1a922022-01-17 15:55:42 -05001022xschem-%: ${XSCHEM_PATH}
Johan Euphrosine7c6ad6e2022-02-02 10:30:41 +09001023 if test "x${XSCHEM_PATH}" != "x" ; then \
1024 rm -rf ${XSCHEM_STAGING_$*} ; \
1025 mkdir -p ${XSCHEMTOP_STAGING_$*} ; \
1026 mkdir -p ${XSCHEM_STAGING_$*} ; \
1027 fi
Tim Edwards5d498672022-11-02 11:24:26 -04001028 # Copy the xschem repository (other than .git, if it exists)
1029 # then remove the larger of the two example directories
Tim Edwards1168a8b2021-02-10 22:06:54 -05001030 if test "x${XSCHEM_PATH}" != "x" ; then \
Johan Euphrosine7c6ad6e2022-02-02 10:30:41 +09001031 cp -rp ${XSCHEM_PATH}/* ${XSCHEM_STAGING_$*} ; \
Tim Edwards5d498672022-11-02 11:24:26 -04001032 rm -rf ${XSCHEM_STAGING_$*}/decred_hash_macro ; \
Tim Edwards1168a8b2021-02-10 22:06:54 -05001033 fi
Tim Edwards52af7762022-02-18 13:49:23 -05001034 # xschem setup is for sky130A. Fix for the given target variant.
1035 # Add custom additions to the startup file for open_pdk.
Johan Euphrosine7c6ad6e2022-02-02 10:30:41 +09001036 if test "x${XSCHEM_PATH}" != "x" ; then \
1037 cat ${XSCHEM_PATH}/xschemrc | \
Tim Edwards52af7762022-02-18 13:49:23 -05001038 ${SED} -e "/sky130A/s#sky130A#TECHNAME#" \
1039 > ${XSCHEM_STAGING_$*}/xschemrc_source ; \
1040 ${CPP} ${SKY130$*_DEFS} ${XSCHEM_STAGING_$*}/xschemrc_source \
1041 ${XSCHEM_STAGING_$*}/xschemrc ; \
1042 cat ${XSCHEM_PATH}/xschem_verilog_import/xschemrc | \
1043 ${SED} -e "/sky130A/s#sky130A#TECHNAME#" \
1044 > ${XSCHEM_STAGING_$*}/xschemrc_source ; \
1045 ${CPP} ${SKY130$*_DEFS} ${XSCHEM_STAGING_$*}/xschemrc_source \
1046 ${XSCHEM_STAGING_$*}/xschem_verilog_import/xschemrc ; \
1047 rm -f ${XSCHEM_STAGING_$*}/xschemrc_source ; \
1048 cat ./custom/xschem/xschemrc_append >> ${XSCHEM_STAGING_$*}/xschemrc ; \
1049 fi
1050 # In the sky130A variant, remove the reram schematic/symbol and references
1051 if test "x${XSCHEM_PATH}" != "x" ; then \
1052 if test "x$*" == "xA" ; then \
Tim Edwards7d5df632022-07-02 17:18:20 -04001053 rm -f ${XSCHEM_STAGING_$*}/sky130_tests/test_reram* ; \
Tim Edwards52af7762022-02-18 13:49:23 -05001054 rm -f ${XSCHEM_STAGING_$*}/sky130_tests/tb_reram* ; \
1055 rm -f ${XSCHEM_STAGING_$*}/sky130_fd_pr/reram* ; \
1056 cat ${XSCHEM_STAGING_$*}/sky130_tests/top.sch | \
Tim Edwards7d5df632022-07-02 17:18:20 -04001057 ${SED} -e "/^C.*{.*reram.*}.*{.*[^}] *$$/,/.*} *$$/d" \
1058 -e "/^C.*{.*reram.*}.*{.*} *$$/d" \
Tim Edwards52af7762022-02-18 13:49:23 -05001059 > ${XSCHEM_STAGING_$*}/temp ; \
1060 mv ${XSCHEM_STAGING_$*}/temp ${XSCHEM_STAGING_$*}/sky130_tests/top.sch ; \
1061 fi ; \
Johan Euphrosine7c6ad6e2022-02-02 10:30:41 +09001062 fi
Tim Edwards476f7422021-12-16 19:59:35 -05001063
Tim Edwards8e80d782022-03-01 01:29:16 -05001064openlane-%: openlane/config.tcl 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
Tim Edwards58b1a922022-01-17 15:55:42 -05001065 mkdir -p ${OPENLANETOP_STAGING_$*}
1066 mkdir -p ${OPENLANE_STAGING_$*}
1067 rm -rf ${OPENLANE_STAGING_$*}/custom_cells/*
1068 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_hd
1069 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_hs
1070 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_ls
1071 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_ms
1072 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_hdll
1073 mkdir -p ${OPENLANE_STAGING_$*}/sky130_fd_sc_hvl
1074 mkdir -p ${OPENLANE_STAGING_$*}/sky130_osu_sc_t18
1075 rm -f ${OPENLANE_STAGING_$*}/common_pdn.info
1076 rm -f ${OPENLANE_STAGING_$*}/config.tcl
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001077 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001078 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_hd/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001079 done
1080 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001081 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_hs/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001082 done
1083 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001084 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_hdll/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001085 done
1086 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001087 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_ls/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001088 done
1089 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001090 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_ms/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001091 done
1092 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001093 rm -f ${OPENLANE_STAGING_$*}/sky130_fd_sc_hvl/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001094 done
1095 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001096 rm -f ${OPENLANE_STAGING_$*}/sky130_osu_sc_t18/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001097 done
1098
Tim Edwards8e80d782022-03-01 01:29:16 -05001099 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.min.magic
1100 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.nom.magic
1101 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.max.magic
1102
Donn41c09082022-04-14 22:59:39 +00001103 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.min.spef_extractor
1104 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.nom.spef_extractor
1105 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.max.spef_extractor
1106
Tim Edwardsae72c882022-10-01 11:14:48 -04001107 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.min.calibre
1108 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.nom.calibre
1109 rm -f ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.max.calibre
1110
Tim Edwards58b1a922022-01-17 15:55:42 -05001111 cp -r openlane/custom_cells ${OPENLANE_STAGING_$*}
Donne8294522022-07-29 14:40:07 +02001112 cp -r openlane/cvc ${OPENLANE_STAGING_$*}
Tim Edwards58b1a922022-01-17 15:55:42 -05001113 ${CPP} ${SKY130$*_DEFS} openlane/config.tcl ${OPENLANE_STAGING_$*}/config.tcl
Tim Edwards8e80d782022-03-01 01:29:16 -05001114
1115 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.min.magic \
1116 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.min.magic
1117 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.nom.magic \
1118 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.nom.magic
1119 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.max.magic \
1120 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.max.magic
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001121
Donn41c09082022-04-14 22:59:39 +00001122 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.min.spef_extractor \
1123 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.min.spef_extractor
1124 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.nom.spef_extractor \
1125 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.nom.spef_extractor
1126 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.max.spef_extractor \
1127 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.max.spef_extractor
1128
Tim Edwards50e63b02022-10-17 14:47:42 -04001129 # Only install the calibre-derived rule files if they exist in the source
1130 if test -f openlane/rules.openrcx.sky130$*.min.calibre ; then \
1131 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.min.calibre \
1132 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.min.calibre ;\
1133 fi
1134 if test -f openlane/rules.openrcx.sky130$*.nom.calibre ; then \
1135 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.nom.calibre \
1136 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.nom.calibre ;\
1137 fi
1138 if test -f openlane/rules.openrcx.sky130$*.max.calibre ; then \
1139 ${CPP} ${SKY130$*_DEFS} openlane/rules.openrcx.sky130$*.max.calibre \
1140 ${OPENLANE_STAGING_$*}/rules.openrcx.sky130$*.max.calibre ;\
1141 fi
Tim Edwardsae72c882022-10-01 11:14:48 -04001142
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001143 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001144 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_hd/$$file \
1145 ${OPENLANE_STAGING_$*}/sky130_fd_sc_hd/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001146 done
1147 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001148 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_hs/$$file \
1149 ${OPENLANE_STAGING_$*}/sky130_fd_sc_hs/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001150 done
1151 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001152 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_ms/$$file \
1153 ${OPENLANE_STAGING_$*}/sky130_fd_sc_ms/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001154 done
1155 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001156 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_ls/$$file \
1157 ${OPENLANE_STAGING_$*}/sky130_fd_sc_ls/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001158 done
1159 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001160 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_hdll/$$file \
1161 ${OPENLANE_STAGING_$*}/sky130_fd_sc_hdll/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001162 done
1163 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards58b1a922022-01-17 15:55:42 -05001164 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_fd_sc_hvl/$$file \
1165 ${OPENLANE_STAGING_$*}/sky130_fd_sc_hvl/$$file ; \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -05001166 done
1167
Tim Edwards58b1a922022-01-17 15:55:42 -05001168 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_osu_sc_t18/config.tcl \
1169 ${OPENLANE_STAGING_$*}/sky130_osu_sc_t18/config.tcl
1170 ${CPP} -quiet ${SKY130$*_DEFS} openlane/sky130_osu_sc_t18/tracks.info \
1171 ${OPENLANE_STAGING_$*}/sky130_osu_sc_t18/tracks.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001172
Tim Edwardsd6c91b42023-01-04 17:03:58 -05001173vendor-A: primitive-build-A io-build-A sram-build-A sram-space-build-A digital-hd-build-A digital-hvl-build-A digital-hdll-build-A digital-lp-build-A digital-hs-build-A digital-ms-build-A digital-ls-build-A alpha-build-A osu-t12-build-A osu-t15-build-A osu-t18-build-A
Tim Edwards7519dfb2022-02-10 11:39:09 -05001174
Tim Edwardsd6c91b42023-01-04 17:03:58 -05001175vendor-B: primitive-build-B io-build-B sram-build-B sram-space-build-B digital-hd-build-B digital-hvl-build-B digital-hdll-build-B digital-lp-build-B digital-hs-build-B digital-ms-build-B digital-ls-build-B alpha-build-B osu-t12-build-B osu-t15-build-B osu-t18-build-B
Tim Edwards7519dfb2022-02-10 11:39:09 -05001176
1177primitive-build-%:
Tim Edwardsdaad1062021-05-19 10:51:27 -04001178 # Build targets conditionally based on what repositories or submodules
1179 # were selected or initialized. To be done: Allow a library version
1180 # to be specified that overrides "latest".
1181 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_pr/latest/cells ; then \
1182 echo "Building primitives library and simulation models" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001183 make primitive-$*;\
Tim Edwardsdaad1062021-05-19 10:51:27 -04001184 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001185
1186io-build-%:
Tim Edwardsdaad1062021-05-19 10:51:27 -04001187 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_io/latest/cells ; then \
1188 echo "Building padframe I/O libraries" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001189 make io-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -04001190 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001191
1192digital-hd-build-%:
Tim Edwardsdaad1062021-05-19 10:51:27 -04001193 # This assumes that at least the HD library submodule exists. Also it
1194 # assumes that the same library version is used for all libraries, which
1195 # is fine with "latest" but otherwise probably invalid.
1196 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_hd/latest/cells ; then \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001197 echo "Building digital high-density standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001198 make digital-hd-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001199 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001200
1201digital-hvl-build-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001202 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_hvl/latest/cells ; then \
1203 echo "Building digital high-voltage standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001204 make digital-hvl-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001205 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001206
1207digital-hdll-build-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001208 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_hdll/latest/cells ; then \
1209 echo "Building digital high-density low-leakage standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001210 make digital-hdll-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001211 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001212
1213digital-lp-build-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001214 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_lp/latest/cells ; then \
1215 echo "Building digital low-power standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001216 make digital-lp-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001217 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001218
1219digital-hs-build-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001220 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_hs/latest/cells ; then \
1221 echo "Building digital high-speed standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001222 make digital-hs-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001223 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001224
1225digital-ms-build-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001226 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_ms/latest/cells ; then \
1227 echo "Building digital medium-speed standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001228 make digital-ms-$* ;\
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001229 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001230
1231digital-ls-build-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001232 if test -d ${SKYWATER_LIBS_PATH}/sky130_fd_sc_ls/latest/cells ; then \
1233 echo "Building digital low-speed standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001234 make digital-ls-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -04001235 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001236
1237alpha-build-%:
Tim Edwardse5e43b52021-09-08 11:46:04 -04001238 if test "x${ALPHA_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -04001239 echo "Building alphanumeric layout libraries" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001240 make alpha-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -04001241 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001242
1243sram-build-%:
Tim Edwardse5e43b52021-09-08 11:46:04 -04001244 if test "x${SRAM_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -04001245 echo "Building SRAM macro library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001246 make sram-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -04001247 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001248
Tim Edwardsd6c91b42023-01-04 17:03:58 -05001249sram-space-build-%:
1250 if test "x${SRAM_SPACE_PATH}" != "x" ; then \
1251 echo "Building SRAM build-space library" ;\
1252 make sram-space-$* ;\
1253 fi
1254
Tim Edwards7519dfb2022-02-10 11:39:09 -05001255osu-t12-build-%:
Tim Edwardse5e43b52021-09-08 11:46:04 -04001256 if test "x${OSU_T12_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -04001257 echo "Building OSU 12-track-high standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001258 make osu-t12-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -04001259 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001260
1261osu-t15-build-%:
Tim Edwardse5e43b52021-09-08 11:46:04 -04001262 if test "x${OSU_T15_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -04001263 echo "Building OSU 15-track-high standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001264 make osu-t15-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -04001265 fi
Tim Edwards7519dfb2022-02-10 11:39:09 -05001266
1267osu-t18-build-%:
Tim Edwardse5e43b52021-09-08 11:46:04 -04001268 if test "x${OSU_T18_PATH}" != "x" ; then \
Tim Edwardsdaad1062021-05-19 10:51:27 -04001269 echo "Building OSU 18-track-high standard cell library" ;\
Tim Edwards58b1a922022-01-17 15:55:42 -05001270 make osu-t18-$* ;\
Tim Edwardsdaad1062021-05-19 10:51:27 -04001271 fi
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001272
Tim Edwards58b1a922022-01-17 15:55:42 -05001273primitive-%:
Tim Edwards106e38b2020-09-20 13:07:54 -04001274 # Install device subcircuits from vendor files
Tim Edwards58b1a922022-01-17 15:55:42 -05001275 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards995c1332020-09-25 15:33:58 -04001276 -ngspice sky130_fd_pr/latest/models/* \
Tim Edwardsfd20a0a2021-08-31 19:58:51 -04001277 filter=custom/scripts/rename_models.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001278 2>&1 | tee -a ${SKY130$*}_make.log
Tim 'mithro' Ansell3c6913c2021-06-13 10:35:33 -07001279 # Install device layouts from custom sources
Tim Edwards58b1a922022-01-17 15:55:42 -05001280 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards7e294962021-05-04 20:33:17 -04001281 -gds sky130_fd_pr/*.gds \
1282 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001283 -library primitive sky130_fd_pr 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwards4697a172021-11-05 22:47:07 -04001284 # Install base device library from vendor files.
Tim Edwards58b1a922022-01-17 15:55:42 -05001285 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards7e294962021-05-04 20:33:17 -04001286 -gds %l/latest/cells/*/*.gds \
Tim Edwards4697a172021-11-05 22:47:07 -04001287 no-copy=custom/sky130_fd_pr/*.gds \
1288 include=custom/sky130_fd_pr/*.gds \
Tim Edwards7e294962021-05-04 20:33:17 -04001289 compile-only \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -04001290 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards106e38b2020-09-20 13:07:54 -04001291 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwardsbfc82692020-09-20 21:33:08 -04001292 -spice %l/latest/cells/*/*.spice filter=custom/scripts/rename_cells.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001293 -library primitive sky130_fd_pr 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse60b4862020-11-23 16:56:52 -05001294 # Custom: Add "short" resistor model and subcircuit to the r+c models file
Tim Edwards42f79a32020-09-21 14:18:09 -04001295 cat ./custom/models/short.spice >> \
Tim Edwards58b1a922022-01-17 15:55:42 -05001296 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -05001297 # Custom: Add diodes as subcircuits to the r+c models file
1298 cat ./custom/models/diode.spice >> \
Tim Edwards58b1a922022-01-17 15:55:42 -05001299 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardsf63ee052021-04-29 15:13:45 -04001300 # Custom: Add resistors as subcircuits to the r+c models file
1301 cat ./custom/models/resistor.spice >> \
Tim Edwards58b1a922022-01-17 15:55:42 -05001302 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -05001303
Tim Edwardsb94b6c12022-02-05 16:47:22 -05001304 # Custom: Patch the r+c.mrp1monte.spice file to make the generic poly
1305 # resistor a type "R" device.
1306 ${PATCH} -p1 -f -d ${STAGING_PATH}/${SKY130$*} \
Tim Edwards25972f82021-04-27 21:45:58 -04001307 < custom/patches/sky130_fd_pr_2.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001308 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf499ad22021-05-04 16:55:21 -04001309 # Custom: Patch the models to remove the substrate pin from the PNP
1310 # device, which has no independent substrate pin (collector=substrate)
Tim Edwardsb94b6c12022-02-05 16:47:22 -05001311 ${PATCH} -p4 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE} \
Tim Edwardsf499ad22021-05-04 16:55:21 -04001312 < custom/patches/sky130_fd_pr_3.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001313 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf63ee052021-04-29 15:13:45 -04001314 # Custom: Patch the ngspice models to add the HV diffusion resistor subcircuits
Tim Edwardsb94b6c12022-02-05 16:47:22 -05001315 ${PATCH} -p2 -f -d ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice \
Tim Edwardsf63ee052021-04-29 15:13:45 -04001316 < custom/patches/sky130_fd_pr_5.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001317 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf499ad22021-05-04 16:55:21 -04001318 # Fix up the PNP model file before running the next modification
Tim Edwards58b1a922022-01-17 15:55:42 -05001319 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
1320 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
1321 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 -04001322 # Custom: Add the PNP 3.4x3.4um device model to the includes in "all.spice"
Tim Edwards8b5d6942021-09-08 11:12:50 -04001323 ./custom/scripts/fix_spice_includes.py ${EF_FORMAT} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001324 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/all.spice \
1325 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards1491dd72022-03-31 08:57:28 -04001326 # Custom: Add the PNP 3.4x3.4um device model to the includes in "montecarlo.spice"
1327 ./custom/scripts/fix_spice_includes2.py ${EF_FORMAT} \
1328 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/parameters/montecarlo.spice \
1329 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards9fdf5f02021-05-03 16:15:03 -04001330 # Custom: Parse the (commented out) statistics blocks and generate
1331 # ngspice-compatible monte carlo parameters for mismatch and process
Tim Edwards7325e442022-03-03 16:51:52 -05001332 ./custom/scripts/mismatch_params.py ${EF_FORMAT} -variant=${SKY130$*} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001333 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards7325e442022-03-03 16:51:52 -05001334 ./custom/scripts/mismatch_params.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001335 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice \
1336 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards7325e442022-03-03 16:51:52 -05001337 ./custom/scripts/process_params.py ${EF_FORMAT} -variant=${SKY130$*} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001338 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards8e5afcc2022-04-02 20:42:53 -04001339 ./custom/scripts/process_params.py \
1340 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice \
1341 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards7325e442022-03-03 16:51:52 -05001342 ./custom/scripts/montecarlo_hack.py -variant=${SKY130$*} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001343 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards1c74f852021-06-09 16:46:50 -04001344 # Custom: Change vt to local_vt in one file for Xyce compatibilty
1345 ./custom/scripts/xyce_hack.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001346 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__res_iso_pw.model.spice \
1347 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsc12c7952021-08-26 11:23:42 -04001348 # Custom: Remove ACM model parameters from BSIM3 devices
1349 ./custom/scripts/xyce_hack2.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001350 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__special_nfet_pass.pm3.spice \
1351 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsc12c7952021-08-26 11:23:42 -04001352 ./custom/scripts/xyce_hack2.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001353 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__special_pfet_pass.pm3.spice \
1354 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsc12c7952021-08-26 11:23:42 -04001355 ./custom/scripts/xyce_hack2.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001356 ${STAGING_PATH}/${SKY130$*}/libs.ref/${PR_SPICE}/sky130_fd_pr__special_nfet_latch.pm3.spice \
1357 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsc12c7952021-08-26 11:23:42 -04001358
Tim Edwards3c8f63a2021-09-14 11:05:48 -04001359 # Install custom corrected/enhanced sky130.lib.spice
1360 cp custom/models/sky130.lib.spice \
Tim Edwards58b1a922022-01-17 15:55:42 -05001361 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice \
1362 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards956e3022021-05-27 20:43:26 -04001363 # Custom: Add special device ID layers to bipolar layouts in magic
1364 # to make the extraction models correct.
Tim Edwards7325e442022-03-03 16:51:52 -05001365 ./custom/scripts/add_bipolar_ids.py ${EF_FORMAT} -variant=${SKY130$*} \
Tim Edwards58b1a922022-01-17 15:55:42 -05001366 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwards9fdf5f02021-05-03 16:15:03 -04001367
Tim Edwards10aa9ab2021-03-15 17:46:29 -04001368 # Custom: Add "spinit" file
1369 cat ./custom/models/spinit >> \
Tim Edwards58b1a922022-01-17 15:55:42 -05001370 ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/spinit
Tim Edwards10aa9ab2021-03-15 17:46:29 -04001371
Tim Edwards58b1a922022-01-17 15:55:42 -05001372io-%:
Ahmed Ghazy59370ab2020-10-29 02:04:45 +02001373 # Install custom additions to I/O pad library
Tim Edwards58b1a922022-01-17 15:55:42 -05001374 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsb063d372021-11-12 16:15:18 -05001375 -verilog %l/verilog/*.v compile-only rename=sky130_ef_io \
Ahmed Ghazy59370ab2020-10-29 02:04:45 +02001376 -cdl %l/cdl/*.cdl \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001377 -spice %l/spice/*.spice \
Tim Edwards89f6ff42021-12-02 09:48:21 -05001378 -lib %l/lib/*.lib \
Tim Edwards11af1922022-10-27 14:58:52 -04001379 -gds %l/gds/*.gds options=custom/scripts/gds_import_io.tcl \
Tim Edwards002b5dd2022-10-29 17:55:04 -04001380 -lef %l/lef/*.lef exclude=sky130_fd_io__top_xres4v2.lef,sky130_fd_io__top_power_hvc_wpadv2.lef \
Tim Edwardsb063d372021-11-12 16:15:18 -05001381 compile-only rename=sky130_ef_io \
Tim Edwards002b5dd2022-10-29 17:55:04 -04001382 -lef %l/lef/sky130_fd_io__top_*.lef \
Tim Edwards58b1a922022-01-17 15:55:42 -05001383 -library general sky130_fd_io 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsb5bfca82022-03-04 11:29:56 -05001384 # Copy the GDS file for the GPIOv2 cell, then run the script that fixes it.
1385 cp ${SKYWATER_LIBS_PATH}/sky130_fd_io/latest/cells/top_gpiov2/sky130_fd_io__top_gpiov2.gds \
1386 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}
1387 ./custom/scripts/fix_gpiov2_gds.py \
1388 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}/sky130_fd_io__top_gpiov2.gds
Tim Edwards11af1922022-10-27 14:58:52 -04001389 # Copy the GDS file for the HVC power pad, then run the script that fixes it.
1390 cp ${SKYWATER_LIBS_PATH}/sky130_fd_io/latest/cells/top_power_hvc_wpadv2/sky130_fd_io__top_power_hvc_wpadv2.gds \
1391 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}
1392 ./custom/scripts/fix_vddio_pad_gds.py \
1393 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}/sky130_fd_io__top_power_hvc_wpadv2.gds
1394
Tim Edwards002b5dd2022-10-29 17:55:04 -04001395 # Copy the GDS file for the HVC power pad overlay, then run the script that fixes it.
1396 cp ${SKYWATER_LIBS_PATH}/sky130_fd_io/latest/cells/overlay_vddio_hvc/sky130_fd_io__overlay_vddio_hvc.gds \
1397 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}
1398 ./custom/scripts/fix_vddio_overlay_gds.py \
1399 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}/sky130_fd_io__overlay_vddio_hvc.gds
1400
Tim Edwards11af1922022-10-27 14:58:52 -04001401 # Copy the GDS file for the HVC ground pad, then run the script that fixes it.
1402 cp ${SKYWATER_LIBS_PATH}/sky130_fd_io/latest/cells/top_ground_hvc_wpad/sky130_fd_io__top_ground_hvc_wpad.gds \
1403 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}
1404 ./custom/scripts/fix_vssio_pad_gds.py \
1405 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}/sky130_fd_io__top_ground_hvc_wpad.gds
1406
Tim Edwards002b5dd2022-10-29 17:55:04 -04001407 # Copy the GDS file for the HVC ground pad overlay, then run the script that fixes it.
1408 cp ${SKYWATER_LIBS_PATH}/sky130_fd_io/latest/cells/overlay_vssio_hvc/sky130_fd_io__overlay_vssio_hvc.gds \
1409 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}
1410 ./custom/scripts/fix_vssio_overlay_gds.py \
1411 ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_GDS}/sky130_fd_io__overlay_vssio_hvc.gds
1412
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001413 # Install SkyWater I/O pad library
Tim Edwards58b1a922022-01-17 15:55:42 -05001414 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards1134fbc2020-10-12 22:35:42 -04001415 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
Tim Edwards4697a172021-11-05 22:47:07 -04001416 include=custom/sky130_fd_io/cdl/*.cdl \
emayecscbcb4652021-08-30 21:29:20 -04001417 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001418 -lef %l/latest/cells/*/*.lef annotate lefopts=-hide compile-only \
Tim Edwards002b5dd2022-10-29 17:55:04 -04001419 filter=custom/scripts/fix_io_lef.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001420 no-copy=sky130_fd_io__top_xres4v2.lef \
Tim Edwards002b5dd2022-10-29 17:55:04 -04001421 include=sky130_fd_io__top_xres4v2.lef,sky130_fd_io__top_power_hvc_wpadv2.lef \
Tim Edwards91ddc9a2021-06-24 22:50:30 -04001422 exclude=*.magic.lef,sky130_ef_io.lef \
emayecscbcb4652021-08-30 21:29:20 -04001423 sort=../common/sort_pdkfiles.py \
Tim Edwards1134fbc2020-10-12 22:35:42 -04001424 -doc %l/latest/cells/*/*.pdf \
1425 -lib %l/latest/timing/*.lib \
1426 -gds %l/latest/cells/*/*.gds compile-only \
emayecscbcb4652021-08-30 21:29:20 -04001427 sort=../common/sort_pdkfiles.py \
Tim Edwardsbc7b8ac2022-10-31 17:35:41 -04001428 options=custom/scripts/gds_import_io.tcl \
Tim Edwards002b5dd2022-10-29 17:55:04 -04001429 no-copy=sky130_fd_io__top_gpiov2.gds,sky130_fd_io__top_ground_hvc_wpad.gds,sky130_fd_io__top_power_hvc_wpadv2.gds,sky130_fd_io__overlay_vssio_hvc.gds,sky130_fd_io__overlay_vddio_hvc.gds \
1430 include=sky130_fd_io__top_gpiov2.gds,sky130_fd_io__top_ground_hvc_wpad.gds,sky130_fd_io__top_power_hvc_wpadv2.gds,sky130_fd_io__overlay_vssio_hvc.gds,sky130_fd_io__overlay_vddio_hvc.gds \
Tim Edwardsc9792022021-11-15 17:51:05 -05001431 -verilog %l/latest/cells/*/*.*.v \
Tim Edwardsb063d372021-11-12 16:15:18 -05001432 -verilog %l/latest/cells/*/*.v exclude=*.*.v,sky130_ef_io.v \
Tim Edwards1134fbc2020-10-12 22:35:42 -04001433 compile-only filter=custom/scripts/inc_verilog.py \
emayecscbcb4652021-08-30 21:29:20 -04001434 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001435 -library general sky130_fd_io 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwards1134fbc2020-10-12 22:35:42 -04001436 # Remove the base verilog files which have already been included into
1437 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001438 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${IO_VERILOG}/*.*.v
Tim Edwardsf35c6072021-06-15 16:00:27 -04001439 # Add a maskhint set for the GPIO pad .mag view to prevent problems writing
1440 # when writing HVI to GDS during hierarchical adjustments.
Tim Edwards58b1a922022-01-17 15:55:42 -05001441 ${ADDPROP} ${STAGING_PATH}/${SKY130$*} sky130_fd_io sky130_fd_io__top_gpiov2 \
Tim Edwardsf35c6072021-06-15 16:00:27 -04001442 "MASKHINTS_HVI 1346 17198 5828 19224 13700 1890 15920 2360 24 17522 1778 20612" -mag
Tim Edwards5ed94ff2022-06-16 15:07:53 -04001443 # Run the add_properties.py script to add extraction information to layout
1444 # cells for which the intended device cannot be extracted.
1445 ./custom/scripts/add_properties.py ${EF_FORMAT} -variant=${SKY130$*} \
1446 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf35c6072021-06-15 16:00:27 -04001447
Tim Edwards58b1a922022-01-17 15:55:42 -05001448digital-hd-%:
Tim Edwardsaac3d1a2021-06-15 16:37:10 -04001449 # Install custom additions to standard cell libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001450 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsaac3d1a2021-06-15 16:37:10 -04001451 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
Tim Edwards126d9062022-07-28 14:38:09 -04001452 -lef %l/lef/*.lef compile-only rename=sky130_ef_sc_hd.lef \
Tim Edwardsaac3d1a2021-06-15 16:37:10 -04001453 -verilog %l/verilog/*.v \
Tim Edwards58b1a922022-01-17 15:55:42 -05001454 -library digital sky130_fd_sc_hd 2>&1 | tee -a ${SKY130$*}_make.log
Ahmed Ghazya285ff42020-07-27 17:52:14 +02001455 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001456 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001457 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardse75eaa42022-03-03 22:54:54 -05001458 rename=sky130_fd_sc_hd__nom.tlef \
Tim Edwardsfd5136b2020-07-08 22:57:04 -04001459 -spice %l/latest/cells/*/*.spice compile-only \
emayecscbcb4652021-08-30 21:29:20 -04001460 sort=../common/sort_pdkfiles.py \
Tim Edwardsa56526b2022-10-19 13:09:11 -04001461 filter=custom/scripts/fix_sparecell_spice.py \
Tim Edwards99a5cf92021-05-16 16:42:49 -04001462 filter=custom/scripts/fix_device_models.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -04001463 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
Tim Edwardsa56526b2022-10-19 13:09:11 -04001464 filter=custom/scripts/fix_sparecell_cdl.py \
Tim Edwards0f76b782022-10-20 21:35:48 -04001465 filter=custom/scripts/fix_serxtors_cdl.py \
emayecscbcb4652021-08-30 21:29:20 -04001466 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001467 -lef %l/latest/cells/*/*.lef \
Tim Edwards126d9062022-07-28 14:38:09 -04001468 exclude=*.magic.lef,sky130_ef_sc_hd.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001469 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001470 annotate compile-only \
emayecscbcb4652021-08-30 21:29:20 -04001471 sort=../common/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -04001472 -doc %l/latest/cells/*/*.pdf \
Tim Edwards7ea41662021-10-29 18:46:38 -04001473 -lib %l/latest/timing/*.lib filter=custom/scripts/add_wireloads.py \
Anton Blanchard86f9b0c2022-04-05 21:07:40 +10001474 filter=custom/scripts/fix_default_fanout_load.py \
Tim Edwards8f6aff12022-09-20 20:41:51 -04001475 filter=custom/scripts/fix_related_bias_pins.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -04001476 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards4697a172021-11-05 22:47:07 -04001477 no-copy=custom/sky130_fd_sc_hd/gds/sky130_fd*.gds \
1478 include=custom/sky130_fd_sc_hd/gds/sky130_ef*.gds \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -04001479 options=custom/scripts/gds_import_setup.tcl \
emayecscbcb4652021-08-30 21:29:20 -04001480 sort=../common/sort_pdkfiles.py \
Tim Edwards4697a172021-11-05 22:47:07 -04001481 -verilog %l/latest/models/*/*.v \
1482 exclude=*.*.v include=custom/sky130_fd_sc_hd/verilog/*.v \
1483 compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -04001484 rename=primitives filter=custom/scripts/inc_verilog.py \
emayecscbcb4652021-08-30 21:29:20 -04001485 sort=../common/sort_pdkfiles.py \
Tim Edwards995c1332020-09-25 15:33:58 -04001486 -verilog %l/latest/cells/*/*.*.v \
Tim Edwards217bc1d2022-12-02 13:19:46 -05001487 filter=custom/scripts/fix_verilog.py \
Tim Edwards995c1332020-09-25 15:33:58 -04001488 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1489 compile-only filter=custom/scripts/inc_verilog.py \
emayecscbcb4652021-08-30 21:29:20 -04001490 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001491 -library digital sky130_fd_sc_hd 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse75eaa42022-03-03 22:54:54 -05001492 # Create minimum/maximum technology LEF files
1493 ./custom/scripts/make_minmax_techlef.py ${EF_FORMAT} -variant=${SKY130$*} \
1494 -library=hd 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001495 # Add a maskhint set for the tap cell .mag view to prevent problems writing
Tim Edwards16a9caa2021-01-08 13:10:06 -05001496 # when writing NSDM and PSDM to GDS during hierarchical adjustments.
Tim Edwards22f014d2022-01-26 10:37:03 -05001497 ${ADDPROP} ${STAGING_PATH}/${SKY130$*} sky130_fd_sc_hd \
1498 sky130_fd_sc_hd__tapvpwrvgnd_1 \
Tim Edwards772de8c2022-01-19 14:02:04 -05001499 "MASKHINTS_PSDM 0 38 92 195" -mag
Tim Edwards22f014d2022-01-26 10:37:03 -05001500 ${ADDPROP} ${STAGING_PATH}/${SKY130$*} sky130_fd_sc_hd \
1501 sky130_fd_sc_hd__tapvpwrvgnd_1 \
Tim Edwards772de8c2022-01-19 14:02:04 -05001502 "MASKHINTS_NSDM 0 279 92 506" -mag
Tim Edwards22f014d2022-01-26 10:37:03 -05001503 # Quick solution to extraction issue---connect VNB label pwell to rest
1504 ${ADDLAYER} ${STAGING_PATH}/${SKY130$*} sky130_fd_sc_hd \
1505 sky130_fd_sc_hd__a21bo_1 \
1506 pwell "29 17 69 157" -mag
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001507 # Remove the base verilog files which have already been included into
1508 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001509 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${HD_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001510 # Apply extra PDK patches until they get fixed properly in the source
Tim Edwardsb94b6c12022-02-05 16:47:22 -05001511 ${PATCH} -p1 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${HD_VERILOG} \
Tim Edwards24f29502021-10-13 15:49:00 -04001512 < custom/patches/hd_wire_syntax.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001513 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001514
Tim Edwards58b1a922022-01-17 15:55:42 -05001515digital-hdll-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001516 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001517 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001518 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardse75eaa42022-03-03 22:54:54 -05001519 rename=sky130_fd_sc_hdll__nom.tlef \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001520 -spice %l/latest/cells/*/*.spice compile-only \
1521 sort=../common/sort_pdkfiles.py \
1522 filter=custom/scripts/fix_device_models.py \
1523 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1524 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001525 -lef %l/latest/cells/*/*.lef annotate compile-only \
1526 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001527 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001528 sort=../common/sort_pdkfiles.py \
1529 -doc %l/latest/cells/*/*.pdf \
Anton Blanchardc189d862022-04-05 15:40:06 +10001530 -lib %l/latest/timing/*.lib filter=custom/scripts/add_wireloads.py \
Anton Blanchard86f9b0c2022-04-05 21:07:40 +10001531 filter=custom/scripts/fix_default_fanout_load.py \
Tim Edwards8f6aff12022-09-20 20:41:51 -04001532 filter=custom/scripts/fix_related_bias_pins.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001533 -gds %l/latest/cells/*/*.gds compile-only \
1534 options=custom/scripts/gds_import_setup.tcl \
1535 sort=../common/sort_pdkfiles.py \
1536 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1537 rename=primitives filter=custom/scripts/inc_verilog.py \
1538 sort=../common/sort_pdkfiles.py \
1539 -verilog %l/latest/cells/*/*.*.v \
1540 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1541 compile-only filter=custom/scripts/inc_verilog.py \
1542 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001543 -library digital sky130_fd_sc_hdll 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse75eaa42022-03-03 22:54:54 -05001544 # Create minimum/maximum technology LEF files
1545 ./custom/scripts/make_minmax_techlef.py ${EF_FORMAT} -variant=${SKY130$*} \
1546 -library=hdll 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001547 # Remove the base verilog files which have already been included into
1548 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001549 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${HDLL_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001550
Tim Edwards58b1a922022-01-17 15:55:42 -05001551digital-hvl-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001552 # Install custom additions to standard cell libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001553 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001554 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
Tim Edwards11fb9302021-12-28 21:26:02 -05001555 -spice %l/spice/*.spice \
Tim Edwards58b1a922022-01-17 15:55:42 -05001556 -library digital sky130_fd_sc_hvl 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001557 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001558 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001559 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardse75eaa42022-03-03 22:54:54 -05001560 rename=sky130_fd_sc_hvl__nom.tlef \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001561 -spice %l/latest/cells/*/*.spice compile-only \
Tim Edwards11fb9302021-12-28 21:26:02 -05001562 no-copy=custom/sky130_fd_sc_hvl/spice/sky130_fd*.spice \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001563 sort=../common/sort_pdkfiles.py \
1564 filter=custom/scripts/fix_device_models.py \
1565 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1566 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001567 -lef %l/latest/cells/*/*.lef annotate compile-only \
1568 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001569 sort=../common/sort_pdkfiles.py \
1570 -doc %l/latest/cells/*/*.pdf \
Anton Blanchardc189d862022-04-05 15:40:06 +10001571 -lib %l/latest/timing/*.lib filter=custom/scripts/add_wireloads.py \
Anton Blanchard86f9b0c2022-04-05 21:07:40 +10001572 filter=custom/scripts/fix_default_fanout_load.py \
Tim Edwards8f6aff12022-09-20 20:41:51 -04001573 filter=custom/scripts/fix_related_bias_pins.py \
Tim Edwards5becac12022-09-27 15:01:23 -04001574 filter=custom/scripts/fix_mismatched_opcond.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001575 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards4697a172021-11-05 22:47:07 -04001576 include=custom/sky130_fd_sc_hvl/gds/sky130_ef*.gds \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001577 options=custom/scripts/gds_import_setup.tcl \
1578 sort=../common/sort_pdkfiles.py \
1579 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1580 rename=primitives filter=custom/scripts/inc_verilog.py \
1581 sort=../common/sort_pdkfiles.py \
1582 -verilog %l/latest/cells/*/*.*.v \
1583 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1584 compile-only filter=custom/scripts/inc_verilog.py \
1585 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001586 -library digital sky130_fd_sc_hvl 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse75eaa42022-03-03 22:54:54 -05001587 # Create minimum/maximum technology LEF files
1588 ./custom/scripts/make_minmax_techlef.py ${EF_FORMAT} -variant=${SKY130$*} \
1589 -library=hvl 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf6a94bd2021-06-01 11:02:58 -04001590 # Add a maskhint to the HVL level shifter to represent the HVI layer as
1591 # drawn in the GDS, and so eliminate the HVI-to-nwell DRC error.
Tim Edwards58b1a922022-01-17 15:55:42 -05001592 ${ADDPROP} ${STAGING_PATH}/${SKY130$*} sky130_fd_sc_hvl sky130_fd_sc_hvl__lsbufhv2lv_1 \
Tim Edwardsf6a94bd2021-06-01 11:02:58 -04001593 "MASKHINTS_HVI 22 34 706 1316" -mag
Tim Edwards995c1332020-09-25 15:33:58 -04001594 # Remove the base verilog files which have already been included into
1595 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001596 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${HVL_VERILOG}/*.*.v
Tim Edwardsf63ee052021-04-29 15:13:45 -04001597 # Custom: Patch the HVL library to correct the resistor device names
Tim Edwardsb94b6c12022-02-05 16:47:22 -05001598 ${PATCH} -p3 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${HVL_SPICE} \
Tim Edwards16b050b2021-05-17 16:45:34 -04001599 < custom/patches/sky130_fd_pr_${HVL_PATCH4}.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001600 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsb94b6c12022-02-05 16:47:22 -05001601 ${PATCH} -p3 -f -d ${STAGING_PATH}/${SKY130$*}/libs.ref/${HVL_CDL} \
Tim Edwardsf63ee052021-04-29 15:13:45 -04001602 < custom/patches/sky130_fd_pr_6.patch \
Tim Edwards58b1a922022-01-17 15:55:42 -05001603 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001604
Tim Edwards58b1a922022-01-17 15:55:42 -05001605digital-lp-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001606 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001607 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001608 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardse75eaa42022-03-03 22:54:54 -05001609 rename=sky130_fd_sc_lp__nom.tlef \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001610 -spice %l/latest/cells/*/*.spice compile-only \
1611 sort=../common/sort_pdkfiles.py \
1612 filter=custom/scripts/fix_device_models.py \
1613 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1614 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001615 -lef %l/latest/cells/*/*.lef annotate compile-only \
1616 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001617 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001618 sort=../common/sort_pdkfiles.py \
1619 -doc %l/latest/cells/*/*.pdf \
Anton Blanchardc189d862022-04-05 15:40:06 +10001620 -lib %l/latest/timing/*.lib filter=custom/scripts/add_wireloads.py \
Anton Blanchard86f9b0c2022-04-05 21:07:40 +10001621 filter=custom/scripts/fix_default_fanout_load.py \
Tim Edwards8f6aff12022-09-20 20:41:51 -04001622 filter=custom/scripts/fix_related_bias_pins.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001623 -gds %l/latest/cells/*/*.gds compile-only \
1624 options=custom/scripts/gds_import_setup.tcl \
1625 sort=../common/sort_pdkfiles.py \
1626 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1627 rename=primitives filter=custom/scripts/inc_verilog.py \
1628 sort=../common/sort_pdkfiles.py \
1629 -verilog %l/latest/cells/*/*.*.v \
1630 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1631 compile-only filter=custom/scripts/inc_verilog.py \
1632 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001633 -library digital sky130_fd_sc_lp 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse75eaa42022-03-03 22:54:54 -05001634 # Create minimum/maximum technology LEF files
1635 ./custom/scripts/make_minmax_techlef.py ${EF_FORMAT} -variant=${SKY130$*} \
1636 -library=lp 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001637 # Remove the base verilog files which have already been included into
1638 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001639 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${LP_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001640
Tim Edwards58b1a922022-01-17 15:55:42 -05001641digital-hs-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001642 # Install custom additions to standard cell libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001643 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001644 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001645 -library digital sky130_fd_sc_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001646 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001647 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001648 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardse75eaa42022-03-03 22:54:54 -05001649 rename=sky130_fd_sc_hs__nom.tlef \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001650 -spice %l/latest/cells/*/*.spice compile-only \
1651 sort=../common/sort_pdkfiles.py \
1652 filter=custom/scripts/fix_device_models.py \
1653 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1654 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001655 -lef %l/latest/cells/*/*.lef annotate compile-only \
1656 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001657 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001658 sort=../common/sort_pdkfiles.py \
1659 -doc %l/latest/cells/*/*.pdf \
Anton Blanchardc189d862022-04-05 15:40:06 +10001660 -lib %l/latest/timing/*.lib filter=custom/scripts/add_wireloads.py \
Anton Blanchard86f9b0c2022-04-05 21:07:40 +10001661 filter=custom/scripts/fix_default_fanout_load.py \
Tim Edwards8f6aff12022-09-20 20:41:51 -04001662 filter=custom/scripts/fix_related_bias_pins.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001663 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards4697a172021-11-05 22:47:07 -04001664 no-copy=custom/sky130_fd_sc_hs/gds/sky130_fd*.gds \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001665 options=custom/scripts/gds_import_setup.tcl \
1666 sort=../common/sort_pdkfiles.py \
1667 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1668 rename=primitives filter=custom/scripts/inc_verilog.py \
1669 sort=../common/sort_pdkfiles.py \
1670 -verilog %l/latest/cells/*/*.*.v \
1671 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1672 compile-only filter=custom/scripts/inc_verilog.py \
1673 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001674 -library digital sky130_fd_sc_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse75eaa42022-03-03 22:54:54 -05001675 # Create minimum/maximum technology LEF files
1676 ./custom/scripts/make_minmax_techlef.py ${EF_FORMAT} -variant=${SKY130$*} \
1677 -library=hs 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001678 # Remove the base verilog files which have already been included into
1679 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001680 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${HS_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001681
Tim Edwards58b1a922022-01-17 15:55:42 -05001682digital-ms-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001683 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001684 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001685 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardse75eaa42022-03-03 22:54:54 -05001686 rename=sky130_fd_sc_ms__nom.tlef \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001687 -spice %l/latest/cells/*/*.spice compile-only \
1688 sort=../common/sort_pdkfiles.py \
1689 filter=custom/scripts/fix_device_models.py \
1690 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1691 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001692 -lef %l/latest/cells/*/*.lef annotate compile-only \
1693 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsfd17c612021-12-07 14:27:19 -05001694 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001695 sort=../common/sort_pdkfiles.py \
1696 -doc %l/latest/cells/*/*.pdf \
Anton Blanchardc189d862022-04-05 15:40:06 +10001697 -lib %l/latest/timing/*.lib filter=custom/scripts/add_wireloads.py \
Anton Blanchard86f9b0c2022-04-05 21:07:40 +10001698 filter=custom/scripts/fix_default_fanout_load.py \
Tim Edwards8f6aff12022-09-20 20:41:51 -04001699 filter=custom/scripts/fix_related_bias_pins.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001700 -gds %l/latest/cells/*/*.gds compile-only \
1701 options=custom/scripts/gds_import_setup.tcl \
1702 sort=../common/sort_pdkfiles.py \
1703 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1704 rename=primitives filter=custom/scripts/inc_verilog.py \
1705 sort=../common/sort_pdkfiles.py \
1706 -verilog %l/latest/cells/*/*.*.v \
1707 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1708 compile-only filter=custom/scripts/inc_verilog.py \
1709 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001710 -library digital sky130_fd_sc_ms 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse75eaa42022-03-03 22:54:54 -05001711 # Create minimum/maximum technology LEF files
1712 ./custom/scripts/make_minmax_techlef.py ${EF_FORMAT} -variant=${SKY130$*} \
1713 -library=ms 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001714 # Remove the base verilog files which have already been included into
1715 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001716 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${MS_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001717
Tim Edwards58b1a922022-01-17 15:55:42 -05001718digital-ls-%:
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001719 # Install all SkyWater digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001720 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardsfb7b41f2022-01-18 11:46:30 -05001721 -techlef %l/latest/tech/*.tlef filter=custom/scripts/fix_techlef$*.py \
Tim Edwardse75eaa42022-03-03 22:54:54 -05001722 rename=sky130_fd_sc_ls__nom.tlef \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001723 -spice %l/latest/cells/*/*.spice compile-only \
1724 sort=../common/sort_pdkfiles.py \
1725 filter=custom/scripts/fix_device_models.py \
1726 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
1727 sort=../common/sort_pdkfiles.py \
Tim Edwardsb063d372021-11-12 16:15:18 -05001728 -lef %l/latest/cells/*/*.lef annotate compile-only \
1729 exclude=*.magic.lef lefopts=-toplayer \
Tim Edwardsb8c95cb2021-12-07 14:39:07 -05001730 filter=custom/scripts/fix_digital_lef.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001731 sort=../common/sort_pdkfiles.py \
1732 -doc %l/latest/cells/*/*.pdf \
Anton Blanchardc189d862022-04-05 15:40:06 +10001733 -lib %l/latest/timing/*.lib filter=custom/scripts/add_wireloads.py \
Anton Blanchard86f9b0c2022-04-05 21:07:40 +10001734 filter=custom/scripts/fix_default_fanout_load.py \
Tim Edwards8f6aff12022-09-20 20:41:51 -04001735 filter=custom/scripts/fix_related_bias_pins.py \
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001736 -gds %l/latest/cells/*/*.gds compile-only \
1737 options=custom/scripts/gds_import_setup.tcl \
1738 sort=../common/sort_pdkfiles.py \
1739 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
1740 rename=primitives filter=custom/scripts/inc_verilog.py \
1741 sort=../common/sort_pdkfiles.py \
1742 -verilog %l/latest/cells/*/*.*.v \
1743 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
1744 compile-only filter=custom/scripts/inc_verilog.py \
1745 sort=../common/sort_pdkfiles.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001746 -library digital sky130_fd_sc_ls 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardse75eaa42022-03-03 22:54:54 -05001747 # Create minimum/maximum technology LEF files
1748 ./custom/scripts/make_minmax_techlef.py ${EF_FORMAT} -variant=${SKY130$*} \
1749 -library=ls 2>&1 | tee -a ${SKY130$*}_make.log || true
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001750 # Remove the base verilog files which have already been included into
1751 # the libraries
Tim Edwards58b1a922022-01-17 15:55:42 -05001752 ${RM} ${STAGING_PATH}/${SKY130$*}/libs.ref/${LS_VERILOG}/*.*.v
Tim Edwardsf1b28a02021-09-08 13:56:44 -04001753
Tim Edwards58b1a922022-01-17 15:55:42 -05001754alpha-%:
Tim Edwardsbcf59aa2020-12-17 16:55:13 -05001755 # Install alphanumeric library.
Tim Edwards58b1a922022-01-17 15:55:42 -05001756 ${STAGE} -source ${ALPHA_PATH}/.. -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards88bd42e2020-12-18 15:29:48 -05001757 -mag %l/mag/*.mag filter=custom/scripts/text2m5.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001758 -library general sky130_ml_xx_hd 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001759 # Install text2mag.py script for alphanumeric library
Tim Edwards58b1a922022-01-17 15:55:42 -05001760 mkdir -p ${STAGING_PATH}/${SKY130$*}/libs.ref/${MLXX_SCRIPTS}
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001761 cp custom/scripts/text2mag.py \
Tim Edwards58b1a922022-01-17 15:55:42 -05001762 ${STAGING_PATH}/${SKY130$*}/libs.ref/${MLXX_SCRIPTS}
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001763
Tim Edwards58b1a922022-01-17 15:55:42 -05001764sram-%:
Tim Edwards8b96a1b2021-04-27 15:16:26 -04001765 # Install SRAM library. NOTE: SRAM macros share some of the same
1766 # cell names, so use special option script gds_import_sram.tcl
Tim Edwards68fc4e62021-06-12 22:31:21 -04001767 # To do: Add option to process each GDS file individually in magic,
1768 # instead of all at once.
Tim Edwards58b1a922022-01-17 15:55:42 -05001769 ${STAGE} -source ${SRAM_PATH}/.. -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwardscfe970c2021-02-26 14:35:51 -05001770 -lef %l/*/*.lef \
1771 -lib %l/*/*.lib \
Tim Edwards8b96a1b2021-04-27 15:16:26 -04001772 -gds %l/*/*.gds options=custom/scripts/gds_import_sram.tcl \
D. Mitch Baileya23f0b22021-12-27 08:14:38 -08001773 -spice %l/*/*.lvs.sp filter=custom/scripts/sp_to_spice.py \
Tim Edwardscfe970c2021-02-26 14:35:51 -05001774 -verilog %l/*/*.v \
Tim Edwards58b1a922022-01-17 15:55:42 -05001775 -library general sky130_sram_macros 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001776
Tim Edwardsd6c91b42023-01-04 17:03:58 -05001777sram-space-%:
1778 # Install SRAM build-space library.
1779 ${STAGE} -source ${SRAM_SPACE_PATH}/.. -target ${STAGING_PATH}/${SKY130$*} \
1780 -gds %l/cells/*/*.gds compile-only \
1781 -lef %l/cells/*/*.lef compile-only \
1782 -spice %l/cells/*/*.lvs.calibre.spice compile-only \
1783 -library general sky130_fd_bd_sram 2>&1 | tee -a ${SKY130$*}_make.log
1784
Tim Edwards58b1a922022-01-17 15:55:42 -05001785osu-t12-%:
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001786 # Install OSU T12 hs digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001787 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001788 -techlef sky130_osu_sc_12T.tlef rename=sky130_osu_sc_12t_hs.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001789 -spice 12T_hs/cdl/*.spice compile-only exclude=*.*.spice \
1790 -lef 12T_hs/lef/*.lef \
1791 -lib 12T_hs/lib/*.lib \
1792 -gds 12T_hs/gds/*.gds compile-only \
1793 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001794 -library digital sky130_osu_sc_12t_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001795 # Install OSU T12 ms digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001796 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001797 -techlef sky130_osu_sc_12T.tlef rename=sky130_osu_sc_12t_ms.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001798 -spice 12T_ms/cdl/*.spice compile-only exclude=*.*.spice \
1799 -lef 12T_ms/lef/*.lef \
1800 -lib 12T_ms/lib/*.lib \
1801 -gds 12T_ms/gds/*.gds compile-only \
1802 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001803 -library digital sky130_osu_sc_12t_ms 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001804 # Install OSU T12 ls digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001805 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001806 -techlef sky130_osu_sc_12T.tlef rename=sky130_osu_sc_12t_ls.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001807 -spice 12T_ls/cdl/*.spice compile-only exclude=*.*.spice \
1808 -lef 12T_ls/lef/*.lef \
1809 -lib 12T_ls/lib/*.lib \
1810 -gds 12T_ls/gds/*.gds compile-only \
1811 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001812 -library digital sky130_osu_sc_12t_ls 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001813
Tim Edwards58b1a922022-01-17 15:55:42 -05001814osu-t15-%:
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001815 # Install OSU T15 hs digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001816 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001817 -techlef sky130_osu_sc_15T.tlef rename=sky130_osu_sc_15t_hs.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001818 -spice 15T_hs/cdl/*.spice compile-only exclude=*.*.spice \
1819 -lef 15T_hs/lef/*.lef \
1820 -lib 15T_hs/lib/*.lib \
1821 -gds 15T_hs/gds/*.gds compile-only \
1822 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001823 -library digital sky130_osu_sc_15t_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001824 # Install OSU T15 ms digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001825 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001826 -techlef sky130_osu_sc_15T.tlef rename=sky130_osu_sc_15t_ms.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001827 -spice 15T_ms/cdl/*.spice compile-only exclude=*.*.spice \
1828 -lef 15T_ms/lef/*.lef \
1829 -lib 15T_ms/lib/*.lib \
1830 -gds 15T_ms/gds/*.gds compile-only \
1831 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001832 -library digital sky130_osu_sc_15t_ms 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001833 # Install OSU T15 ls digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001834 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001835 -techlef sky130_osu_sc_15T.tlef rename=sky130_osu_sc_15t_ls.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001836 -spice 15T_ls/cdl/*.spice compile-only exclude=*.*.spice \
1837 -lef 15T_ls/lef/*.lef \
1838 -lib 15T_ls/lib/*.lib \
1839 -gds 15T_ls/gds/*.gds compile-only \
1840 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001841 -library digital sky130_osu_sc_15t_ls 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001842
Tim Edwards58b1a922022-01-17 15:55:42 -05001843osu-t18-%:
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001844 # Install OSU T18 hs digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001845 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001846 -techlef sky130_osu_sc_18T.tlef rename=sky130_osu_sc_18t_hs.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001847 -spice 18T_hs/cdl/*.spice compile-only exclude=*.*.spice \
1848 -lef 18T_hs/lef/*.lef \
1849 -lib 18T_hs/lib/*.lib \
1850 -gds 18T_hs/gds/*.gds compile-only \
1851 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001852 -library digital sky130_osu_sc_18t_hs 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001853 # Install OSU T18 ms digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001854 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001855 -techlef sky130_osu_sc_18T.tlef rename=sky130_osu_sc_18t_ms.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001856 -spice 18T_ms/cdl/*.spice compile-only exclude=*.*.spice \
1857 -lef 18T_ms/lef/*.lef \
1858 -lib 18T_ms/lib/*.lib \
1859 -gds 18T_ms/gds/*.gds compile-only \
1860 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001861 -library digital sky130_osu_sc_18t_ms 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001862 # Install OSU T18 ls digital standard cells.
Tim Edwards58b1a922022-01-17 15:55:42 -05001863 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130$*} \
Tim Edwards0b8fd2f2021-09-14 10:19:16 -04001864 -techlef sky130_osu_sc_18T.tlef rename=sky130_osu_sc_18t_ls.tlef \
Tim Edwardscdfec5e2021-04-22 20:59:13 -04001865 -spice 18T_ls/cdl/*.spice compile-only exclude=*.*.spice \
1866 -lef 18T_ls/lef/*.lef \
1867 -lib 18T_ls/lib/*.lib \
1868 -gds 18T_ls/gds/*.gds compile-only \
1869 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards58b1a922022-01-17 15:55:42 -05001870 -library digital sky130_osu_sc_18t_ls 2>&1 | tee -a ${SKY130$*}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001871
Tim Edwards7fa92fd2022-01-19 11:13:51 -05001872install: $(foreach var, ${VARIANTS}, install-$(var))
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001873
Tim Edwards58b1a922022-01-17 15:55:42 -05001874install-A:
Tim Edwards9134eed2021-02-13 14:42:59 -05001875 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_install.log
Tim Edwards44e7efa2021-08-20 13:20:55 -04001876 ${INSTALL} \
1877 -source ${STAGING_PATH}/${SKY130A} \
Tim 'mithro' Ansell19576632021-11-14 17:01:53 -08001878 -finalpath ${SHARED_PDKS_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -05001879 -variable PDKPATH \
Tim Edwards6f01cd22022-01-17 19:23:53 -05001880 -link_from ${DIST_LINK_TARGETS_A} 2>&1 | tee -a ${SKY130A}_install.log
Tim Edwards9134eed2021-02-13 14:42:59 -05001881 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001882
Tim Edwards7016d342022-03-06 10:30:54 -05001883# NOTE: if DIST_LINK_TARGETS_B points back to the A variant, then the install
1884# of B depends on the install of A. Can't think of a way to make the dependency
1885# itself depend on the value of DIST_LINK_TARGETS_B, so I'm just forcing the
1886# install to always be sequential: install A first, then B.
1887
1888install-B: install-A
Tim Edwards58b1a922022-01-17 15:55:42 -05001889 echo "Starting SKY130 PDK migration on "`date` > ${SKY130B}_install.log
1890 ${INSTALL} \
1891 -source ${STAGING_PATH}/${SKY130B} \
1892 -finalpath ${SHARED_PDKS_PATH}/${SKY130B} \
1893 -variable PDKPATH \
Tim Edwards6f01cd22022-01-17 19:23:53 -05001894 -link_from ${DIST_LINK_TARGETS_B} 2>&1 | tee -a ${SKY130B}_install.log
Tim Edwards58b1a922022-01-17 15:55:42 -05001895 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130B}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001896
Tim Edwards7fa92fd2022-01-19 11:13:51 -05001897uninstall: $(foreach var, ${VARIANTS}, uninstall-$(var))
Tim Edwards58b1a922022-01-17 15:55:42 -05001898
1899uninstall-A:
Tim Edwards44e7efa2021-08-20 13:20:55 -04001900 echo "Uninstalling SKY130 PDK from ${SHARED_PDKS_PATH}"
1901 if test "x${SHARED_PDKS_PATH}" != "x" ; then \
1902 ${RM} -rf ${SHARED_PDKS_PATH}/${SKY130A} ; \
Tim Edwards8830dfe2021-02-25 11:29:59 -05001903 fi
1904 echo "Finished SKY130 PDK uninstall"
1905
Tim Edwards58b1a922022-01-17 15:55:42 -05001906uninstall-B:
1907 echo "Uninstalling SKY130 PDK from ${SHARED_PDKS_PATH}"
1908 if test "x${SHARED_PDKS_PATH}" != "x" ; then \
1909 ${RM} -rf ${SHARED_PDKS_PATH}/${SKY130B} ; \
1910 fi
1911 echo "Finished SKY130 PDK uninstall"
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001912
Tim Edwards7fa92fd2022-01-19 11:13:51 -05001913clean: $(foreach var, ${VARIANTS}, clean-$(var))
Tim Edwards58b1a922022-01-17 15:55:42 -05001914
1915clean-A:
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001916 ${STAGE} -target ${STAGING_PATH}/${SKY130A} -clean
1917
Tim Edwards58b1a922022-01-17 15:55:42 -05001918clean-B:
1919 ${STAGE} -target ${STAGING_PATH}/${SKY130B} -clean
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001920
Tim Edwards7fa92fd2022-01-19 11:13:51 -05001921veryclean: $(foreach var, ${VARIANTS}, veryclean-$(var))
Tim Edwards58b1a922022-01-17 15:55:42 -05001922
1923veryclean-A: clean-A
Tim Edwards9134eed2021-02-13 14:42:59 -05001924 ${RM} ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001925 ${RM} ${SKY130A}_install.log
Tim Edwards9134eed2021-02-13 14:42:59 -05001926 # Legacy name
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001927 ${RM} ${SKY130A}_migrate.log
Tim Edwards6ee11532021-02-11 12:29:33 -05001928
Tim Edwards58b1a922022-01-17 15:55:42 -05001929veryclean-B: clean-B
1930 ${RM} ${SKY130B}_make.log
1931 ${RM} ${SKY130B}_install.log
1932
Tim Edwards8a4b1602021-08-20 14:05:53 -04001933# Old aliases (retained for compatibility)
Tim Edwards44e7efa2021-08-20 13:20:55 -04001934install-dist:
1935 $(warning "'make install-dist' has been replaced with 'make install'")
1936 make install
Tim Edwards8a4b1602021-08-20 14:05:53 -04001937
Tim Edwards44e7efa2021-08-20 13:20:55 -04001938install-local:
1939 $(warning "'make install-local' has been replaced with 'make install'")
1940 make install
emayecsf31fb7a2021-08-04 16:27:55 -04001941
Tim Edwards44e7efa2021-08-20 13:20:55 -04001942uninstall-dist:
1943 $(warning "'make uninstall-dist' has been replaced with 'make uninstall'")
1944 make uninstall
Tim Edwards8a4b1602021-08-20 14:05:53 -04001945
Tim Edwards44e7efa2021-08-20 13:20:55 -04001946uninstall-local:
1947 $(warning "'make uninstall-local' has been replaced with 'make uninstall'")
1948 make uninstall
1949
Tim Edwards58b1a922022-01-17 15:55:42 -05001950install-dist-A:
1951 $(warning "'make install-dist-A' has been replaced with 'make install'")
Tim Edwards44e7efa2021-08-20 13:20:55 -04001952 make install
Tim Edwards8a4b1602021-08-20 14:05:53 -04001953
Tim Edwards58b1a922022-01-17 15:55:42 -05001954install-local-A:
1955 $(warning "'make install-local-A' has been replaced with 'make install'")
Tim Edwards44e7efa2021-08-20 13:20:55 -04001956 make install
1957
Tim Edwards58b1a922022-01-17 15:55:42 -05001958uninstall-dist-A:
1959 $(warning "'make uninstall-dist-A' has been replaced with 'make uninstall'")
Tim Edwards44e7efa2021-08-20 13:20:55 -04001960 make uninstall
Tim Edwards8a4b1602021-08-20 14:05:53 -04001961
Tim Edwards58b1a922022-01-17 15:55:42 -05001962uninstall-local-A:
1963 $(warning "'make uninstall-local-A' has been replaced with 'make uninstall'")
Tim Edwards44e7efa2021-08-20 13:20:55 -04001964 make uninstall