blob: d49e141dda1f9e68e90142962e27d54eedc83944 [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#
81# --enable-alpha-lib[=<path>]
Tim Edwardsbcf59aa2020-12-17 16:55:13 -050082# If enabled, install the sky130_ml_xx_hd font library from
83# Paul Schulz on github. If not specified, then the font
84# library will be cloned from the git repository and installed.
Tim Edwards22fdb442020-12-02 12:40:03 -050085#
86# --enable-xschem[=<path>]
87# If enabled, install the Sky130 setup for the xschem schematic
88# editor. If <path> is specified, then the xschem setup is
89# expected to be found rooted at the given path. If not
90# specified, then the xschem setup will be cloned from the
91# repository and installed.
92#
Tim Edwards7cbaaba2020-08-05 12:19:18 -040093# The variables below are substituted from the configuration options:
94#
95# SKYWATER_PATH: points to vendor sources
Tim Edwards55f4d0e2020-07-05 15:41:02 -040096# EF_STYLE: 1 for efabless style, 0 otherwise
97# LINK_TARGETS: link back to source or link to 1st PDK when possible
98# DIST_PATH: install location for distributed install
99# LOCAL_PATH: install location for local install or runtime location
100# for distributed install
101#
102# Run "make" to stage the PDK for tool setup and vendor libraries
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400103#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400104# Run "make install" to install all staged files. The installation is
105# either local or distributed, depending on whether --with-sky130-dist-path
106# has been set when running configure.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400107#
108# Run "make clean" to remove all staging files.
109#
Tim Edwards9134eed2021-02-13 14:42:59 -0500110# Run "make veryclean" to remove all staging and make.log files.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400111#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400112# For the sake of simplicity, the "standard" installation can be done
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400113# with the usual
114#
115# make
116# make install
117# make clean
118#
119#--------------------------------------------------------------------
120# This Makefile contains bash-isms
121SHELL = bash
Tristan Gingolda5854312020-10-15 18:28:16 +0200122MV = mv
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400123
Tim Edwardsc3baf462020-11-16 12:40:24 -0500124REVISION = `git describe --long`
Tim Edwardsccaea722020-12-24 10:59:42 -0500125TECH = sky130
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400126
127# If EF_STYLE is set to 1, then efabless naming conventions are
128# used, otherwise the generic naming conventions are used.
129# Mainly, the hierarchy of library names and file types is reversed
130# (e.g., sky130_fd_sc_hd/lef vs. lef/sky130_fd_sc_hd).
131
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400132# EF_STYLE = 0 | 1
133EF_STYLE = @EF_STYLE@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400134
135# Normally it's fine to keep the staging path in a local directory,
136# although /tmp or a dedicated staging area are also fine, as long
137# as the install process can write to the path.
138
139STAGING_PATH = `pwd`
140
141# If LINK_TARGETS is set to "none", then files are copied
142# from the SkyWater sources to the target. If set to "source",
143# symbolic links are made in the target directories pointing
144# back to the SkyWater sources. If set to the name of another
145# PDK (e.g, "sky130A"), then symbolic links are made to the
146# same files in that PDK, where they exist, and are copied
147# from source, where they don't.
148
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400149# LINK_TARGETS = source | none | sky130A
150LINK_TARGETS = @SKY130_LINK_TARGETS@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400151
152# Paths:
153
agorararmard3ee5f112021-02-03 19:49:09 +0200154# Path to skywater_pdk
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400155SKYWATER_PATH = @SKY130_SOURCE_PATH@
Tim Edwards66e53e52021-01-24 21:21:36 -0500156ifneq ($(SKYWATER_PATH),)
Tim Edwards6ee11532021-02-11 12:29:33 -0500157 SKYWATER_LIBS_PATH = ${SKYWATER_PATH}/libraries
158else
159 SKYWATER_LIBS_PATH =
Tim Edwards66e53e52021-01-24 21:21:36 -0500160endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400161
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500162# Path to independent library sources (to be added to configuration options).
Tim Edwards1168a8b2021-02-10 22:06:54 -0500163ALPHA_PATH = @SKY130_ML_XX_HD_PATH@
164XSCHEM_PATH = @XSCHEM_SKY130_PATH@
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500165
Tim Edwards6ee11532021-02-11 12:29:33 -0500166PDK_URL = https://github.com/google/skywater-pdk
167ALPHA_URL = https://github.com/PaulSchulz/sky130_pshulz_xx_hd/archive/master.tar.gz
168XSCHEM_URL = https://github.com/StefanSchippers/xschem_sky130/archive/main.tar.gz
169
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400170# NOTE: Install destination is the git repository of the technology platform.
171# Once updated in git, the git project can be distributed to all hosts.
172#
173ifeq (${EF_STYLE}, 1)
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400174 LOCAL_PATH = @SKY130_LOCAL_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400175 CONFIG_DIR = .ef-config
176 REV_DIR = ${REVISION}
177else
178 # LOCAL_PATH = /usr/local/share/vlsi/SkyWater
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400179 LOCAL_PATH = @SKY130_LOCAL_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400180 CONFIG_DIR = .config
181 REV_DIR = .
182endif
183
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400184# DIST_PATH = ~/gits/ef-skywater-${TECH}
185DIST_PATH = @SKY130_DIST_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400186
187# EF process nodes created from the master sources
188SKY130A = sky130A
189
190ifeq (${LINK_TARGETS}, ${SKY130A})
191 DIST_LINK_TARGETS = ${LOCAL_PATH}/${LINK_TARGETS}
192else
193 DIST_LINK_TARGETS = ${LINK_TARGETS}
194endif
195
196# Basic definitions for each EF process node
197SKY130A_DEFS = -DTECHNAME=sky130A -DREVISION=${REVISION}
198
199# Module definitions for each process node
200# (Note that MOS is default and therefore not used anywhere)
Tim Edwards0a0272b2020-07-28 14:40:10 -0400201SKY130A_DEFS += -DMETAL5 -DMIM -DREDISTRIBUTION
202# SKY130A_DEFS += -DMETAL5 -DMIM
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400203
204# Add staging path
205SKY130A_DEFS += -DSTAGING_PATH=${STAGING_PATH}
206
207ifeq (${EF_STYLE}, 1)
208 EF_FORMAT = -ef_format
209 SKY130A_DEFS += -DEF_FORMAT
210else
211 EF_FORMAT = -std_format
212endif
213
214MAGICTOP = libs.tech/magic
215NETGENTOP = libs.tech/netgen
Tim Edwards367711e2021-01-27 10:35:12 -0500216IRSIMTOP = libs.tech/irsim
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400217QFLOWTOP = libs.tech/qflow
218KLAYOUTTOP = libs.tech/klayout
219OPENLANETOP = libs.tech/openlane
Tim Edwards1168a8b2021-02-10 22:06:54 -0500220XSCHEMTOP = libs.tech/xschem
Tim Edwardse4c44092021-02-12 10:18:56 -0500221XCIRCUITTOP = libs.tech/xcircuit
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400222
223ifeq (${EF_STYLE}, 1)
224 MAGICPATH = ${MAGICTOP}/${REVISION}
Tim Edwards9134eed2021-02-13 14:42:59 -0500225 MAGICCURRENT = ${MAGICTOP}/current
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400226else
227 MAGICPATH = ${MAGICTOP}
Tim Edwards9134eed2021-02-13 14:42:59 -0500228 MAGICCURRENT = ${MAGICTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400229endif
230
Tim Edwards367711e2021-01-27 10:35:12 -0500231# Currently, netgen, qflow, irsim, and klayout do not use revisioning (needs to change!)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400232NETGENPATH = ${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500233IRSIMPATH = ${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400234QFLOWPATH = ${QFLOWTOP}
235KLAYOUTPATH = ${KLAYOUTTOP}
236OPENLANEPATH = ${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500237XSCHEMPATH = ${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500238XCIRCUITPATH = ${XCIRCUITTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400239
240MAGICTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICTOP}
241NETGENTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500242IRSIMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400243QFLOWTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWTOP}
244KLAYOUTTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTTOP}
245OPENLANETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500246XSCHEMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500247XCIRCUITTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400248
249MAGIC_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICPATH}
250NETGEN_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENPATH}
Tim Edwards367711e2021-01-27 10:35:12 -0500251IRSIM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400252QFLOW_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWPATH}
253KLAYOUT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTPATH}
254OPENLANE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANEPATH}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500255XSCHEM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMPATH}
Tim Edwardse4c44092021-02-12 10:18:56 -0500256XCIRCUIT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400257
Tim Edwards9134eed2021-02-13 14:42:59 -0500258SKY130A_DEFS += -DMAGIC_CURRENT=${MAGICCURRENT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400259
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500260# Openlane has a number of files that are common to all digital
261# standard cell libraries, so these are collected in one definition
262# here:
agorararmard2ca46022021-02-11 21:43:51 +0200263OPENLANE_COMMON = config.tcl tracks.info no_synth.cells drc_exclude.cells
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500264OPENLANE_COMMON += tribuff_map.v latch_map.v mux2_map.v mux4_map.v fa_map.v rca_map.v
265
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400266# Where cpp syntax is followed, this is equivalent to cpp, but it does not
267# mangle non-C source files under the belief that they are actually C code.
268CPP = ../common/preproc.py
269
270# The following script in the ../common directory does most of the work of
271# copying or linking the foundry vendor files to the target directory.
272STAGE = set -f ; ../common/foundry_install.py ${EF_FORMAT}
273INSTALL = ../common/staging_install.py ${EF_FORMAT}
274
275# The script(s) below are used for custom changes to the vendor PDK files
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200276ADDPROP = ../common/insert_property.py ${EF_FORMAT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400277
278# List the EDA tools to install local setup files for
Tim Edwardsccaea722020-12-24 10:59:42 -0500279TOOLS =
280
281# KLAYOUT_DISABLED = 0 | 1
282KLAYOUT_DISABLED = @KLAYOUT_DISABLED@
283ifneq (${KLAYOUT_DISABLED}, 1)
284 TOOLS += klayout
285endif
286
287# OPENLANE_DISABLED = 0 | 1
288OPENLANE_DISABLED = @OPENLANE_DISABLED@
289ifneq (${OPENLANE_DISABLED}, 1)
290 TOOLS += openlane
291endif
292
293# QFLOW_DISABLED = 0 | 1
294QFLOW_DISABLED = @QFLOW_DISABLED@
295ifneq (${QFLOW_DISABLED}, 1)
296 TOOLS += qflow
297endif
298
299# MAGIC_DISABLED = 0 | 1
300MAGIC_DISABLED = @MAGIC_DISABLED@
301ifneq (${MAGIC_DISABLED}, 1)
302 TOOLS += magic
303endif
304
305# NETGEN_DISABLED = 0 | 1
306NETGEN_DISABLED = @NETGEN_DISABLED@
307ifneq (${NETGEN_DISABLED}, 1)
308 TOOLS += netgen
309endif
310
Tim Edwards367711e2021-01-27 10:35:12 -0500311# IRSIM_DISABLED = 0 | 1
312IRSIM_DISABLED = @IRSIM_DISABLED@
313ifneq (${IRSIM_DISABLED}, 1)
314 TOOLS += irsim
315endif
316
Tim Edwards1168a8b2021-02-10 22:06:54 -0500317# XSCHEM_DISABLED = 0 | 1
318XSCHEM_DISABLED = @XSCHEM_DISABLED@
319ifneq (${XSCHEM_DISABLED}, 1)
320 TOOLS += xschem
321endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400322
Tim Edwardse4c44092021-02-12 10:18:56 -0500323# XCIRCUIT_DISABLED = 0 | 1
324XCIRCUIT_DISABLED = @XCIRCUIT_DISABLED@
325ifneq (${XCIRCUIT_DISABLED}, 1)
326 TOOLS += xcircuit
327endif
328
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400329all: all-a
330
Tim Edwards6ee11532021-02-11 12:29:33 -0500331# Handle prerequisites (fetch and install the PDK and requested libraries)
332prerequisites: pdk-repo alpha-repo xschem-repo
333
334pdk-repo:
335 if test "x${SKYWATER_PATH}" != "x" ; then \
336 if test -d "${SKYWATER_PATH}" ; then \
337 echo "Using existing installation of SkyWater PDK from ${SKYWATER_PATH}" ; \
338 else \
339 echo "Downloading SkyWater PDK from ${PDK_URL}" ; \
340 custom/scripts/pdk_download.sh ${PDK_URL} ${SKYWATER_PATH} ; \
341 fi ; \
342 fi
343
344alpha-repo:
345 if test "x${ALPHA_PATH}" != "x" ; then \
346 if test -d "${ALPHA_PATH}" ; then \
347 echo "Using existing installation of alphanumeric library from ${ALPHA_PATH}" ; \
348 else \
349 echo "Downloading alphanumeric library from ${ALPHA_URL}" ; \
350 ../scripts/download.sh ${ALPHA_URL} ${ALPHA_PATH} ; \
351 fi ; \
352 fi
353
354xschem-repo:
355 if test "x${XSCHEM_PATH}" != "x" ; then \
356 if test -d "${XSCHEM_PATH}" ; then \
357 echo "Using existing installation of xschem setup from ${XSCHEM_PATH}" ; \
358 else \
359 echo "Downloading xschem setup from ${XSCHEM_URL}" ; \
360 ../scripts/download.sh ${XSCHEM_URL} ${XSCHEM_PATH} ; \
361 fi ; \
362 fi
363
364all-a: prerequisites
Tim Edwards9134eed2021-02-13 14:42:59 -0500365 echo "Starting sky130A PDK staging on "`date` > ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400366 ${MAKE} tools-a
367 ${MAKE} vendor-a
Tim Edwards9134eed2021-02-13 14:42:59 -0500368 echo "Ended sky130A PDK staging on "`date` >> ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400369
Tim Edwards942a14f2020-12-24 16:20:31 -0500370tools-a: $(addsuffix -a, $(TOOLS))
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400371
372general-a: ${TECH}.json
373 mkdir -p ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}
374 rm -f ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}/nodeinfo.json
Tim Edwards9134eed2021-02-13 14:42:59 -0500375 ${CPP} ${SKY130A_DEFS} ${TECH}.json \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400376 ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}/nodeinfo.json
377
Tim Edwards5778c232020-07-07 16:57:52 -0400378magic-a: magic/${TECH}.tech magic/${TECH}gds.tech magic/${TECH}.magicrc magic/${TECH}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400379 mkdir -p ${MAGICTOP_STAGING_A}
380 mkdir -p ${MAGIC_STAGING_A}
381 rm -f ${MAGICTOP_STAGING_A}/current
382 rm -f ${MAGIC_STAGING_A}/${SKY130A}.tech
383 rm -f ${MAGIC_STAGING_A}/${SKY130A}-GDS.tech
384 rm -f ${MAGIC_STAGING_A}/${SKY130A}.tcl
385 rm -f ${MAGIC_STAGING_A}/${SKY130A}-BindKeys
386 rm -f ${MAGIC_STAGING_A}/magicrc
Tim Edwards9134eed2021-02-13 14:42:59 -0500387 if "${EF_STYLE}" == "1" ; then \
388 (cd ${MAGICTOP_STAGING_A} ; ln -s ${REV_DIR} current) ; \
389 fi
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400390 cp -rp custom/scripts/seal_ring_generator ${MAGIC_STAGING_A}/.
Tim Edwards4d081b82021-01-27 14:30:03 -0500391 cp -rp custom/scripts/bump_bond_generator ${MAGIC_STAGING_A}/.
Tim Edwards4d46bac2020-12-29 16:23:22 -0500392 cp custom/scripts/generate_fill.py ${MAGIC_STAGING_A}/.
Tim Edwards113b0832021-01-13 11:27:52 -0500393 cp custom/scripts/check_density.py ${MAGIC_STAGING_A}/.
Tim Edwards9134eed2021-02-13 14:42:59 -0500394 ${CPP} ${SKY130A_DEFS} magic/${TECH}.tech ${MAGIC_STAGING_A}/${SKY130A}.tech
395 ${CPP} ${SKY130A_DEFS} magic/${TECH}gds.tech ${MAGIC_STAGING_A}/${SKY130A}-GDS.tech
396 ${CPP} ${SKY130A_DEFS} magic/${TECH}.magicrc ${MAGIC_STAGING_A}/${SKY130A}.magicrc
397 ${CPP} ${SKY130A_DEFS} ../common/pdk.bindkeys ${MAGIC_STAGING_A}/${SKY130A}-BindKeys
398 ${CPP} ${SKY130A_DEFS} magic/${TECH}.tcl ${MAGIC_STAGING_A}/${SKY130A}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400399 ${CPP} ${SKY130A_DEFS} ../common/pdk.tcl >> ${MAGIC_STAGING_A}/${SKY130A}.tcl
400
Tim Edwards5778c232020-07-07 16:57:52 -0400401qflow-a: qflow/${TECH}.sh qflow/${TECH}.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400402 mkdir -p ${QFLOWTOP_STAGING_A}
403 mkdir -p ${QFLOW_STAGING_A}
404 rm -f ${QFLOW_STAGING_A}/${SKY130A}hd.sh
405 rm -f ${QFLOW_STAGING_A}/${SKY130A}hd.par
406 rm -f ${QFLOW_STAGING_A}/${SKY130A}hdll.sh
407 rm -f ${QFLOW_STAGING_A}/${SKY130A}hdll.par
408 rm -f ${QFLOW_STAGING_A}/${SKY130A}hs.sh
409 rm -f ${QFLOW_STAGING_A}/${SKY130A}hs.par
410 rm -f ${QFLOW_STAGING_A}/${SKY130A}hvl.sh
411 rm -f ${QFLOW_STAGING_A}/${SKY130A}hvl.par
412 rm -f ${QFLOW_STAGING_A}/${SKY130A}ls.sh
413 rm -f ${QFLOW_STAGING_A}/${SKY130A}ls.par
414 rm -f ${QFLOW_STAGING_A}/${SKY130A}lp.sh
415 rm -f ${QFLOW_STAGING_A}/${SKY130A}lp.par
416 rm -f ${QFLOW_STAGING_A}/${SKY130A}ms.sh
417 rm -f ${QFLOW_STAGING_A}/${SKY130A}ms.par
Tim Edwards7ec76972020-07-07 21:56:08 -0400418 rm -f ${QFLOW_STAGING_A}/${SKY130A}osu.sh
419 rm -f ${QFLOW_STAGING_A}/${SKY130A}osu.par
Tim Edwards9134eed2021-02-13 14:42:59 -0500420 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hd qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400421 ${QFLOW_STAGING_A}/${SKY130A}hd.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500422 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hdll qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400423 ${QFLOW_STAGING_A}/${SKY130A}hdll.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500424 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hvl qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400425 ${QFLOW_STAGING_A}/${SKY130A}hvl.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500426 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hs qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400427 ${QFLOW_STAGING_A}/${SKY130A}hs.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500428 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_lp qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400429 ${QFLOW_STAGING_A}/${SKY130A}lp.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500430 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_ls qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400431 ${QFLOW_STAGING_A}/${SKY130A}ls.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500432 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_ms qflow/${TECH}.sh \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400433 ${QFLOW_STAGING_A}/${SKY130A}ms.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500434 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_osu_sc_t18 qflow/sky130osu.sh \
Tim Edwards7ec76972020-07-07 21:56:08 -0400435 ${QFLOW_STAGING_A}/${SKY130A}osu.sh
Tim Edwards9134eed2021-02-13 14:42:59 -0500436 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}hd.par
437 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}hdll.par
438 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}hvl.par
439 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}hs.par
440 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}ms.par
441 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}lp.par
442 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}ls.par
443 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par ${QFLOW_STAGING_A}/${SKY130A}osu.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400444
Tim Edwards5778c232020-07-07 16:57:52 -0400445netgen-a: netgen/${TECH}_setup.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400446 mkdir -p ${NETGENTOP_STAGING_A}
447 mkdir -p ${NETGEN_STAGING_A}
448 rm -f ${NETGEN_STAGING_A}/${SKY130A}_setup.tcl
449 rm -f ${NETGEN_STAGING_A}/setup.tcl
Tim Edwards9134eed2021-02-13 14:42:59 -0500450 ${CPP} ${SKY130A_DEFS} netgen/${TECH}_setup.tcl ${NETGEN_STAGING_A}/${SKY130A}_setup.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400451 (cd ${NETGEN_STAGING_A} ; ln -s ${SKY130A}_setup.tcl setup.tcl)
452
Tim Edwards1168a8b2021-02-10 22:06:54 -0500453irsim-a: irsim
Tim Edwards367711e2021-01-27 10:35:12 -0500454 mkdir -p ${IRSIMTOP_STAGING_A}
455 mkdir -p ${IRSIM_STAGING_A}
456 rm -f ${IRSIM_STAGING_A}/${SKY130A}_*.prm
457 cp irsim/${SKY130A}_*.prm ${IRSIM_STAGING_A}/
458
Tim Edwards5778c232020-07-07 16:57:52 -0400459klayout-a: klayout/${TECH}.lyp klayout/${TECH}.lyt
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400460 mkdir -p ${KLAYOUTTOP_STAGING_A}
461 mkdir -p ${KLAYOUT_STAGING_A}
462 rm -f ${KLAYOUT_STAGING_A}/${SKY130A}.lyp
463 rm -f ${KLAYOUT_STAGING_A}/${SKY130A}.lyt
Tim Edwards9134eed2021-02-13 14:42:59 -0500464 ${CPP} ${SKY130A_DEFS} klayout/${TECH}.lyp ${KLAYOUT_STAGING_A}/${SKY130A}.lyp
465 ${CPP} ${SKY130A_DEFS} klayout/${TECH}.lyt ${KLAYOUT_STAGING_A}/${SKY130A}.lyt
agorararmard1a6ece52021-01-15 18:50:43 +0200466 cp klayout/${TECH}.lydrc ${KLAYOUT_STAGING_A}/${SKY130A}.lydrc
agorararmard22561582021-01-15 17:55:59 +0200467 ./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 -0400468
Tim Edwardse4c44092021-02-12 10:18:56 -0500469xcircuit-a: xcircuit/${TECH}.xcircuitrc
470 rm -rf ${XCIRCUIT_STAGING_A}
471 mkdir -p ${XCIRCUITTOP_STAGING_A}
472 mkdir -p ${XCIRCUIT_STAGING_A}
473 rm -f ${XCIRCUIT_STAGING_A}/*.lps
474 rm -f ${XCIRCUIT_STAGING_A}/${SKY130A}.xcircuitrc
Tim Edwards9134eed2021-02-13 14:42:59 -0500475 ${CPP} ${SKY130A_DEFS} xcircuit/ngspice.lps ${XCIRCUIT_STAGING_A}/ngspice.lps
476 ${CPP} ${SKY130A_DEFS} xcircuit/sky130_fd_pr.lps ${XCIRCUIT_STAGING_A}/sky130_fd_pr.lps
477 ${CPP} ${SKY130A_DEFS} xcircuit/sky130_fd_sc_hd.lps ${XCIRCUIT_STAGING_A}/sky130_fd_sc_hd.lps
478 ${CPP} ${SKY130A_DEFS} xcircuit/${TECH}.xcircuitrc ${XCIRCUIT_STAGING_A}/${SKY130A}.xcircuitrc
Tim Edwardse4c44092021-02-12 10:18:56 -0500479
Tim Edwards1168a8b2021-02-10 22:06:54 -0500480xschem-a: ${XSCHEM_PATH}
481 rm -rf ${XSCHEM_STAGING_A}
482 mkdir -p ${XSCHEMTOP_STAGING_A}
483 mkdir -p ${XSCHEM_STAGING_A}
484 # Copy the entire repository (other than .git, if it exists)
485 if test "x${XSCHEM_PATH}" != "x" ; then \
486 cp -rp ${XSCHEM_PATH}/* ${XSCHEM_STAGING_A} ; \
487 fi
Tim Edwards9a17fca2021-02-11 17:44:04 -0500488 # Re-copy the xschemrc, with one change to add the PDK install path as
489 # a component of XSCHEM_LIBRARY_PATH
490 cat ${XSCHEM_PATH}/xschemrc | \
491 sed -e "/PWD/aappend XSCHEM_LIBRARY_PATH :${XSCHEM_STAGING_A}" | \
Tim Edwards9134eed2021-02-13 14:42:59 -0500492 sed -e "/sky130_models.tcl/s#scripts#${XSCHEM_STAGING_A}/scripts#" | \
493 sed -e "/netlist_dir/aset netlist_dir ." \
Tim Edwards9a17fca2021-02-11 17:44:04 -0500494 > ${XSCHEM_STAGING_A}/xschemrc
Tim Edwards1168a8b2021-02-10 22:06:54 -0500495
Tristan Gingolda5854312020-10-15 18:28:16 +0200496openlane-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 -0400497 mkdir -p ${OPENLANETOP_STAGING_A}
498 mkdir -p ${OPENLANE_STAGING_A}
Tim Edwards3c1dd9a2020-11-27 13:49:58 -0500499 rm -rf ${OPENLANE_STAGING_A}/custom_cells/*
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400500 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hd
Tim Edwards5778c232020-07-07 16:57:52 -0400501 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hs
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200502 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_ls
503 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_ms
504 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll
505 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl
Tristan Gingolda5854312020-10-15 18:28:16 +0200506 mkdir -p ${OPENLANE_STAGING_A}/sky130_osu_sc_t18
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400507 rm -f ${OPENLANE_STAGING_A}/common_pdn.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400508 rm -f ${OPENLANE_STAGING_A}/config.tcl
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500509 for file in ${OPENLANE_COMMON} ; do \
510 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/$$file ; \
511 done
512 for file in ${OPENLANE_COMMON} ; do \
513 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/$$file ; \
514 done
515 for file in ${OPENLANE_COMMON} ; do \
516 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/$$file ; \
517 done
518 for file in ${OPENLANE_COMMON} ; do \
519 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/$$file ; \
520 done
521 for file in ${OPENLANE_COMMON} ; do \
522 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/$$file ; \
523 done
524 for file in ${OPENLANE_COMMON} ; do \
525 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/$$file ; \
526 done
527 for file in ${OPENLANE_COMMON} ; do \
528 rm -f ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/$$file ; \
529 done
530
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200531 cp -r openlane/custom_cells ${OPENLANE_STAGING_A}
Tim Edwards9134eed2021-02-13 14:42:59 -0500532 ${CPP} ${SKY130A_DEFS} openlane/common_pdn.tcl ${OPENLANE_STAGING_A}/common_pdn.tcl
533 ${CPP} ${SKY130A_DEFS} openlane/config.tcl ${OPENLANE_STAGING_A}/config.tcl
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500534
535 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500536 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_hd/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500537 ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/$$file ; \
538 done
539 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500540 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_hs/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500541 ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/$$file ; \
542 done
543 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500544 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_ms/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500545 ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/$$file ; \
546 done
547 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500548 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_ls/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500549 ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/$$file ; \
550 done
551 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500552 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_hdll/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500553 ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/$$file ; \
554 done
555 for file in ${OPENLANE_COMMON} ; do \
Tim Edwards9134eed2021-02-13 14:42:59 -0500556 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_fd_sc_hvl/$$file \
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500557 ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/$$file ; \
558 done
559
Tim Edwards9134eed2021-02-13 14:42:59 -0500560 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_osu_sc_t18/config.tcl \
561 ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/config.tcl
562 ${CPP} -quiet ${SKY130A_DEFS} openlane/sky130_osu_sc_t18/tracks.info \
563 ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/tracks.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400564
565vendor-a:
agorararmard14a276b2020-10-07 20:40:48 +0200566 # Modify the LEF files to update hs and ms libraries
Tim Edwards106e38b2020-09-20 13:07:54 -0400567 # Install device subcircuits from vendor files
Tim Edwards6ee11532021-02-11 12:29:33 -0500568 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards995c1332020-09-25 15:33:58 -0400569 -ngspice sky130_fd_pr/latest/models/* \
570 filter=custom/scripts/rename_models.py \
Tim Edwards9134eed2021-02-13 14:42:59 -0500571 |& tee -a ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400572 # Install base device library from vendor files
Tim Edwards6ee11532021-02-11 12:29:33 -0500573 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards106e38b2020-09-20 13:07:54 -0400574 -gds %l/latest/cells/*/*.gds compile-only \
575 -cdl %l/latest/cells/*/*.cdl compile-only \
576 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwardsbfc82692020-09-20 21:33:08 -0400577 -spice %l/latest/cells/*/*.spice filter=custom/scripts/rename_cells.py \
Tim Edwards9134eed2021-02-13 14:42:59 -0500578 -library primitive sky130_fd_pr |& tee -a ${SKY130A}_make.log
Tim Edwardse60b4862020-11-23 16:56:52 -0500579 # Custom: Add "short" resistor model and subcircuit to the r+c models file
Tim Edwards42f79a32020-09-21 14:18:09 -0400580 cat ./custom/models/short.spice >> \
agorararmard3ee5f112021-02-03 19:49:09 +0200581 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -0500582 # Custom: Add diodes as subcircuits to the r+c models file
583 cat ./custom/models/diode.spice >> \
agorararmard3ee5f112021-02-03 19:49:09 +0200584 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -0500585
Tim Edwards9134eed2021-02-13 14:42:59 -0500586 # Custom: Patch the models to work around ngspice issue with the relative
587 # order of the "nf" and "mult" parameters.
588 patch -p1 -f -d ${STAGING_PATH}/${SKY130A} \
589 < custom/patches/sky130_fd_pr.patch \
590 |& tee -a ${SKY130A}_make.log || true
Ahmed Ghazy59370ab2020-10-29 02:04:45 +0200591 # Install custom additions to I/O pad library
592 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
593 -verilog %l/verilog/*.v \
594 -cdl %l/cdl/*.cdl \
595 -gds %l/gds/*.gds \
596 -lef %l/lef/*.lef compile-only rename=sky130_ef_io \
Tim Edwards9134eed2021-02-13 14:42:59 -0500597 -library general sky130_fd_io |& tee -a ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400598 # Install SkyWater I/O pad library
Tim Edwards6ee11532021-02-11 12:29:33 -0500599 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards1134fbc2020-10-12 22:35:42 -0400600 -spice %l/latest/cells/*/*.spice compile-only \
601 sort=custom/scripts/sort_pdkfiles.py \
602 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
603 sort=custom/scripts/sort_pdkfiles.py \
604 -lef %l/latest/cells/*/*.magic.lef compile-only \
605 sort=custom/scripts/sort_pdkfiles.py \
606 -doc %l/latest/cells/*/*.pdf \
607 -lib %l/latest/timing/*.lib \
608 -gds %l/latest/cells/*/*.gds compile-only \
609 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards26ab4962021-01-03 14:22:54 -0500610 options=custom/scripts/sky130_fd_io_import.tcl \
Tim Edwards1134fbc2020-10-12 22:35:42 -0400611 -verilog %l/latest/cells/*/*.*.v \
612 -verilog %l/latest/cells/*/*.v exclude=*.*.v \
613 compile-only filter=custom/scripts/inc_verilog.py \
614 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards9134eed2021-02-13 14:42:59 -0500615 -library general sky130_fd_io |& tee -a ${SKY130A}_make.log
Tim Edwards1134fbc2020-10-12 22:35:42 -0400616 # Remove the base verilog files which have already been included into
617 # the libraries
618 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_io/verilog/*.*.v
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200619 # Install custom additions to standard cell libraries
620 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
621 -gds %l/gds/*.gds \
622 -lef %l/lef/*.lef \
Tim Edwardsbb8ab292021-01-22 10:19:40 -0500623 -verilog %l/verilog/*.v \
Tim Edwards9134eed2021-02-13 14:42:59 -0500624 -library digital sky130_fd_sc_hd |& tee -a ${SKY130A}_make.log
Tim Edwardsd14571f2021-01-06 14:49:27 -0500625 # Add a maskhint set for the GPIO pad .mag view to prevent problems writing
626 # when writing HVI to GDS during hierarchical adjustments.
627 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_io sky130_fd_io__top_gpiov2 \
628 "MASKHINTS_HVI 1346 17198 5828 19224 13700 1890 15920 2360 24 17522 1778 20612" -mag
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200629 # Install all SkyWater digital standard cells.
Tim Edwards6ee11532021-02-11 12:29:33 -0500630 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400631 -techlef %l/latest/tech/*.tlef \
632 -spice %l/latest/cells/*/*.spice compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400633 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400634 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400635 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards106e38b2020-09-20 13:07:54 -0400636 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400637 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400638 -doc %l/latest/cells/*/*.pdf \
639 -lib %l/latest/timing/*.lib \
640 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400641 sort=custom/scripts/sort_pdkfiles.py \
642 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
643 rename=primitives filter=custom/scripts/inc_verilog.py \
644 sort=custom/scripts/sort_pdkfiles.py \
645 -verilog %l/latest/cells/*/*.*.v \
646 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
647 compile-only filter=custom/scripts/inc_verilog.py \
648 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400649 -library digital sky130_fd_sc_hd \
650 -library digital sky130_fd_sc_hdll \
651 -library digital sky130_fd_sc_hvl \
652 -library digital sky130_fd_sc_hs \
653 -library digital sky130_fd_sc_ls \
654 -library digital sky130_fd_sc_ms \
Tim Edwards9134eed2021-02-13 14:42:59 -0500655 -library digital sky130_fd_sc_lp |& tee -a ${SKY130A}_make.log
Tim Edwards16a9caa2021-01-08 13:10:06 -0500656 # Add a maskhint set for the tap cell .ag view to prevent problems writing
657 # when writing NSDM and PSDM to GDS during hierarchical adjustments.
658 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_sc_hd sky130_fd_sc_hd__tapvpwrvgnd_1 \
659 "MASKHINTS_PSDM 0 38 92 196" -mag
660 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_sc_hd sky130_fd_sc_hd__tapvpwrvgnd_1 \
661 "MASKHINTS_NSDM 0 280 92 506" -mag
Tim Edwards995c1332020-09-25 15:33:58 -0400662 # Remove the base verilog files which have already been included into
663 # the libraries
664 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hd/verilog/*.*.v
665 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hdll/verilog/*.*.v
666 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hvl/verilog/*.*.v
667 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hs/verilog/*.*.v
668 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_ms/verilog/*.*.v
669 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_ls/verilog/*.*.v
670 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_lp/verilog/*.*.v
Ahmed Ghazy7875f1e2021-01-19 18:15:30 +0200671 # Apply extra PDK patches until they get fixed properly in the source
672 patch -p1 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hd/techlef \
Tim Edwards9134eed2021-02-13 14:42:59 -0500673 < custom/patches/hd_minenclosed.squeaky.patch \
674 |& tee -a ${SKY130A}_make.log || true
Ahmed Ghazy7875f1e2021-01-19 18:15:30 +0200675 patch -p1 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hdll/techlef \
Tim Edwards9134eed2021-02-13 14:42:59 -0500676 < custom/patches/hdll_minenclosed.squeaky.patch \
677 |& tee -a ${SKY130A}_make.log || true
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500678 # Install alphanumeric library.
Tim Edwards1168a8b2021-02-10 22:06:54 -0500679 ${STAGE} -source ${ALPHA_PATH}/.. -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards88bd42e2020-12-18 15:29:48 -0500680 -mag %l/mag/*.mag filter=custom/scripts/text2m5.py \
Tim Edwards9134eed2021-02-13 14:42:59 -0500681 -library general sky130_ml_xx_hd |& tee -a ${SKY130A}_make.log
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500682 # Install text2mag.py script for alphanumeric library
683 mkdir -p ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_ml_xx_hd/scripts
684 cp custom/scripts/text2mag.py \
685 ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_ml_xx_hd/scripts
Tristan Gingolda5854312020-10-15 18:28:16 +0200686 # Install OSU digital standard cells.
Tim Edwards6ee11532021-02-11 12:29:33 -0500687 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwardsbbab9f62020-11-02 10:12:20 -0500688 -techlef %l/latest/lef/sky130_osu_sc.tlef rename=sky130_osu_sc_t18.tlef \
Tristan Gingolda5854312020-10-15 18:28:16 +0200689 -cdl %l/latest/cdl/*.cdl ignore=topography compile-only \
690 -lef %l/latest/lef/*.lef compile-only \
691 -lib %l/latest/lib/*.lib \
692 -gds %l/latest/gds/*.gds compile-only \
Tim Edwards9134eed2021-02-13 14:42:59 -0500693 -library digital sky130_osu_sc_t18 |& tee -a ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400694
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400695install:
Ahmed Ghazyf45cbf32020-08-08 17:11:53 +0200696 if test "x${DIST_PATH}" == "x" ; then \
697 ${MAKE} install-local ; \
698 else \
699 ${MAKE} install-dist; \
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400700 fi
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400701
702install-local: install-local-a
703
704install-local-a:
Tim Edwards9134eed2021-02-13 14:42:59 -0500705 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400706 ${INSTALL} -source ${STAGING_PATH}/${SKY130A} \
707 -target ${LOCAL_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -0500708 -variable PDKPATH \
Tim Edwards9134eed2021-02-13 14:42:59 -0500709 -link_from ${LINK_TARGETS} |& tee -a ${SKY130A}_install.log
710 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400711
712install-dist: install-dist-a
713
714install-dist-a:
Tim Edwards9134eed2021-02-13 14:42:59 -0500715 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400716 ${INSTALL} -source ${STAGING_PATH}/${SKY130A} \
717 -target ${DIST_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -0500718 -variable PDKPATH \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400719 -local ${LOCAL_PATH}/${SKY130A} \
Tim Edwards9134eed2021-02-13 14:42:59 -0500720 -link_from ${DIST_LINK_TARGETS} |& tee -a ${SKY130A}_install.log
721 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400722
723clean: clean-a
724
725clean-a:
726 ${STAGE} -target ${STAGING_PATH}/${SKY130A} -clean
727
728veryclean: veryclean-a
729
730veryclean-a: clean-a
Tim Edwards9134eed2021-02-13 14:42:59 -0500731 ${RM} ${SKY130A}_make.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400732 ${RM} ${SKY130A}_install.log
Tim Edwards9134eed2021-02-13 14:42:59 -0500733 # Legacy name
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400734 ${RM} ${SKY130A}_migrate.log
Tim Edwards6ee11532021-02-11 12:29:33 -0500735