blob: dfce02bacc8b0312b153129a81cf29feb9372db4 [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
4#
5# Written by Tim Edwards March 2019
6# efabless corporation
7# updated October 2019
8# updated December 2019 (divide installation sections for individual tools)
9# updated March 2020 (refactored the install process)
10# updated May 2020 (changed to new process name Sky130)
11#
12# Instructions:
13#
Tim Edwards7cbaaba2020-08-05 12:19:18 -040014# Run "configure" from the top level directory. Use the following
15# configuration options to match your environment:
Tim Edwards55f4d0e2020-07-05 15:41:02 -040016#
Tim Edwardsc7ab1ea2020-12-24 17:04:36 -050017# --enable-sky130-pdk[=<path>]
Tim Edwards942a14f2020-12-24 16:20:31 -050018# If enabled, install the skywater PDK. If <path> is specified,
19# then the skywater PDK is expected to be found rooted at the
20# given path. If not specified, then the skywater PDK will be
21# downloaded and installed to <repo root>/pdks.
22# If explicitly disabled, sky130 is skipped over entirely.
23#
Tim Edwards7cbaaba2020-08-05 12:19:18 -040024# --with-sky130-local-path=<path>
25# where <path> is the run-time location of the installed PDK
26# files generated by open_pdks. This option is mandatory and
27# has no default.
28#
29# --with-sky130-dist-path=<path>
30# where <path> is the install-time location of the installed
31# PDK files generated by open_pdks, with the expectation that
32# <path> is something like a git repository that is then
33# distributed across a system. If this option is not specified,
34# then files are installed to the local path.
35#
36# --with-sky130-link-targets=<value>
37# where <value> is one of "none" or "source". If set to "source",
38# then where possible, the installed files are symbolic links
39# back to the source, rather than copies of the source. The
40# default value is "none" if the option is not specified.
41#
42# --with-ef-style
43# If specified, then the installation uses the efabless style,
44# which swaps the file hierarchy of file formats vs. IP libraries;
45# e.g., "gds/sky130_fd_sc_hd/" with ef-style, vs.
46# "sky130_fd_sc_hd/gds/" without it.
47#
Tim Edwards22fdb442020-12-02 12:40:03 -050048# Enable/disable for specific libraries to be installed (and downloaded if
49# needed). Libraries that are part of the open_pdks repository are enabled
50# by default and must be disabled by passing an option to configure. Libraries
51# that are not part of the open_pdks repository are disabled by default and
52# must be enabled by passing an option to configure.
53#
54# Internal libraries and tool setups that can be disabled are the following:
55#
56# --disable-magic
57# Do not install setup files for the magic layout tool.
58#
59# --disable-netgen
60# Do not install setup files for the netgen LVS tool.
61#
Tim Edwards367711e2021-01-27 10:35:12 -050062# --disable-irsim
63# Do not install setup files for the IRSIM simulation tool.
64#
Tim Edwards22fdb442020-12-02 12:40:03 -050065# --disable-qflow
66# Do not install setup files for the qflow synthesis flow.
67#
68# --disable-openlane
69# Do not install setup files for the openlane sythesis flow.
70#
71# --disable-klayout
72# Do not install setup files for the klayout layout tool.
73#
Tim Edwardsccaea722020-12-24 10:59:42 -050074#
75# NOTE: The comments below are for features that have not yet been
76# implemented.
77#
Tim Edwards9a17fca2021-02-11 17:44:04 -050078# External (third-party) libraries and tool setups are the following (enabled
79# by default):
Tim Edwards22fdb442020-12-02 12:40:03 -050080#
Tim Edwardscdfec5e2021-04-22 20:59:13 -040081# --enable-alpha-sky130[=<path>]
Tim Edwardsbcf59aa2020-12-17 16:55:13 -050082# If enabled, install the sky130_ml_xx_hd font library from
Tim Edwardscfe970c2021-02-26 14:35:51 -050083# Paul Schulz on github. If <path> is not specified, then the
84# font library will be cloned from the git repository and
85# installed.
Tim Edwards22fdb442020-12-02 12:40:03 -050086#
Tim Edwardscdfec5e2021-04-22 20:59:13 -040087# --enable-xschem-sky130[=<path>]
Tim Edwards22fdb442020-12-02 12:40:03 -050088# If enabled, install the Sky130 setup for the xschem schematic
89# editor. If <path> is specified, then the xschem setup is
90# expected to be found rooted at the given path. If not
91# specified, then the xschem setup will be cloned from the
92# repository and installed.
93#
Tim Edwardscdfec5e2021-04-22 20:59:13 -040094# External (third-party) libraries and tool setups are the following (disabled
95# by default):
96#
97# --enable-sram-sky130[=<path>]
Tim Edwardscfe970c2021-02-26 14:35:51 -050098# If enabled, install the sky130_sram_macros library from
99# efabless on github. If <path> is not specified, then
100# the SRAM library will be cloned from the repository and
101# installed.
102#
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400103# --enable-osu-sky130[=<path>]
104# If enabled, install the sky130_osu_sc library from
105# foss-eda-tools on googlesource. If <path> is not
106# specified, then the OSU standard cell library will be
107# clones from the repository and installed.
108#
109# --enable-osu-t12-sky130[=<path>]
110# If enabled, install the sky130_osu_sc_t12 libraries from
111# foss-eda-tools on googlesource. If <path> is not
112# specified, then the OSU standard cell library will be
113# clones from the repository and installed.
114#
115# --enable-osu-t15-sky130[=<path>]
116# If enabled, install the sky130_osu_sc_t15 libraries from
117# foss-eda-tools on googlesource. If <path> is not
118# specified, then the OSU standard cell library will be
119# clones from the repository and installed.
120#
121# --enable-osu-t18-sky130[=<path>]
122# If enabled, install the sky130_osu_sc_t18 libraries from
123# foss-eda-tools on googlesource. If <path> is not
124# specified, then the OSU standard cell library will be
125# clones from the repository and installed.
126#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400127# The variables below are substituted from the configuration options:
128#
129# SKYWATER_PATH: points to vendor sources
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400130# EF_STYLE: 1 for efabless style, 0 otherwise
131# LINK_TARGETS: link back to source or link to 1st PDK when possible
132# DIST_PATH: install location for distributed install
133# LOCAL_PATH: install location for local install or runtime location
134# for distributed install
135#
136# Run "make" to stage the PDK for tool setup and vendor libraries
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400137#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400138# Run "make install" to install all staged files. The installation is
139# either local or distributed, depending on whether --with-sky130-dist-path
140# has been set when running configure.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400141#
142# Run "make clean" to remove all staging files.
143#
Tim Edwards9134eed2021-02-13 14:42:59 -0500144# Run "make veryclean" to remove all staging and make.log files.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400145#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400146# For the sake of simplicity, the "standard" installation can be done
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400147# with the usual
148#
149# make
150# make install
151# make clean
152#
153#--------------------------------------------------------------------
154# This Makefile contains bash-isms
155SHELL = bash
Tristan Gingolda5854312020-10-15 18:28:16 +0200156MV = mv
Tim Edwards5a623ff2021-04-30 16:30:52 -0400157SED = @SED@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400158
Tim Edwardsf04c4212021-03-18 10:12:16 -0400159# Use git revision if this is a cloned repo; otherwise get the revision
160# from the VERSION file in the directory above.
161GITREV = $(shell git describe --long)
162ifeq (${GITREV},)
163 REVISION = $(shell cat ../VERSION)
164else
165 REVISION = ${GITREV}
166endif
167TECH = sky130
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400168
169# If EF_STYLE is set to 1, then efabless naming conventions are
170# used, otherwise the generic naming conventions are used.
171# Mainly, the hierarchy of library names and file types is reversed
172# (e.g., sky130_fd_sc_hd/lef vs. lef/sky130_fd_sc_hd).
173
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400174# EF_STYLE = 0 | 1
175EF_STYLE = @EF_STYLE@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400176
177# Normally it's fine to keep the staging path in a local directory,
178# although /tmp or a dedicated staging area are also fine, as long
179# as the install process can write to the path.
180
Tim Edwardsf04c4212021-03-18 10:12:16 -0400181STAGING_PATH = $(shell pwd)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400182
183# If LINK_TARGETS is set to "none", then files are copied
184# from the SkyWater sources to the target. If set to "source",
185# symbolic links are made in the target directories pointing
186# back to the SkyWater sources. If set to the name of another
187# PDK (e.g, "sky130A"), then symbolic links are made to the
188# same files in that PDK, where they exist, and are copied
189# from source, where they don't.
190
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400191# LINK_TARGETS = source | none | sky130A
192LINK_TARGETS = @SKY130_LINK_TARGETS@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400193
194# Paths:
195
agorararmard3ee5f112021-02-03 19:49:09 +0200196# Path to skywater_pdk
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400197SKYWATER_PATH = @SKY130_SOURCE_PATH@
Tim Edwards66e53e52021-01-24 21:21:36 -0500198ifneq ($(SKYWATER_PATH),)
Tim Edwards6ee11532021-02-11 12:29:33 -0500199 SKYWATER_LIBS_PATH = ${SKYWATER_PATH}/libraries
200else
201 SKYWATER_LIBS_PATH =
Tim Edwards66e53e52021-01-24 21:21:36 -0500202endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400203
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500204# Path to independent library sources (to be added to configuration options).
Tim Edwards1168a8b2021-02-10 22:06:54 -0500205ALPHA_PATH = @SKY130_ML_XX_HD_PATH@
206XSCHEM_PATH = @XSCHEM_SKY130_PATH@
Tim Edwardscfe970c2021-02-26 14:35:51 -0500207SRAM_PATH = @SKY130_SRAM_MACROS_PATH@
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400208OSU_PATH = @SKY130_OSU_PATH@
209OSU_T12_PATH = @SKY130_OSU_T12_PATH@
210OSU_T15_PATH = @SKY130_OSU_T15_PATH@
211OSU_T18_PATH = @SKY130_OSU_T18_PATH@
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500212
Tim Edwards6ee11532021-02-11 12:29:33 -0500213PDK_URL = https://github.com/google/skywater-pdk
Tim Edwardscfe970c2021-02-26 14:35:51 -0500214ALPHA_URL = https://github.com/PaulSchulz/sky130_pschulz_xx_hd/archive/master.tar.gz
Tim Edwards6ee11532021-02-11 12:29:33 -0500215XSCHEM_URL = https://github.com/StefanSchippers/xschem_sky130/archive/main.tar.gz
Tim Edwardscfe970c2021-02-26 14:35:51 -0500216SRAM_URL = https://github.com/efabless/sky130_sram_macros/archive/main.tar.gz
Tim Edwards9759ce52021-05-04 13:19:56 -0400217OSU_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc/+archive/refs/heads/main.tar.gz
218OSU_T12_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t12/+archive/refs/heads/main.tar.gz
219OSU_T15_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t15/+archive/refs/heads/main.tar.gz
220OSU_T18_URL = https://foss-eda-tools.googlesource.com/skywater-pdk/libs/sky130_osu_sc_t18/+archive/refs/heads/main.tar.gz
Tim Edwards6ee11532021-02-11 12:29:33 -0500221
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400222# NOTE: Install destination is the git repository of the technology platform.
223# Once updated in git, the git project can be distributed to all hosts.
224#
225ifeq (${EF_STYLE}, 1)
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400226 LOCAL_PATH = @SKY130_LOCAL_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400227 CONFIG_DIR = .ef-config
228 REV_DIR = ${REVISION}
229else
230 # LOCAL_PATH = /usr/local/share/vlsi/SkyWater
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400231 LOCAL_PATH = @SKY130_LOCAL_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400232 CONFIG_DIR = .config
233 REV_DIR = .
234endif
235
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400236# DIST_PATH = ~/gits/ef-skywater-${TECH}
237DIST_PATH = @SKY130_DIST_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400238
239# EF process nodes created from the master sources
240SKY130A = sky130A
241
242ifeq (${LINK_TARGETS}, ${SKY130A})
243 DIST_LINK_TARGETS = ${LOCAL_PATH}/${LINK_TARGETS}
244else
245 DIST_LINK_TARGETS = ${LINK_TARGETS}
246endif
247
248# Basic definitions for each EF process node
249SKY130A_DEFS = -DTECHNAME=sky130A -DREVISION=${REVISION}
250
251# Module definitions for each process node
252# (Note that MOS is default and therefore not used anywhere)
Tim Edwards0a0272b2020-07-28 14:40:10 -0400253SKY130A_DEFS += -DMETAL5 -DMIM -DREDISTRIBUTION
254# SKY130A_DEFS += -DMETAL5 -DMIM
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400255
256# Add staging path
257SKY130A_DEFS += -DSTAGING_PATH=${STAGING_PATH}
258
259ifeq (${EF_STYLE}, 1)
260 EF_FORMAT = -ef_format
261 SKY130A_DEFS += -DEF_FORMAT
262else
263 EF_FORMAT = -std_format
264endif
265
266MAGICTOP = libs.tech/magic
267NETGENTOP = libs.tech/netgen
Tim Edwards367711e2021-01-27 10:35:12 -0500268IRSIMTOP = libs.tech/irsim
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400269QFLOWTOP = libs.tech/qflow
270KLAYOUTTOP = libs.tech/klayout
271OPENLANETOP = libs.tech/openlane
Tim Edwards1168a8b2021-02-10 22:06:54 -0500272XSCHEMTOP = libs.tech/xschem
Tim Edwardse4c44092021-02-12 10:18:56 -0500273XCIRCUITTOP = libs.tech/xcircuit
Tim Edwards25972f82021-04-27 21:45:58 -0400274NGSPICETOP = libs.tech/ngspice
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400275
276ifeq (${EF_STYLE}, 1)
277 MAGICPATH = ${MAGICTOP}/${REVISION}
Tim Edwards9134eed2021-02-13 14:42:59 -0500278 MAGICCURRENT = ${MAGICTOP}/current
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400279else
280 MAGICPATH = ${MAGICTOP}
Tim Edwards9134eed2021-02-13 14:42:59 -0500281 MAGICCURRENT = ${MAGICTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400282endif
283
Tim Edwards367711e2021-01-27 10:35:12 -0500284# Currently, netgen, qflow, irsim, and klayout do not use revisioning (needs to change!)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400285NETGENPATH = ${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500286IRSIMPATH = ${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400287QFLOWPATH = ${QFLOWTOP}
288KLAYOUTPATH = ${KLAYOUTTOP}
289OPENLANEPATH = ${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500290XSCHEMPATH = ${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500291XCIRCUITPATH = ${XCIRCUITTOP}
Tim Edwards25972f82021-04-27 21:45:58 -0400292NGSPICEPATH = ${NGSPICETOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400293
294MAGICTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICTOP}
295NETGENTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500296IRSIMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400297QFLOWTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWTOP}
298KLAYOUTTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTTOP}
299OPENLANETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500300XSCHEMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500301XCIRCUITTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITTOP}
Tim Edwards25972f82021-04-27 21:45:58 -0400302NGSPICETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NGSPICETOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400303
304MAGIC_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICPATH}
305NETGEN_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENPATH}
Tim Edwards367711e2021-01-27 10:35:12 -0500306IRSIM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400307QFLOW_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWPATH}
308KLAYOUT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTPATH}
309OPENLANE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANEPATH}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500310XSCHEM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMPATH}
Tim Edwardse4c44092021-02-12 10:18:56 -0500311XCIRCUIT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITPATH}
Tim Edwards25972f82021-04-27 21:45:58 -0400312NGSPICE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NGSPICEPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400313
Tim Edwards9134eed2021-02-13 14:42:59 -0500314SKY130A_DEFS += -DMAGIC_CURRENT=${MAGICCURRENT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400315
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500316# Openlane has a number of files that are common to all digital
317# standard cell libraries, so these are collected in one definition
318# here:
agorararmard2ca46022021-02-11 21:43:51 +0200319OPENLANE_COMMON = config.tcl tracks.info no_synth.cells drc_exclude.cells
manarabdelaty2ecac4f2021-03-08 15:23:12 +0200320OPENLANE_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 -0500321
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400322# Where cpp syntax is followed, this is equivalent to cpp, but it does not
323# mangle non-C source files under the belief that they are actually C code.
324CPP = ../common/preproc.py
325
326# The following script in the ../common directory does most of the work of
327# copying or linking the foundry vendor files to the target directory.
328STAGE = set -f ; ../common/foundry_install.py ${EF_FORMAT}
329INSTALL = ../common/staging_install.py ${EF_FORMAT}
330
331# The script(s) below are used for custom changes to the vendor PDK files
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200332ADDPROP = ../common/insert_property.py ${EF_FORMAT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400333
334# List the EDA tools to install local setup files for
Tim Edwardsccaea722020-12-24 10:59:42 -0500335TOOLS =
336
337# KLAYOUT_DISABLED = 0 | 1
338KLAYOUT_DISABLED = @KLAYOUT_DISABLED@
339ifneq (${KLAYOUT_DISABLED}, 1)
340 TOOLS += klayout
341endif
342
343# OPENLANE_DISABLED = 0 | 1
344OPENLANE_DISABLED = @OPENLANE_DISABLED@
345ifneq (${OPENLANE_DISABLED}, 1)
346 TOOLS += openlane
347endif
348
349# QFLOW_DISABLED = 0 | 1
350QFLOW_DISABLED = @QFLOW_DISABLED@
351ifneq (${QFLOW_DISABLED}, 1)
352 TOOLS += qflow
353endif
354
355# MAGIC_DISABLED = 0 | 1
356MAGIC_DISABLED = @MAGIC_DISABLED@
357ifneq (${MAGIC_DISABLED}, 1)
358 TOOLS += magic
359endif
360
361# NETGEN_DISABLED = 0 | 1
362NETGEN_DISABLED = @NETGEN_DISABLED@
363ifneq (${NETGEN_DISABLED}, 1)
364 TOOLS += netgen
365endif
366
Tim Edwards367711e2021-01-27 10:35:12 -0500367# IRSIM_DISABLED = 0 | 1
368IRSIM_DISABLED = @IRSIM_DISABLED@
369ifneq (${IRSIM_DISABLED}, 1)
370 TOOLS += irsim
371endif
372
Tim Edwards1168a8b2021-02-10 22:06:54 -0500373# XSCHEM_DISABLED = 0 | 1
374XSCHEM_DISABLED = @XSCHEM_DISABLED@
375ifneq (${XSCHEM_DISABLED}, 1)
376 TOOLS += xschem
377endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400378
Tim Edwardse4c44092021-02-12 10:18:56 -0500379# XCIRCUIT_DISABLED = 0 | 1
380XCIRCUIT_DISABLED = @XCIRCUIT_DISABLED@
381ifneq (${XCIRCUIT_DISABLED}, 1)
382 TOOLS += xcircuit
383endif
384
Tim Edwards25972f82021-04-27 21:45:58 -0400385# These definitions depend on the setting of EF_STYLE
386ifeq (${EF_STYLE}, 1)
387 IO_VERILOG = verilog/sky130_fd_io
388 HD_VERILOG = verilog/sky130_fd_sc_hd
389 HDLL_VERILOG = verilog/sky130_fd_sc_hdll
390 HVL_VERILOG = verilog/sky130_fd_sc_hvl
391 HS_VERILOG = verilog/sky130_fd_sc_hs
392 MS_VERILOG = verilog/sky130_fd_sc_ms
393 LS_VERILOG = verilog/sky130_fd_sc_ls
394 LP_VERILOG = verilog/sky130_fd_sc_lp
395 HD_TECHLEF = techLEF/sky130_fd_sc_hd
396 HDLL_TECHLEF = techLEF/sky130_fd_sc_hdll
397 MLXX_SCRIPTS = scripts/sky130_ml_xx_hd
398 PR_SPICE = spi/sky130_fd_pr
Tim Edwardsf63ee052021-04-29 15:13:45 -0400399 HVL_SPICE = spi/sky130_fd_sc_hvl
Tim Edwards16b050b2021-05-17 16:45:34 -0400400 HVL_PATCH4 = 4b
Tim Edwardsf63ee052021-04-29 15:13:45 -0400401 HVL_CDL = cdl/sky130_fd_sc_hvl
Tim Edwards25972f82021-04-27 21:45:58 -0400402else
403 IO_VERILOG = sky130_fd_io/verilog
404 HD_VERILOG = sky130_fd_sc_hd/verilog
405 HDLL_VERILOG = sky130_fd_sc_hdll/verilog
406 HVL_VERILOG = sky130_fd_sc_hvl/verilog
407 HS_VERILOG = sky130_fd_sc_hs/verilog
408 MS_VERILOG = sky130_fd_sc_ms/verilog
409 LS_VERILOG = sky130_fd_sc_ls/verilog
410 LP_VERILOG = sky130_fd_sc_lp/verilog
411 HD_TECHLEF = sky130_fd_sc_hd/techlef
412 HDLL_TECHLEF = sky130_fd_sc_hdll/techlef
413 MLXX_SCRIPTS = sky130_ml_xx_hd/scripts
414 PR_SPICE = sky130_fd_pr/spice
Tim Edwardsf63ee052021-04-29 15:13:45 -0400415 HVL_SPICE = sky130_fd_sc_hvl/spice
Tim Edwards16b050b2021-05-17 16:45:34 -0400416 HVL_PATCH4 = 4
Tim Edwardsf63ee052021-04-29 15:13:45 -0400417 HVL_CDL = sky130_fd_sc_hvl/cdl
Tim Edwards25972f82021-04-27 21:45:58 -0400418endif
419
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400420all: all-a
421
Tim Edwards6ee11532021-02-11 12:29:33 -0500422# Handle prerequisites (fetch and install the PDK and requested libraries)
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400423prerequisites: pdk-repo alpha-repo xschem-repo sram-repo osu-repo osu-t12-repo osu-t15-repo osu-t18-repo
Tim Edwards6ee11532021-02-11 12:29:33 -0500424
425pdk-repo:
426 if test "x${SKYWATER_PATH}" != "x" ; then \
427 if test -d "${SKYWATER_PATH}" ; then \
428 echo "Using existing installation of SkyWater PDK from ${SKYWATER_PATH}" ; \
429 else \
430 echo "Downloading SkyWater PDK from ${PDK_URL}" ; \
431 custom/scripts/pdk_download.sh ${PDK_URL} ${SKYWATER_PATH} ; \
432 fi ; \
433 fi
434
435alpha-repo:
436 if test "x${ALPHA_PATH}" != "x" ; then \
437 if test -d "${ALPHA_PATH}" ; then \
438 echo "Using existing installation of alphanumeric library from ${ALPHA_PATH}" ; \
439 else \
440 echo "Downloading alphanumeric library from ${ALPHA_URL}" ; \
441 ../scripts/download.sh ${ALPHA_URL} ${ALPHA_PATH} ; \
442 fi ; \
443 fi
444
Tim Edwardscfe970c2021-02-26 14:35:51 -0500445sram-repo:
446 if test "x${SRAM_PATH}" != "x" ; then \
447 if test -d "${SRAM_PATH}" ; then \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400448 echo "Using existing installation of SRAM macro library from ${SRAM_PATH}" ; \
Tim Edwardscfe970c2021-02-26 14:35:51 -0500449 else \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400450 echo "Downloading SRAM macro library from ${SRAM_URL}" ; \
Tim Edwardscfe970c2021-02-26 14:35:51 -0500451 ../scripts/download.sh ${SRAM_URL} ${SRAM_PATH} ; \
452 fi ; \
453 fi
454
455xschem-repo:
456 if test "x${XSCHEM_PATH}" != "x" ; then \
457 if test -d "${XSCHEM_PATH}" ; then \
458 echo "Using existing installation of xschem setup from ${XSCHEM_PATH}" ; \
459 else \
460 echo "Downloading xschem setup from ${XSCHEM_URL}" ; \
461 ../scripts/download.sh ${XSCHEM_URL} ${XSCHEM_PATH} ; \
462 fi ; \
463 fi
464
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400465osu-repo:
466 if test "x${OSU_PATH}" != "x" ; then \
467 if test -d "${OSU_PATH}" ; then \
468 echo "Using existing installation of OSU standard cell library from ${OSU_PATH}" ; \
469 else \
470 echo "Downloading OSU standard cell library from ${OSU_URL}" ; \
471 ../scripts/download.sh ${OSU_URL} ${OSU_PATH} 0 ; \
472 fi ; \
473 fi
474
475osu-t12-repo:
476 if test "x${OSU_T12_PATH}" != "x" ; then \
477 if test -d "${OSU_T12_PATH}" ; then \
478 echo "Using existing installation of OSU T12 standard cell library from ${OSU_T12_PATH}" ; \
479 else \
480 echo "Downloading OSU standard T12 cell library from ${OSU_T12_URL}" ; \
481 ../scripts/download.sh ${OSU_T12_URL} ${OSU_T12_PATH} 0 ; \
482 fi ; \
483 fi
484
485osu-t15-repo:
486 if test "x${OSU_T15_PATH}" != "x" ; then \
487 if test -d "${OSU_T15_PATH}" ; then \
488 echo "Using existing installation of OSU T15 standard cell library from ${OSU_T15_PATH}" ; \
489 else \
490 echo "Downloading OSU standard T15 cell library from ${OSU_T15_URL}" ; \
491 ../scripts/download.sh ${OSU_T15_URL} ${OSU_T15_PATH} 0 ; \
492 fi ; \
493 fi
494
495osu-t18-repo:
496 if test "x${OSU_T18_PATH}" != "x" ; then \
497 if test -d "${OSU_T18_PATH}" ; then \
498 echo "Using existing installation of OSU T18 standard cell library from ${OSU_T18_PATH}" ; \
499 else \
500 echo "Downloading OSU standard T18 cell library from ${OSU_T18_URL}" ; \
501 ../scripts/download.sh ${OSU_T18_URL} ${OSU_T18_PATH} 0 ; \
502 fi ; \
503 fi
504
Tim Edwardscfe970c2021-02-26 14:35:51 -0500505all-a: prerequisites
506 echo "Starting sky130A PDK staging on "`date` > ${SKY130A}_make.log
Tim Edwards10aa9ab2021-03-15 17:46:29 -0400507 ${MAKE} general-a
Tim Edwardscfe970c2021-02-26 14:35:51 -0500508 ${MAKE} tools-a
509 ${MAKE} vendor-a
510 echo "Ended sky130A PDK staging on "`date` >> ${SKY130A}_make.log
511
Tim Edwardscfe970c2021-02-26 14:35:51 -0500512general-a: ${TECH}.json
513 mkdir -p ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}
514 rm -f ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}/nodeinfo.json
515 ${CPP} ${SKY130A_DEFS} ${TECH}.json \
516 ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}/nodeinfo.json
517
Tim Edwards942a14f2020-12-24 16:20:31 -0500518tools-a: $(addsuffix -a, $(TOOLS))
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400519
Tim Edwards5778c232020-07-07 16:57:52 -0400520magic-a: magic/${TECH}.tech magic/${TECH}gds.tech magic/${TECH}.magicrc magic/${TECH}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400521 mkdir -p ${MAGICTOP_STAGING_A}
522 mkdir -p ${MAGIC_STAGING_A}
523 rm -f ${MAGICTOP_STAGING_A}/current
524 rm -f ${MAGIC_STAGING_A}/${SKY130A}.tech
525 rm -f ${MAGIC_STAGING_A}/${SKY130A}-GDS.tech
526 rm -f ${MAGIC_STAGING_A}/${SKY130A}.tcl
527 rm -f ${MAGIC_STAGING_A}/${SKY130A}-BindKeys
528 rm -f ${MAGIC_STAGING_A}/magicrc
Tim Edwards4db522f2021-05-04 13:34:40 -0400529 if test "${EF_STYLE}" == "1" ; then \
Tim Edwards9134eed2021-02-13 14:42:59 -0500530 (cd ${MAGICTOP_STAGING_A} ; ln -s ${REV_DIR} current) ; \
531 fi
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400532 cp -rp custom/scripts/seal_ring_generator ${MAGIC_STAGING_A}/.
Tim Edwards4d081b82021-01-27 14:30:03 -0500533 cp -rp custom/scripts/bump_bond_generator ${MAGIC_STAGING_A}/.
Tim Edwards4d46bac2020-12-29 16:23:22 -0500534 cp custom/scripts/generate_fill.py ${MAGIC_STAGING_A}/.
Tim Edwards113b0832021-01-13 11:27:52 -0500535 cp custom/scripts/check_density.py ${MAGIC_STAGING_A}/.
Tim Edwardsc46b9532021-04-12 14:31:29 -0400536 cp custom/scripts/run_standard_drc.py ${MAGIC_STAGING_A}/.
537 cp custom/scripts/check_antenna.py ${MAGIC_STAGING_A}/.
Tim Edwards9134eed2021-02-13 14:42:59 -0500538 ${CPP} ${SKY130A_DEFS} magic/${TECH}.tech ${MAGIC_STAGING_A}/${SKY130A}.tech
539 ${CPP} ${SKY130A_DEFS} magic/${TECH}gds.tech ${MAGIC_STAGING_A}/${SKY130A}-GDS.tech
540 ${CPP} ${SKY130A_DEFS} magic/${TECH}.magicrc ${MAGIC_STAGING_A}/${SKY130A}.magicrc
541 ${CPP} ${SKY130A_DEFS} ../common/pdk.bindkeys ${MAGIC_STAGING_A}/${SKY130A}-BindKeys
542 ${CPP} ${SKY130A_DEFS} magic/${TECH}.tcl ${MAGIC_STAGING_A}/${SKY130A}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400543 ${CPP} ${SKY130A_DEFS} ../common/pdk.tcl >> ${MAGIC_STAGING_A}/${SKY130A}.tcl
544
Tim Edwards5778c232020-07-07 16:57:52 -0400545qflow-a: qflow/${TECH}.sh qflow/${TECH}.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400546 mkdir -p ${QFLOWTOP_STAGING_A}
547 mkdir -p ${QFLOW_STAGING_A}
548 rm -f ${QFLOW_STAGING_A}/${SKY130A}hd.sh
549 rm -f ${QFLOW_STAGING_A}/${SKY130A}hd.par
550 rm -f ${QFLOW_STAGING_A}/${SKY130A}hdll.sh
551 rm -f ${QFLOW_STAGING_A}/${SKY130A}hdll.par
552 rm -f ${QFLOW_STAGING_A}/${SKY130A}hs.sh
553 rm -f ${QFLOW_STAGING_A}/${SKY130A}hs.par
554 rm -f ${QFLOW_STAGING_A}/${SKY130A}hvl.sh
555 rm -f ${QFLOW_STAGING_A}/${SKY130A}hvl.par
556 rm -f ${QFLOW_STAGING_A}/${SKY130A}ls.sh
557 rm -f ${QFLOW_STAGING_A}/${SKY130A}ls.par
558 rm -f ${QFLOW_STAGING_A}/${SKY130A}lp.sh
559 rm -f ${QFLOW_STAGING_A}/${SKY130A}lp.par
560 rm -f ${QFLOW_STAGING_A}/${SKY130A}ms.sh
561 rm -f ${QFLOW_STAGING_A}/${SKY130A}ms.par
Tim Edwards7ec76972020-07-07 21:56:08 -0400562 rm -f ${QFLOW_STAGING_A}/${SKY130A}osu.sh
563 rm -f ${QFLOW_STAGING_A}/${SKY130A}osu.par
Tim Edwards9134eed2021-02-13 14:42:59 -0500564 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hd qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400565 ${QFLOW_STAGING_A}/${SKY130A}hd.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500566 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hdll qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400567 ${QFLOW_STAGING_A}/${SKY130A}hdll.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500568 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hvl qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400569 ${QFLOW_STAGING_A}/${SKY130A}hvl.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500570 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hs qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400571 ${QFLOW_STAGING_A}/${SKY130A}hs.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500572 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_lp qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400573 ${QFLOW_STAGING_A}/${SKY130A}lp.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500574 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_ls qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400575 ${QFLOW_STAGING_A}/${SKY130A}ls.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500576 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_ms qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400577 ${QFLOW_STAGING_A}/${SKY130A}ms.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500578 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_osu_sc_t18 qflow/sky130osu.sh \
Tim Edwards7ec76972020-07-07 21:56:08 -0400579 ${QFLOW_STAGING_A}/${SKY130A}osu.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500580 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}hd.par
581 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}hdll.par
582 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}hvl.par
583 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}hs.par
584 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}ms.par
585 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}lp.par
586 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}ls.par
587 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}osu.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400588
Tim Edwards5778c232020-07-07 16:57:52 -0400589netgen-a: netgen/${TECH}_setup.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400590 mkdir -p ${NETGENTOP_STAGING_A}
591 mkdir -p ${NETGEN_STAGING_A}
592 rm -f ${NETGEN_STAGING_A}/${SKY130A}_setup.tcl
593 rm -f ${NETGEN_STAGING_A}/setup.tcl
Tim Edwards9134eed2021-02-13 14:42:59 -0500594 ${CPP} ${SKY130A_DEFS} netgen/${TECH}_setup.tcl ${NETGEN_STAGING_A}/${SKY130A}_setup.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400595 (cd ${NETGEN_STAGING_A} ; ln -s ${SKY130A}_setup.tcl setup.tcl)
596
Tim Edwards1168a8b2021-02-10 22:06:54 -0500597irsim-a: irsim
Tim Edwards367711e2021-01-27 10:35:12 -0500598 mkdir -p ${IRSIMTOP_STAGING_A}
599 mkdir -p ${IRSIM_STAGING_A}
600 rm -f ${IRSIM_STAGING_A}/${SKY130A}_*.prm
601 cp irsim/${SKY130A}_*.prm ${IRSIM_STAGING_A}/
602
Tim Edwards5778c232020-07-07 16:57:52 -0400603klayout-a: klayout/${TECH}.lyp klayout/${TECH}.lyt
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400604 mkdir -p ${KLAYOUTTOP_STAGING_A}
605 mkdir -p ${KLAYOUT_STAGING_A}
606 rm -f ${KLAYOUT_STAGING_A}/${SKY130A}.lyp
607 rm -f ${KLAYOUT_STAGING_A}/${SKY130A}.lyt
Tim Edwards9134eed2021-02-13 14:42:59 -0500608 ${CPP} ${SKY130A_DEFS} klayout/${TECH}.lyp ${KLAYOUT_STAGING_A}/${SKY130A}.lyp
609 ${CPP} ${SKY130A_DEFS} klayout/${TECH}.lyt ${KLAYOUT_STAGING_A}/${SKY130A}.lyt
agorararmard1a6ece52021-01-15 18:50:43 +0200610 cp klayout/${TECH}.lydrc ${KLAYOUT_STAGING_A}/${SKY130A}.lydrc
agorararmard22561582021-01-15 17:55:59 +0200611 ./custom/scripts/gen_run_drc.py -l ${KLAYOUT_STAGING_A}/${SKY130A}.lydrc -o ${KLAYOUT_STAGING_A}/${SKY130A}.drc
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400612
Tim Edwardse4c44092021-02-12 10:18:56 -0500613xcircuit-a: xcircuit/${TECH}.xcircuitrc
614 rm -rf ${XCIRCUIT_STAGING_A}
615 mkdir -p ${XCIRCUITTOP_STAGING_A}
616 mkdir -p ${XCIRCUIT_STAGING_A}
617 rm -f ${XCIRCUIT_STAGING_A}/*.lps
618 rm -f ${XCIRCUIT_STAGING_A}/${SKY130A}.xcircuitrc
Tim Edwards9134eed2021-02-13 14:42:59 -0500619 ${CPP} ${SKY130A_DEFS} xcircuit/ngspice.lps ${XCIRCUIT_STAGING_A}/ngspice.lps
620 ${CPP} ${SKY130A_DEFS} xcircuit/sky130_fd_pr.lps ${XCIRCUIT_STAGING_A}/sky130_fd_pr.lps
621 ${CPP} ${SKY130A_DEFS} xcircuit/sky130_fd_sc_hd.lps ${XCIRCUIT_STAGING_A}/sky130_fd_sc_hd.lps
622 ${CPP} ${SKY130A_DEFS} xcircuit/${TECH}.xcircuitrc ${XCIRCUIT_STAGING_A}/${SKY130A}.xcircuitrc
Tim Edwardse4c44092021-02-12 10:18:56 -0500623
Tim Edwards1168a8b2021-02-10 22:06:54 -0500624xschem-a: ${XSCHEM_PATH}
625 rm -rf ${XSCHEM_STAGING_A}
626 mkdir -p ${XSCHEMTOP_STAGING_A}
627 mkdir -p ${XSCHEM_STAGING_A}
628 # Copy the entire repository (other than .git, if it exists)
629 if test "x${XSCHEM_PATH}" != "x" ; then \
630 cp -rp ${XSCHEM_PATH}/* ${XSCHEM_STAGING_A} ; \
631 fi
Tim Edwards9a17fca2021-02-11 17:44:04 -0500632 # Re-copy the xschemrc, with one change to add the PDK install path as
633 # a component of XSCHEM_LIBRARY_PATH
634 cat ${XSCHEM_PATH}/xschemrc | \
Tim Edwards5a623ff2021-04-30 16:30:52 -0400635 ${SED} -e "/PWD/aappend XSCHEM_LIBRARY_PATH :${XSCHEM_STAGING_A}" | \
636 ${SED} -e "/sky130_models.tcl/s#scripts#${XSCHEM_STAGING_A}/scripts#" | \
637 ${SED} -e "/netlist_dir/aset netlist_dir ." \
Tim Edwards9a17fca2021-02-11 17:44:04 -0500638 > ${XSCHEM_STAGING_A}/xschemrc
Tim Edwards1168a8b2021-02-10 22:06:54 -0500639
Tristan Gingolda5854312020-10-15 18:28:16 +0200640openlane-a: openlane/common_pdn.tcl 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 Edwards55f4d0e2020-07-05 15:41:02 -0400641 mkdir -p ${OPENLANETOP_STAGING_A}
642 mkdir -p ${OPENLANE_STAGING_A}
Tim Edwards3c1dd9a2020-11-27 13:49:58 -0500643 rm -rf ${OPENLANE_STAGING_A}/custom_cells/*
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400644 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hd
Tim Edwards5778c232020-07-07 16:57:52 -0400645 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hs
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200646 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_ls
647 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_ms
648 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll
649 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl
Tristan Gingolda5854312020-10-15 18:28:16 +0200650 mkdir -p ${OPENLANE_STAGING_A}/sky130_osu_sc_t18
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400651 rm -f ${OPENLANE_STAGING_A}/common_pdn.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400652 rm -f ${OPENLANE_STAGING_A}/config.tcl
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500653 for file in ${OPENLANE_COMMON} ; do \
654 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/$$file ; \
655 done
656 for file in ${OPENLANE_COMMON} ; do \
657 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/$$file ; \
658 done
659 for file in ${OPENLANE_COMMON} ; do \
660 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/$$file ; \
661 done
662 for file in ${OPENLANE_COMMON} ; do \
663 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/$$file ; \
664 done
665 for file in ${OPENLANE_COMMON} ; do \
666 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/$$file ; \
667 done
668 for file in ${OPENLANE_COMMON} ; do \
669 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/$$file ; \
670 done
671 for file in ${OPENLANE_COMMON} ; do \
672 rm -f ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/$$file ; \
673 done
674
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200675 cp -r openlane/custom_cells ${OPENLANE_STAGING_A}
Tim Edwards9134eed2021-02-13 14:42:59 -0500676 ${CPP} ${SKY130A_DEFS} openlane/common_pdn.tcl ${OPENLANE_STAGING_A}/common_pdn.tcl
677 ${CPP} ${SKY130A_DEFS} openlane/config.tcl ${OPENLANE_STAGING_A}/config.tcl
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500678
679 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500680 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_hd/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500681 ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/$$file ; \
682 done
683 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500684 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_hs/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500685 ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/$$file ; \
686 done
687 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500688 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_ms/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500689 ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/$$file ; \
690 done
691 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500692 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_ls/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500693 ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/$$file ; \
694 done
695 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500696 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_hdll/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500697 ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/$$file ; \
698 done
699 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500700 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_hvl/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500701 ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/$$file ; \
702 done
703
Tim Edwards9134eed2021-02-13 14:42:59 -0500704 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_osu_sc_t18/config.tcl \
705 ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/config.tcl
706 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_osu_sc_t18/tracks.info \
707 ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/tracks.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400708
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400709vendor-a: primitive-a io-a digital-a alpha-a sram-a osu-base-a osu-t12-a osu-t15-a osu-t18-a
710
711primitive-a:
Tim Edwards106e38b2020-09-20 13:07:54 -0400712 # Install device subcircuits from vendor files
Tim Edwards6ee11532021-02-11 12:29:33 -0500713 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards995c1332020-09-25 15:33:58 -0400714 -ngspice sky130_fd_pr/latest/models/* \
715 filter=custom/scripts/rename_models.py \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200716 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwards7e294962021-05-04 20:33:17 -0400717 # Install device layouts from custom sources
718 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
719 -gds sky130_fd_pr/*.gds \
720 options=custom/scripts/gds_import_setup.tcl \
721 -library primitive sky130_fd_pr 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400722 # Install base device library from vendor files
Tim Edwards6ee11532021-02-11 12:29:33 -0500723 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards7e294962021-05-04 20:33:17 -0400724 -gds %l/latest/cells/*/*.gds \
725 exclude=sky130_fd_pr__pnp_05v5_W3p40L3p40.gds \
726 compile-only \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -0400727 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards106e38b2020-09-20 13:07:54 -0400728 -cdl %l/latest/cells/*/*.cdl compile-only \
729 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwardsbfc82692020-09-20 21:33:08 -0400730 -spice %l/latest/cells/*/*.spice filter=custom/scripts/rename_cells.py \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200731 -library primitive sky130_fd_pr 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwardse60b4862020-11-23 16:56:52 -0500732 # Custom: Add "short" resistor model and subcircuit to the r+c models file
Tim Edwards42f79a32020-09-21 14:18:09 -0400733 cat ./custom/models/short.spice >> \
agorararmard3ee5f112021-02-03 19:49:09 +0200734 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -0500735 # Custom: Add diodes as subcircuits to the r+c models file
736 cat ./custom/models/diode.spice >> \
agorararmard3ee5f112021-02-03 19:49:09 +0200737 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardsf63ee052021-04-29 15:13:45 -0400738 # Custom: Add resistors as subcircuits to the r+c models file
739 cat ./custom/models/resistor.spice >> \
740 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -0500741
Tim Edwards9134eed2021-02-13 14:42:59 -0500742 # Custom: Patch the models to work around ngspice issue with the relative
743 # order of the "nf" and "mult" parameters.
Tim Edwards25972f82021-04-27 21:45:58 -0400744 patch -p4 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/${PR_SPICE} \
Tim Edwards9134eed2021-02-13 14:42:59 -0500745 < custom/patches/sky130_fd_pr.patch \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200746 2>&1 | tee -a ${SKY130A}_make.log || true
Tim Edwards25972f82021-04-27 21:45:58 -0400747 patch -p1 -f -d ${STAGING_PATH}/${SKY130A} \
748 < custom/patches/sky130_fd_pr_2.patch \
749 2>&1 | tee -a ${SKY130A}_make.log || true
Tim Edwardsf499ad22021-05-04 16:55:21 -0400750 # Custom: Patch the models to remove the substrate pin from the PNP
751 # device, which has no independent substrate pin (collector=substrate)
752 patch -p4 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/${PR_SPICE} \
753 < custom/patches/sky130_fd_pr_3.patch \
754 2>&1 | tee -a ${SKY130A}_make.log || true
Tim Edwardsf63ee052021-04-29 15:13:45 -0400755 # Custom: Patch the ngspice models to add the HV diffusion resistor subcircuits
756 patch -p2 -f -d ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice \
757 < custom/patches/sky130_fd_pr_5.patch \
758 2>&1 | tee -a ${SKY130A}_make.log || true
Tim Edwardsf499ad22021-05-04 16:55:21 -0400759 # Fix up the PNP model file before running the next modification
760 head -15 ${STAGING_PATH}/${SKY130A}/libs.ref/${PR_SPICE}/sky130_fd_pr__pnp_05v5_W3p40L3p40.model.spice > ${STAGING_PATH}/${SKY130A}/libs.ref/${PR_SPICE}/temp
761 tail -39 ${STAGING_PATH}/${SKY130A}/libs.ref/${PR_SPICE}/sky130_fd_pr__pnp_05v5_W3p40L3p40.model.spice >> ${STAGING_PATH}/${SKY130A}/libs.ref/${PR_SPICE}/temp
762 mv ${STAGING_PATH}/${SKY130A}/libs.ref/${PR_SPICE}/temp ${STAGING_PATH}/${SKY130A}/libs.ref/${PR_SPICE}/sky130_fd_pr__pnp_05v5_W3p40L3p40.model.spice
Tim Edwards9fdf5f02021-05-03 16:15:03 -0400763 # Custom: Parse the (commented out) statistics blocks and generate
764 # ngspice-compatible monte carlo parameters for mismatch and process
Tim Edwards00bfca52021-05-04 10:48:46 -0400765 ./custom/scripts/mismatch_params.py \
766 2>&1 | tee -a ${SKY130A}_make.log || true
767 ./custom/scripts/mismatch_params.py \
768 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice \
769 2>&1 | tee -a ${SKY130A}_make.log || true
770 ./custom/scripts/process_params.py \
771 2>&1 | tee -a ${SKY130A}_make.log || true
772 # Custom: Add "mc" section to sky130.lib.spice
773 head -n-1 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130.lib.spice \
774 | ${SED} -e '/^\.lib/a.param mc_pr_switch=0' \
775 > ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130.lib.spice.head
776 cat ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130.lib.spice.head \
777 custom/models/sky130.lib.spice.extra > \
778 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130.lib.spice
779 rm ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130.lib.spice.head
Tim Edwards9fdf5f02021-05-03 16:15:03 -0400780
Tim Edwards10aa9ab2021-03-15 17:46:29 -0400781 # Custom: Add "spinit" file
782 cat ./custom/models/spinit >> \
783 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/spinit
784
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400785io-a:
Ahmed Ghazy59370ab2020-10-29 02:04:45 +0200786 # Install custom additions to I/O pad library
787 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
788 -verilog %l/verilog/*.v \
789 -cdl %l/cdl/*.cdl \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400790 -spice %l/spice/*.spice \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -0400791 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
Ahmed Ghazy59370ab2020-10-29 02:04:45 +0200792 -lef %l/lef/*.lef compile-only rename=sky130_ef_io \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200793 -library general sky130_fd_io 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400794 # Install SkyWater I/O pad library
Tim Edwards6ee11532021-02-11 12:29:33 -0500795 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards1134fbc2020-10-12 22:35:42 -0400796 -spice %l/latest/cells/*/*.spice compile-only \
797 sort=custom/scripts/sort_pdkfiles.py \
798 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
799 sort=custom/scripts/sort_pdkfiles.py \
800 -lef %l/latest/cells/*/*.magic.lef compile-only \
801 sort=custom/scripts/sort_pdkfiles.py \
802 -doc %l/latest/cells/*/*.pdf \
803 -lib %l/latest/timing/*.lib \
804 -gds %l/latest/cells/*/*.gds compile-only \
805 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards26ab4962021-01-03 14:22:54 -0500806 options=custom/scripts/sky130_fd_io_import.tcl \
Tim Edwards1134fbc2020-10-12 22:35:42 -0400807 -verilog %l/latest/cells/*/*.*.v \
808 -verilog %l/latest/cells/*/*.v exclude=*.*.v \
809 compile-only filter=custom/scripts/inc_verilog.py \
810 sort=custom/scripts/sort_pdkfiles.py \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200811 -library general sky130_fd_io 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwards1134fbc2020-10-12 22:35:42 -0400812 # Remove the base verilog files which have already been included into
813 # the libraries
Tim Edwards25972f82021-04-27 21:45:58 -0400814 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/${IO_VERILOG}/*.*.v
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200815 # Install custom additions to standard cell libraries
816 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -0400817 -gds %l/gds/*.gds options=custom/scripts/gds_import_setup.tcl \
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200818 -lef %l/lef/*.lef \
Tim Edwardsbb8ab292021-01-22 10:19:40 -0500819 -verilog %l/verilog/*.v \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200820 -library digital sky130_fd_sc_hd 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwardsd14571f2021-01-06 14:49:27 -0500821 # Add a maskhint set for the GPIO pad .mag view to prevent problems writing
822 # when writing HVI to GDS during hierarchical adjustments.
823 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_io sky130_fd_io__top_gpiov2 \
824 "MASKHINTS_HVI 1346 17198 5828 19224 13700 1890 15920 2360 24 17522 1778 20612" -mag
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400825
826digital-a:
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200827 # Install all SkyWater digital standard cells.
Tim Edwards6ee11532021-02-11 12:29:33 -0500828 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400829 -techlef %l/latest/tech/*.tlef \
830 -spice %l/latest/cells/*/*.spice compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400831 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards99a5cf92021-05-16 16:42:49 -0400832 filter=custom/scripts/fix_device_models.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400833 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400834 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards106e38b2020-09-20 13:07:54 -0400835 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400836 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400837 -doc %l/latest/cells/*/*.pdf \
838 -lib %l/latest/timing/*.lib \
839 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -0400840 options=custom/scripts/gds_import_setup.tcl \
Tim Edwards995c1332020-09-25 15:33:58 -0400841 sort=custom/scripts/sort_pdkfiles.py \
842 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
843 rename=primitives filter=custom/scripts/inc_verilog.py \
844 sort=custom/scripts/sort_pdkfiles.py \
845 -verilog %l/latest/cells/*/*.*.v \
846 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
847 compile-only filter=custom/scripts/inc_verilog.py \
848 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400849 -library digital sky130_fd_sc_hd \
850 -library digital sky130_fd_sc_hdll \
851 -library digital sky130_fd_sc_hvl \
852 -library digital sky130_fd_sc_hs \
853 -library digital sky130_fd_sc_ls \
854 -library digital sky130_fd_sc_ms \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200855 -library digital sky130_fd_sc_lp 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwards16a9caa2021-01-08 13:10:06 -0500856 # Add a maskhint set for the tap cell .ag view to prevent problems writing
857 # when writing NSDM and PSDM to GDS during hierarchical adjustments.
858 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_sc_hd sky130_fd_sc_hd__tapvpwrvgnd_1 \
859 "MASKHINTS_PSDM 0 38 92 196" -mag
860 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_sc_hd sky130_fd_sc_hd__tapvpwrvgnd_1 \
861 "MASKHINTS_NSDM 0 280 92 506" -mag
Tim Edwards995c1332020-09-25 15:33:58 -0400862 # Remove the base verilog files which have already been included into
863 # the libraries
Tim Edwards25972f82021-04-27 21:45:58 -0400864 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/${HD_VERILOG}/*.*.v
865 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/${HDLL_VERILOG}/*.*.v
866 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/${HVL_VERILOG}/*.*.v
867 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/${HS_VERILOG}/*.*.v
868 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/${MS_VERILOG}/*.*.v
869 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/${LS_VERILOG}/*.*.v
870 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/${LP_VERILOG}/*.*.v
Ahmed Ghazy7875f1e2021-01-19 18:15:30 +0200871 # Apply extra PDK patches until they get fixed properly in the source
Tim Edwards25972f82021-04-27 21:45:58 -0400872 patch -p1 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/${HD_TECHLEF} \
Tim Edwards9134eed2021-02-13 14:42:59 -0500873 < custom/patches/hd_minenclosed.squeaky.patch \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200874 2>&1 | tee -a ${SKY130A}_make.log || true
Tim Edwards25972f82021-04-27 21:45:58 -0400875 patch -p1 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/${HDLL_TECHLEF} \
Tim Edwards9134eed2021-02-13 14:42:59 -0500876 < custom/patches/hdll_minenclosed.squeaky.patch \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200877 2>&1 | tee -a ${SKY130A}_make.log || true
Tim Edwardsf63ee052021-04-29 15:13:45 -0400878 # Custom: Patch the HVL library to correct the resistor device names
879 patch -p3 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/${HVL_SPICE} \
Tim Edwards16b050b2021-05-17 16:45:34 -0400880 < custom/patches/sky130_fd_pr_${HVL_PATCH4}.patch \
Tim Edwardsf63ee052021-04-29 15:13:45 -0400881 2>&1 | tee -a ${SKY130A}_make.log || true
882 patch -p3 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/${HVL_CDL} \
883 < custom/patches/sky130_fd_pr_6.patch \
884 2>&1 | tee -a ${SKY130A}_make.log || true
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400885
886alpha-a:
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500887 # Install alphanumeric library.
Tim Edwards1168a8b2021-02-10 22:06:54 -0500888 ${STAGE} -source ${ALPHA_PATH}/.. -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards88bd42e2020-12-18 15:29:48 -0500889 -mag %l/mag/*.mag filter=custom/scripts/text2m5.py \
Mohamed Gaber28e86d72021-02-23 08:34:03 +0200890 -library general sky130_ml_xx_hd 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400891 # Install text2mag.py script for alphanumeric library
Tim Edwards25972f82021-04-27 21:45:58 -0400892 mkdir -p ${STAGING_PATH}/${SKY130A}/libs.ref/${MLXX_SCRIPTS}
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400893 cp custom/scripts/text2mag.py \
Tim Edwards25972f82021-04-27 21:45:58 -0400894 ${STAGING_PATH}/${SKY130A}/libs.ref/${MLXX_SCRIPTS}
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400895
896sram-a:
Tim Edwards8b96a1b2021-04-27 15:16:26 -0400897 # Install SRAM library. NOTE: SRAM macros share some of the same
898 # cell names, so use special option script gds_import_sram.tcl
Tim Edwardscfe970c2021-02-26 14:35:51 -0500899 ${STAGE} -source ${SRAM_PATH}/.. -target ${STAGING_PATH}/${SKY130A} \
900 -lef %l/*/*.lef \
901 -lib %l/*/*.lib \
Tim Edwards8b96a1b2021-04-27 15:16:26 -0400902 -gds %l/*/*.gds options=custom/scripts/gds_import_sram.tcl \
Tim Edwardscfe970c2021-02-26 14:35:51 -0500903 -spice %l/*/sky130_sram_1kbyte_1rw1r_32x256_8.lvs.sp \
904 rename=sky130_sram_1kbyte_1rw1r_32x256_8.spice \
905 -spice %l/*/sky130_sram_2kbyte_1rw1r_32x512_8.lvs.sp \
906 rename=sky130_sram_2kbyte_1rw1r_32x512_8.spice \
907 -spice %l/*/sky130_sram_4kbyte_1rw1r_32x1024_8.lvs.sp \
908 rename=sky130_sram_4kbyte_1rw1r_32x1024_8.spice \
909 -spice %l/*/sram_1rw1r_32_256_8_sky130.lvs.sp \
910 rename=sram_1rw1r_32_256_8_sky130.spice \
911 -verilog %l/*/*.v \
912 -library general sky130_sram_macros 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400913
914osu-base-a:
Tristan Gingolda5854312020-10-15 18:28:16 +0200915 # Install OSU digital standard cells.
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400916 ${STAGE} -source ${OSU_PATH} -target ${STAGING_PATH}/${SKY130A} \
917 -techlef %l/tech/sky130_osu_sc.lef rename=sky130_osu_sc.tlef \
Tristan Gingolda5854312020-10-15 18:28:16 +0200918 -cdl %l/latest/cdl/*.cdl ignore=topography compile-only \
919 -lef %l/latest/lef/*.lef compile-only \
920 -lib %l/latest/lib/*.lib \
921 -gds %l/latest/gds/*.gds compile-only \
Tim Edwardsb6e8c7e2021-03-30 12:20:15 -0400922 options=custom/scripts/gds_import_setup.tcl \
Tim Edwardscdfec5e2021-04-22 20:59:13 -0400923 -library digital sky130_osu_sc 2>&1 | tee -a ${SKY130A}_make.log
924
925osu-t12-a:
926 # Install OSU T12 hs digital standard cells.
927 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130A} \
928 -techlef sky130_osu_sc_12T.tlef rename=sky130_osc_sc_12t_hs.tlef \
929 -spice 12T_hs/cdl/*.spice compile-only exclude=*.*.spice \
930 -lef 12T_hs/lef/*.lef \
931 -lib 12T_hs/lib/*.lib \
932 -gds 12T_hs/gds/*.gds compile-only \
933 options=custom/scripts/gds_import_setup.tcl \
934 -library digital sky130_osu_sc_12t_hs 2>&1 | tee -a ${SKY130A}_make.log
935 # Install OSU T12 ms digital standard cells.
936 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130A} \
937 -techlef sky130_osu_sc_12T.tlef rename=sky130_osc_sc_12t_ms.tlef \
938 -spice 12T_ms/cdl/*.spice compile-only exclude=*.*.spice \
939 -lef 12T_ms/lef/*.lef \
940 -lib 12T_ms/lib/*.lib \
941 -gds 12T_ms/gds/*.gds compile-only \
942 options=custom/scripts/gds_import_setup.tcl \
943 -library digital sky130_osu_sc_12t_ms 2>&1 | tee -a ${SKY130A}_make.log
944 # Install OSU T12 ls digital standard cells.
945 ${STAGE} -source ${OSU_T12_PATH} -target ${STAGING_PATH}/${SKY130A} \
946 -techlef sky130_osu_sc_12T.tlef rename=sky130_osc_sc_12t_ls.tlef \
947 -spice 12T_ls/cdl/*.spice compile-only exclude=*.*.spice \
948 -lef 12T_ls/lef/*.lef \
949 -lib 12T_ls/lib/*.lib \
950 -gds 12T_ls/gds/*.gds compile-only \
951 options=custom/scripts/gds_import_setup.tcl \
952 -library digital sky130_osu_sc_12t_ls 2>&1 | tee -a ${SKY130A}_make.log
953
954osu-t15-a:
955 # Install OSU T15 hs digital standard cells.
956 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130A} \
957 -techlef sky130_osu_sc_15T.tlef rename=sky130_osc_sc_15t_hs.tlef \
958 -spice 15T_hs/cdl/*.spice compile-only exclude=*.*.spice \
959 -lef 15T_hs/lef/*.lef \
960 -lib 15T_hs/lib/*.lib \
961 -gds 15T_hs/gds/*.gds compile-only \
962 options=custom/scripts/gds_import_setup.tcl \
963 -library digital sky130_osu_sc_15t_hs 2>&1 | tee -a ${SKY130A}_make.log
964 # Install OSU T15 ms digital standard cells.
965 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130A} \
966 -techlef sky130_osu_sc_15T.tlef rename=sky130_osc_sc_15t_ms.tlef \
967 -spice 15T_ms/cdl/*.spice compile-only exclude=*.*.spice \
968 -lef 15T_ms/lef/*.lef \
969 -lib 15T_ms/lib/*.lib \
970 -gds 15T_ms/gds/*.gds compile-only \
971 options=custom/scripts/gds_import_setup.tcl \
972 -library digital sky130_osu_sc_15t_ms 2>&1 | tee -a ${SKY130A}_make.log
973 # Install OSU T15 ls digital standard cells.
974 ${STAGE} -source ${OSU_T15_PATH} -target ${STAGING_PATH}/${SKY130A} \
975 -techlef sky130_osu_sc_15T.tlef rename=sky130_osc_sc_15t_ls.tlef \
976 -spice 15T_ls/cdl/*.spice compile-only exclude=*.*.spice \
977 -lef 15T_ls/lef/*.lef \
978 -lib 15T_ls/lib/*.lib \
979 -gds 15T_ls/gds/*.gds compile-only \
980 options=custom/scripts/gds_import_setup.tcl \
981 -library digital sky130_osu_sc_15t_ls 2>&1 | tee -a ${SKY130A}_make.log
982
983osu-t18-a:
984 # Install OSU T18 hs digital standard cells.
985 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130A} \
986 -techlef sky130_osu_sc_18T.tlef rename=sky130_osc_sc_18t_hs.tlef \
987 -spice 18T_hs/cdl/*.spice compile-only exclude=*.*.spice \
988 -lef 18T_hs/lef/*.lef \
989 -lib 18T_hs/lib/*.lib \
990 -gds 18T_hs/gds/*.gds compile-only \
991 options=custom/scripts/gds_import_setup.tcl \
992 -library digital sky130_osu_sc_18t_hs 2>&1 | tee -a ${SKY130A}_make.log
993 # Install OSU T18 ms digital standard cells.
994 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130A} \
995 -techlef sky130_osu_sc_18T.tlef rename=sky130_osc_sc_18t_ms.tlef \
996 -spice 18T_ms/cdl/*.spice compile-only exclude=*.*.spice \
997 -lef 18T_ms/lef/*.lef \
998 -lib 18T_ms/lib/*.lib \
999 -gds 18T_ms/gds/*.gds compile-only \
1000 options=custom/scripts/gds_import_setup.tcl \
1001 -library digital sky130_osu_sc_18t_ms 2>&1 | tee -a ${SKY130A}_make.log
1002 # Install OSU T18 ls digital standard cells.
1003 ${STAGE} -source ${OSU_T18_PATH} -target ${STAGING_PATH}/${SKY130A} \
1004 -techlef sky130_osu_sc_18T.tlef rename=sky130_osc_sc_18t_ls.tlef \
1005 -spice 18T_ls/cdl/*.spice compile-only exclude=*.*.spice \
1006 -lef 18T_ls/lef/*.lef \
1007 -lib 18T_ls/lib/*.lib \
1008 -gds 18T_ls/gds/*.gds compile-only \
1009 options=custom/scripts/gds_import_setup.tcl \
1010 -library digital sky130_osu_sc_18t_ls 2>&1 | tee -a ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001011
Tim Edwards7cbaaba2020-08-05 12:19:18 -04001012install:
Ahmed Ghazyf45cbf32020-08-08 17:11:53 +02001013 if test "x${DIST_PATH}" == "x" ; then \
1014 ${MAKE} install-local ; \
1015 else \
1016 ${MAKE} install-dist; \
Tim Edwards7cbaaba2020-08-05 12:19:18 -04001017 fi
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001018
1019install-local: install-local-a
1020
1021install-local-a:
Tim Edwards9134eed2021-02-13 14:42:59 -05001022 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001023 ${INSTALL} -source ${STAGING_PATH}/${SKY130A} \
1024 -target ${LOCAL_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -05001025 -variable PDKPATH \
Mohamed Gaber28e86d72021-02-23 08:34:03 +02001026 -link_from ${LINK_TARGETS} 2>&1 | tee -a ${SKY130A}_install.log
Tim Edwards9134eed2021-02-13 14:42:59 -05001027 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001028
1029install-dist: install-dist-a
1030
1031install-dist-a:
Tim Edwards9134eed2021-02-13 14:42:59 -05001032 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001033 ${INSTALL} -source ${STAGING_PATH}/${SKY130A} \
1034 -target ${DIST_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -05001035 -variable PDKPATH \
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001036 -local ${LOCAL_PATH}/${SKY130A} \
Mohamed Gaber28e86d72021-02-23 08:34:03 +02001037 -link_from ${DIST_LINK_TARGETS} 2>&1 | tee -a ${SKY130A}_install.log
Tim Edwards9134eed2021-02-13 14:42:59 -05001038 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001039
Tim Edwards8830dfe2021-02-25 11:29:59 -05001040uninstall:
1041 if test "x${DIST_PATH}" == "x" ; then \
1042 ${MAKE} uninstall-local ; \
1043 else \
1044 ${MAKE} uninstall-dist; \
1045 fi
1046
1047uninstall-local: uninstall-local-a
1048
1049uninstall-local-a:
1050 echo "Uninstalling SKY130 PDK from ${LOCAL_PATH}"
1051 if test "x${LOCAL_PATH}" != "x" ; then \
1052 ${RM} -rf ${LOCAL_PATH}/${SKY130A} ; \
1053 fi
1054 echo "Finished SKY130 PDK uninstall"
1055
1056uninstall-dist: uninstall-dist-a
1057
1058uninstall-dist-a:
1059 echo "Uninstalling SKY130 PDK from ${DIST_PATH}"
1060 if test "x${DIST_PATH}" != "x" ; then \
1061 ${RM} -rf ${DIST_PATH}/${SKY130A} ; \
1062 fi
1063 echo "Finished SKY130 PDK uninstall"
1064
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001065clean: clean-a
1066
1067clean-a:
1068 ${STAGE} -target ${STAGING_PATH}/${SKY130A} -clean
1069
1070veryclean: veryclean-a
1071
1072veryclean-a: clean-a
Tim Edwards9134eed2021-02-13 14:42:59 -05001073 ${RM} ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001074 ${RM} ${SKY130A}_install.log
Tim Edwards9134eed2021-02-13 14:42:59 -05001075 # Legacy name
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001076 ${RM} ${SKY130A}_migrate.log
Tim Edwards6ee11532021-02-11 12:29:33 -05001077