blob: 01aa7dd5cc33410f9004ae676111d56978ad6441 [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#
110# Run "make veryclean" to remove all staging and install log files.
111#
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}
225else
226 MAGICPATH = ${MAGICTOP}
227endif
228
Tim Edwards367711e2021-01-27 10:35:12 -0500229# Currently, netgen, qflow, irsim, and klayout do not use revisioning (needs to change!)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400230NETGENPATH = ${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500231IRSIMPATH = ${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400232QFLOWPATH = ${QFLOWTOP}
233KLAYOUTPATH = ${KLAYOUTTOP}
234OPENLANEPATH = ${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500235XSCHEMPATH = ${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500236XCIRCUITPATH = ${XCIRCUITTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400237
238MAGICTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICTOP}
239NETGENTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENTOP}
Tim Edwards367711e2021-01-27 10:35:12 -0500240IRSIMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400241QFLOWTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWTOP}
242KLAYOUTTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTTOP}
243OPENLANETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANETOP}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500244XSCHEMTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMTOP}
Tim Edwardse4c44092021-02-12 10:18:56 -0500245XCIRCUITTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITTOP}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400246
247MAGIC_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICPATH}
248NETGEN_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENPATH}
Tim Edwards367711e2021-01-27 10:35:12 -0500249IRSIM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${IRSIMPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400250QFLOW_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWPATH}
251KLAYOUT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTPATH}
252OPENLANE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANEPATH}
Tim Edwards1168a8b2021-02-10 22:06:54 -0500253XSCHEM_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XSCHEMPATH}
Tim Edwardse4c44092021-02-12 10:18:56 -0500254XCIRCUIT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${XCIRCUITPATH}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400255
256SKY130A_DEFS += -DMAGIC_CURRENT=${MAGICTOP}/current
257
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500258# Openlane has a number of files that are common to all digital
259# standard cell libraries, so these are collected in one definition
260# here:
agorararmard2ca46022021-02-11 21:43:51 +0200261OPENLANE_COMMON = config.tcl tracks.info no_synth.cells drc_exclude.cells
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500262OPENLANE_COMMON += tribuff_map.v latch_map.v mux2_map.v mux4_map.v fa_map.v rca_map.v
263
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400264# Where cpp syntax is followed, this is equivalent to cpp, but it does not
265# mangle non-C source files under the belief that they are actually C code.
266CPP = ../common/preproc.py
267
268# The following script in the ../common directory does most of the work of
269# copying or linking the foundry vendor files to the target directory.
270STAGE = set -f ; ../common/foundry_install.py ${EF_FORMAT}
271INSTALL = ../common/staging_install.py ${EF_FORMAT}
272
273# The script(s) below are used for custom changes to the vendor PDK files
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200274ADDPROP = ../common/insert_property.py ${EF_FORMAT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400275
276# List the EDA tools to install local setup files for
Tim Edwardsccaea722020-12-24 10:59:42 -0500277TOOLS =
278
279# KLAYOUT_DISABLED = 0 | 1
280KLAYOUT_DISABLED = @KLAYOUT_DISABLED@
281ifneq (${KLAYOUT_DISABLED}, 1)
282 TOOLS += klayout
283endif
284
285# OPENLANE_DISABLED = 0 | 1
286OPENLANE_DISABLED = @OPENLANE_DISABLED@
287ifneq (${OPENLANE_DISABLED}, 1)
288 TOOLS += openlane
289endif
290
291# QFLOW_DISABLED = 0 | 1
292QFLOW_DISABLED = @QFLOW_DISABLED@
293ifneq (${QFLOW_DISABLED}, 1)
294 TOOLS += qflow
295endif
296
297# MAGIC_DISABLED = 0 | 1
298MAGIC_DISABLED = @MAGIC_DISABLED@
299ifneq (${MAGIC_DISABLED}, 1)
300 TOOLS += magic
301endif
302
303# NETGEN_DISABLED = 0 | 1
304NETGEN_DISABLED = @NETGEN_DISABLED@
305ifneq (${NETGEN_DISABLED}, 1)
306 TOOLS += netgen
307endif
308
Tim Edwards367711e2021-01-27 10:35:12 -0500309# IRSIM_DISABLED = 0 | 1
310IRSIM_DISABLED = @IRSIM_DISABLED@
311ifneq (${IRSIM_DISABLED}, 1)
312 TOOLS += irsim
313endif
314
Tim Edwards1168a8b2021-02-10 22:06:54 -0500315# XSCHEM_DISABLED = 0 | 1
316XSCHEM_DISABLED = @XSCHEM_DISABLED@
317ifneq (${XSCHEM_DISABLED}, 1)
318 TOOLS += xschem
319endif
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400320
Tim Edwardse4c44092021-02-12 10:18:56 -0500321# XCIRCUIT_DISABLED = 0 | 1
322XCIRCUIT_DISABLED = @XCIRCUIT_DISABLED@
323ifneq (${XCIRCUIT_DISABLED}, 1)
324 TOOLS += xcircuit
325endif
326
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400327all: all-a
328
Tim Edwards6ee11532021-02-11 12:29:33 -0500329# Handle prerequisites (fetch and install the PDK and requested libraries)
330prerequisites: pdk-repo alpha-repo xschem-repo
331
332pdk-repo:
333 if test "x${SKYWATER_PATH}" != "x" ; then \
334 if test -d "${SKYWATER_PATH}" ; then \
335 echo "Using existing installation of SkyWater PDK from ${SKYWATER_PATH}" ; \
336 else \
337 echo "Downloading SkyWater PDK from ${PDK_URL}" ; \
338 custom/scripts/pdk_download.sh ${PDK_URL} ${SKYWATER_PATH} ; \
339 fi ; \
340 fi
341
342alpha-repo:
343 if test "x${ALPHA_PATH}" != "x" ; then \
344 if test -d "${ALPHA_PATH}" ; then \
345 echo "Using existing installation of alphanumeric library from ${ALPHA_PATH}" ; \
346 else \
347 echo "Downloading alphanumeric library from ${ALPHA_URL}" ; \
348 ../scripts/download.sh ${ALPHA_URL} ${ALPHA_PATH} ; \
349 fi ; \
350 fi
351
352xschem-repo:
353 if test "x${XSCHEM_PATH}" != "x" ; then \
354 if test -d "${XSCHEM_PATH}" ; then \
355 echo "Using existing installation of xschem setup from ${XSCHEM_PATH}" ; \
356 else \
357 echo "Downloading xschem setup from ${XSCHEM_URL}" ; \
358 ../scripts/download.sh ${XSCHEM_URL} ${XSCHEM_PATH} ; \
359 fi ; \
360 fi
361
362all-a: prerequisites
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400363 echo "Starting sky130A PDK staging on "`date` > ${SKY130A}_install.log
364 ${MAKE} tools-a
365 ${MAKE} vendor-a
366 echo "Ended sky130A PDK staging on "`date` >> ${SKY130A}_install.log
367
Tim Edwards942a14f2020-12-24 16:20:31 -0500368tools-a: $(addsuffix -a, $(TOOLS))
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400369
370general-a: ${TECH}.json
371 mkdir -p ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}
372 rm -f ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}/nodeinfo.json
373 ${CPP} ${SKY130A_DEFS} ${TECH}.json > \
374 ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}/nodeinfo.json
375
Tim Edwards5778c232020-07-07 16:57:52 -0400376magic-a: magic/${TECH}.tech magic/${TECH}gds.tech magic/${TECH}.magicrc magic/${TECH}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400377 mkdir -p ${MAGICTOP_STAGING_A}
378 mkdir -p ${MAGIC_STAGING_A}
379 rm -f ${MAGICTOP_STAGING_A}/current
380 rm -f ${MAGIC_STAGING_A}/${SKY130A}.tech
381 rm -f ${MAGIC_STAGING_A}/${SKY130A}-GDS.tech
382 rm -f ${MAGIC_STAGING_A}/${SKY130A}.tcl
383 rm -f ${MAGIC_STAGING_A}/${SKY130A}-BindKeys
384 rm -f ${MAGIC_STAGING_A}/magicrc
385 (cd ${MAGICTOP_STAGING_A} ; ln -s ${REV_DIR} current)
386 cp -rp custom/scripts/seal_ring_generator ${MAGIC_STAGING_A}/.
Tim Edwards4d081b82021-01-27 14:30:03 -0500387 cp -rp custom/scripts/bump_bond_generator ${MAGIC_STAGING_A}/.
Tim Edwards4d46bac2020-12-29 16:23:22 -0500388 cp custom/scripts/generate_fill.py ${MAGIC_STAGING_A}/.
Tim Edwards113b0832021-01-13 11:27:52 -0500389 cp custom/scripts/check_density.py ${MAGIC_STAGING_A}/.
Tim Edwards5778c232020-07-07 16:57:52 -0400390 ${CPP} ${SKY130A_DEFS} magic/${TECH}.tech > ${MAGIC_STAGING_A}/${SKY130A}.tech
391 ${CPP} ${SKY130A_DEFS} magic/${TECH}gds.tech > ${MAGIC_STAGING_A}/${SKY130A}-GDS.tech
392 ${CPP} ${SKY130A_DEFS} magic/${TECH}.magicrc > ${MAGIC_STAGING_A}/${SKY130A}.magicrc
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400393 ${CPP} ${SKY130A_DEFS} ../common/pdk.bindkeys > ${MAGIC_STAGING_A}/${SKY130A}-BindKeys
Tim Edwards5778c232020-07-07 16:57:52 -0400394 ${CPP} ${SKY130A_DEFS} magic/${TECH}.tcl > ${MAGIC_STAGING_A}/${SKY130A}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400395 ${CPP} ${SKY130A_DEFS} ../common/pdk.tcl >> ${MAGIC_STAGING_A}/${SKY130A}.tcl
396
Tim Edwards5778c232020-07-07 16:57:52 -0400397qflow-a: qflow/${TECH}.sh qflow/${TECH}.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400398 mkdir -p ${QFLOWTOP_STAGING_A}
399 mkdir -p ${QFLOW_STAGING_A}
400 rm -f ${QFLOW_STAGING_A}/${SKY130A}hd.sh
401 rm -f ${QFLOW_STAGING_A}/${SKY130A}hd.par
402 rm -f ${QFLOW_STAGING_A}/${SKY130A}hdll.sh
403 rm -f ${QFLOW_STAGING_A}/${SKY130A}hdll.par
404 rm -f ${QFLOW_STAGING_A}/${SKY130A}hs.sh
405 rm -f ${QFLOW_STAGING_A}/${SKY130A}hs.par
406 rm -f ${QFLOW_STAGING_A}/${SKY130A}hvl.sh
407 rm -f ${QFLOW_STAGING_A}/${SKY130A}hvl.par
408 rm -f ${QFLOW_STAGING_A}/${SKY130A}ls.sh
409 rm -f ${QFLOW_STAGING_A}/${SKY130A}ls.par
410 rm -f ${QFLOW_STAGING_A}/${SKY130A}lp.sh
411 rm -f ${QFLOW_STAGING_A}/${SKY130A}lp.par
412 rm -f ${QFLOW_STAGING_A}/${SKY130A}ms.sh
413 rm -f ${QFLOW_STAGING_A}/${SKY130A}ms.par
Tim Edwards7ec76972020-07-07 21:56:08 -0400414 rm -f ${QFLOW_STAGING_A}/${SKY130A}osu.sh
415 rm -f ${QFLOW_STAGING_A}/${SKY130A}osu.par
Tim Edwards5778c232020-07-07 16:57:52 -0400416 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hd qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400417 ${QFLOW_STAGING_A}/${SKY130A}hd.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400418 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hdll qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400419 ${QFLOW_STAGING_A}/${SKY130A}hdll.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400420 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hvl qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400421 ${QFLOW_STAGING_A}/${SKY130A}hvl.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400422 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hs qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400423 ${QFLOW_STAGING_A}/${SKY130A}hs.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400424 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_lp qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400425 ${QFLOW_STAGING_A}/${SKY130A}lp.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400426 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_ls qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400427 ${QFLOW_STAGING_A}/${SKY130A}ls.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400428 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_ms qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400429 ${QFLOW_STAGING_A}/${SKY130A}ms.sh
Tristan Gingolda5854312020-10-15 18:28:16 +0200430 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_osu_sc_t18 qflow/sky130osu.sh > \
Tim Edwards7ec76972020-07-07 21:56:08 -0400431 ${QFLOW_STAGING_A}/${SKY130A}osu.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400432 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}hd.par
433 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}hdll.par
434 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}hvl.par
435 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}hs.par
436 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}ms.par
437 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}lp.par
438 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}ls.par
439 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}osu.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400440
Tim Edwards5778c232020-07-07 16:57:52 -0400441netgen-a: netgen/${TECH}_setup.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400442 mkdir -p ${NETGENTOP_STAGING_A}
443 mkdir -p ${NETGEN_STAGING_A}
444 rm -f ${NETGEN_STAGING_A}/${SKY130A}_setup.tcl
445 rm -f ${NETGEN_STAGING_A}/setup.tcl
Tim Edwards5778c232020-07-07 16:57:52 -0400446 ${CPP} ${SKY130A_DEFS} netgen/${TECH}_setup.tcl > ${NETGEN_STAGING_A}/${SKY130A}_setup.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400447 (cd ${NETGEN_STAGING_A} ; ln -s ${SKY130A}_setup.tcl setup.tcl)
448
Tim Edwards1168a8b2021-02-10 22:06:54 -0500449irsim-a: irsim
Tim Edwards367711e2021-01-27 10:35:12 -0500450 mkdir -p ${IRSIMTOP_STAGING_A}
451 mkdir -p ${IRSIM_STAGING_A}
452 rm -f ${IRSIM_STAGING_A}/${SKY130A}_*.prm
453 cp irsim/${SKY130A}_*.prm ${IRSIM_STAGING_A}/
454
Tim Edwards5778c232020-07-07 16:57:52 -0400455klayout-a: klayout/${TECH}.lyp klayout/${TECH}.lyt
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400456 mkdir -p ${KLAYOUTTOP_STAGING_A}
457 mkdir -p ${KLAYOUT_STAGING_A}
458 rm -f ${KLAYOUT_STAGING_A}/${SKY130A}.lyp
459 rm -f ${KLAYOUT_STAGING_A}/${SKY130A}.lyt
Tim Edwards5778c232020-07-07 16:57:52 -0400460 ${CPP} ${SKY130A_DEFS} klayout/${TECH}.lyp > ${KLAYOUT_STAGING_A}/${SKY130A}.lyp
461 ${CPP} ${SKY130A_DEFS} klayout/${TECH}.lyt > ${KLAYOUT_STAGING_A}/${SKY130A}.lyt
agorararmard1a6ece52021-01-15 18:50:43 +0200462 cp klayout/${TECH}.lydrc ${KLAYOUT_STAGING_A}/${SKY130A}.lydrc
agorararmard22561582021-01-15 17:55:59 +0200463 ./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 -0400464
Tim Edwardse4c44092021-02-12 10:18:56 -0500465xcircuit-a: xcircuit/${TECH}.xcircuitrc
466 rm -rf ${XCIRCUIT_STAGING_A}
467 mkdir -p ${XCIRCUITTOP_STAGING_A}
468 mkdir -p ${XCIRCUIT_STAGING_A}
469 rm -f ${XCIRCUIT_STAGING_A}/*.lps
470 rm -f ${XCIRCUIT_STAGING_A}/${SKY130A}.xcircuitrc
471 ${CPP} xcircuit/sky130_fd_pr.lps > ${XCIRCUIT_STAGING_A}/sky130_fd_pr.lps
472 ${CPP} xcircuit/sky130_fd_sc_hd.lps > ${XCIRCUIT_STAGING_A}/sky130_fd_sc_hd.lps
473 ${CPP} xcircuit/ngspice.lps > ${XCIRCUIT_STAGING_A}/ngspice.lps
474 cp xcircuit/${TECH}_*.lps ${XCIRCUIT_STAGING_A}/
475 ${CPP} ${SKY130A_DEFS} xcircuit/${TECH}.xcircuitrc > ${XCIRCUIT_STAGING_A}/${SKY130A}.xcircuitrc
476
Tim Edwards1168a8b2021-02-10 22:06:54 -0500477xschem-a: ${XSCHEM_PATH}
478 rm -rf ${XSCHEM_STAGING_A}
479 mkdir -p ${XSCHEMTOP_STAGING_A}
480 mkdir -p ${XSCHEM_STAGING_A}
481 # Copy the entire repository (other than .git, if it exists)
482 if test "x${XSCHEM_PATH}" != "x" ; then \
483 cp -rp ${XSCHEM_PATH}/* ${XSCHEM_STAGING_A} ; \
484 fi
Tim Edwards9a17fca2021-02-11 17:44:04 -0500485 # Re-copy the xschemrc, with one change to add the PDK install path as
486 # a component of XSCHEM_LIBRARY_PATH
487 cat ${XSCHEM_PATH}/xschemrc | \
488 sed -e "/PWD/aappend XSCHEM_LIBRARY_PATH :${XSCHEM_STAGING_A}" | \
489 sed -e "/sky130_models.tcl/s#scripts#${XSCHEM_STAGING_A}/scripts#" \
490 > ${XSCHEM_STAGING_A}/xschemrc
Tim Edwards1168a8b2021-02-10 22:06:54 -0500491
Tristan Gingolda5854312020-10-15 18:28:16 +0200492openlane-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 -0400493 mkdir -p ${OPENLANETOP_STAGING_A}
494 mkdir -p ${OPENLANE_STAGING_A}
Tim Edwards3c1dd9a2020-11-27 13:49:58 -0500495 rm -rf ${OPENLANE_STAGING_A}/custom_cells/*
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400496 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hd
Tim Edwards5778c232020-07-07 16:57:52 -0400497 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hs
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200498 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_ls
499 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_ms
500 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll
501 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl
Tristan Gingolda5854312020-10-15 18:28:16 +0200502 mkdir -p ${OPENLANE_STAGING_A}/sky130_osu_sc_t18
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400503 rm -f ${OPENLANE_STAGING_A}/common_pdn.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400504 rm -f ${OPENLANE_STAGING_A}/config.tcl
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500505 for file in ${OPENLANE_COMMON} ; do \
506 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/$$file ; \
507 done
508 for file in ${OPENLANE_COMMON} ; do \
509 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/$$file ; \
510 done
511 for file in ${OPENLANE_COMMON} ; do \
512 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/$$file ; \
513 done
514 for file in ${OPENLANE_COMMON} ; do \
515 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/$$file ; \
516 done
517 for file in ${OPENLANE_COMMON} ; do \
518 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/$$file ; \
519 done
520 for file in ${OPENLANE_COMMON} ; do \
521 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/$$file ; \
522 done
523 for file in ${OPENLANE_COMMON} ; do \
524 rm -f ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/$$file ; \
525 done
526
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200527 cp -r openlane/custom_cells ${OPENLANE_STAGING_A}
Tim Edwards5778c232020-07-07 16:57:52 -0400528 ${CPP} ${SKY130A_DEFS} openlane/common_pdn.tcl > ${OPENLANE_STAGING_A}/common_pdn.tcl
529 ${CPP} ${SKY130A_DEFS} openlane/config.tcl > ${OPENLANE_STAGING_A}/config.tcl
Tim Edwardsf8c7eb82021-02-10 09:07:54 -0500530
531 for file in ${OPENLANE_COMMON} ; do \
532 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hd/$$file > \
533 ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/$$file ; \
534 done
535 for file in ${OPENLANE_COMMON} ; do \
536 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hs/$$file > \
537 ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/$$file ; \
538 done
539 for file in ${OPENLANE_COMMON} ; do \
540 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ms/$$file > \
541 ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/$$file ; \
542 done
543 for file in ${OPENLANE_COMMON} ; do \
544 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ls/$$file > \
545 ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/$$file ; \
546 done
547 for file in ${OPENLANE_COMMON} ; do \
548 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hdll/$$file > \
549 ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/$$file ; \
550 done
551 for file in ${OPENLANE_COMMON} ; do \
552 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hvl/$$file > \
553 ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/$$file ; \
554 done
555
Tristan Gingolda5854312020-10-15 18:28:16 +0200556 ${CPP} ${SKY130A_DEFS} openlane/sky130_osu_sc_t18/config.tcl > ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/config.tcl
557 ${CPP} ${SKY130A_DEFS} openlane/sky130_osu_sc_t18/tracks.info > ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/tracks.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400558
559vendor-a:
agorararmard14a276b2020-10-07 20:40:48 +0200560 # Modify the LEF files to update hs and ms libraries
Tim Edwards106e38b2020-09-20 13:07:54 -0400561 # Install device subcircuits from vendor files
Tim Edwards6ee11532021-02-11 12:29:33 -0500562 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards995c1332020-09-25 15:33:58 -0400563 -ngspice sky130_fd_pr/latest/models/* \
564 filter=custom/scripts/rename_models.py \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400565 |& tee -a ${SKY130A}_install.log
566 # Install base device library from vendor files
Tim Edwards6ee11532021-02-11 12:29:33 -0500567 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards106e38b2020-09-20 13:07:54 -0400568 -gds %l/latest/cells/*/*.gds compile-only \
569 -cdl %l/latest/cells/*/*.cdl compile-only \
570 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwardsbfc82692020-09-20 21:33:08 -0400571 -spice %l/latest/cells/*/*.spice filter=custom/scripts/rename_cells.py \
Tim Edwards106e38b2020-09-20 13:07:54 -0400572 -library primitive sky130_fd_pr |& tee -a ${SKY130A}_install.log
Tim Edwardse60b4862020-11-23 16:56:52 -0500573 # Custom: Add "short" resistor model and subcircuit to the r+c models file
Tim Edwards42f79a32020-09-21 14:18:09 -0400574 cat ./custom/models/short.spice >> \
agorararmard3ee5f112021-02-03 19:49:09 +0200575 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -0500576 # Custom: Add diodes as subcircuits to the r+c models file
577 cat ./custom/models/diode.spice >> \
agorararmard3ee5f112021-02-03 19:49:09 +0200578 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -0500579
Ahmed Ghazy59370ab2020-10-29 02:04:45 +0200580 # Install custom additions to I/O pad library
581 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
582 -verilog %l/verilog/*.v \
583 -cdl %l/cdl/*.cdl \
584 -gds %l/gds/*.gds \
585 -lef %l/lef/*.lef compile-only rename=sky130_ef_io \
586 -library general sky130_fd_io |& tee -a ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400587 # Install SkyWater I/O pad library
Tim Edwards6ee11532021-02-11 12:29:33 -0500588 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards1134fbc2020-10-12 22:35:42 -0400589 -spice %l/latest/cells/*/*.spice compile-only \
590 sort=custom/scripts/sort_pdkfiles.py \
591 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
592 sort=custom/scripts/sort_pdkfiles.py \
593 -lef %l/latest/cells/*/*.magic.lef compile-only \
594 sort=custom/scripts/sort_pdkfiles.py \
595 -doc %l/latest/cells/*/*.pdf \
596 -lib %l/latest/timing/*.lib \
597 -gds %l/latest/cells/*/*.gds compile-only \
598 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards26ab4962021-01-03 14:22:54 -0500599 options=custom/scripts/sky130_fd_io_import.tcl \
Tim Edwards1134fbc2020-10-12 22:35:42 -0400600 -verilog %l/latest/cells/*/*.*.v \
601 -verilog %l/latest/cells/*/*.v exclude=*.*.v \
602 compile-only filter=custom/scripts/inc_verilog.py \
603 sort=custom/scripts/sort_pdkfiles.py \
604 -library general sky130_fd_io |& tee -a ${SKY130A}_install.log
605 # Remove the base verilog files which have already been included into
606 # the libraries
607 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_io/verilog/*.*.v
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200608 # Install custom additions to standard cell libraries
609 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
610 -gds %l/gds/*.gds \
611 -lef %l/lef/*.lef \
Tim Edwardsbb8ab292021-01-22 10:19:40 -0500612 -verilog %l/verilog/*.v \
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200613 -library digital sky130_fd_sc_hd |& tee -a ${SKY130A}_install.log
Tim Edwardsd14571f2021-01-06 14:49:27 -0500614 # Add a maskhint set for the GPIO pad .mag view to prevent problems writing
615 # when writing HVI to GDS during hierarchical adjustments.
616 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_io sky130_fd_io__top_gpiov2 \
617 "MASKHINTS_HVI 1346 17198 5828 19224 13700 1890 15920 2360 24 17522 1778 20612" -mag
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200618 # Install all SkyWater digital standard cells.
Tim Edwards6ee11532021-02-11 12:29:33 -0500619 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400620 -techlef %l/latest/tech/*.tlef \
621 -spice %l/latest/cells/*/*.spice compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400622 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400623 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400624 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards106e38b2020-09-20 13:07:54 -0400625 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400626 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400627 -doc %l/latest/cells/*/*.pdf \
628 -lib %l/latest/timing/*.lib \
629 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400630 sort=custom/scripts/sort_pdkfiles.py \
631 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
632 rename=primitives filter=custom/scripts/inc_verilog.py \
633 sort=custom/scripts/sort_pdkfiles.py \
634 -verilog %l/latest/cells/*/*.*.v \
635 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
636 compile-only filter=custom/scripts/inc_verilog.py \
637 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400638 -library digital sky130_fd_sc_hd \
639 -library digital sky130_fd_sc_hdll \
640 -library digital sky130_fd_sc_hvl \
641 -library digital sky130_fd_sc_hs \
642 -library digital sky130_fd_sc_ls \
643 -library digital sky130_fd_sc_ms \
644 -library digital sky130_fd_sc_lp |& tee -a ${SKY130A}_install.log
Tim Edwards16a9caa2021-01-08 13:10:06 -0500645 # Add a maskhint set for the tap cell .ag view to prevent problems writing
646 # when writing NSDM and PSDM to GDS during hierarchical adjustments.
647 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_sc_hd sky130_fd_sc_hd__tapvpwrvgnd_1 \
648 "MASKHINTS_PSDM 0 38 92 196" -mag
649 ${ADDPROP} ${STAGING_PATH}/${SKY130A} sky130_fd_sc_hd sky130_fd_sc_hd__tapvpwrvgnd_1 \
650 "MASKHINTS_NSDM 0 280 92 506" -mag
Tim Edwards995c1332020-09-25 15:33:58 -0400651 # Remove the base verilog files which have already been included into
652 # the libraries
653 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hd/verilog/*.*.v
654 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hdll/verilog/*.*.v
655 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hvl/verilog/*.*.v
656 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hs/verilog/*.*.v
657 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_ms/verilog/*.*.v
658 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_ls/verilog/*.*.v
659 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_lp/verilog/*.*.v
Ahmed Ghazy7875f1e2021-01-19 18:15:30 +0200660 # Apply extra PDK patches until they get fixed properly in the source
661 patch -p1 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hd/techlef \
662 < custom/patches/hd_minenclosed.squeaky.patch || true
663 patch -p1 -f -d ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hdll/techlef \
664 < custom/patches/hdll_minenclosed.squeaky.patch || true
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500665 # Install alphanumeric library.
Tim Edwards1168a8b2021-02-10 22:06:54 -0500666 ${STAGE} -source ${ALPHA_PATH}/.. -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards88bd42e2020-12-18 15:29:48 -0500667 -mag %l/mag/*.mag filter=custom/scripts/text2m5.py \
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500668 -library general sky130_ml_xx_hd |& tee -a ${SKY130A}_install.log
669 # Install text2mag.py script for alphanumeric library
670 mkdir -p ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_ml_xx_hd/scripts
671 cp custom/scripts/text2mag.py \
672 ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_ml_xx_hd/scripts
Tristan Gingolda5854312020-10-15 18:28:16 +0200673 # Install OSU digital standard cells.
Tim Edwards6ee11532021-02-11 12:29:33 -0500674 ${STAGE} -source ${SKYWATER_LIBS_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwardsbbab9f62020-11-02 10:12:20 -0500675 -techlef %l/latest/lef/sky130_osu_sc.tlef rename=sky130_osu_sc_t18.tlef \
Tristan Gingolda5854312020-10-15 18:28:16 +0200676 -cdl %l/latest/cdl/*.cdl ignore=topography compile-only \
677 -lef %l/latest/lef/*.lef compile-only \
678 -lib %l/latest/lib/*.lib \
679 -gds %l/latest/gds/*.gds compile-only \
680 -library digital sky130_osu_sc_t18 |& tee -a ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400681
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400682install:
Ahmed Ghazyf45cbf32020-08-08 17:11:53 +0200683 if test "x${DIST_PATH}" == "x" ; then \
684 ${MAKE} install-local ; \
685 else \
686 ${MAKE} install-dist; \
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400687 fi
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400688
689install-local: install-local-a
690
691install-local-a:
692 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_migrate.log
693 ${INSTALL} -source ${STAGING_PATH}/${SKY130A} \
694 -target ${LOCAL_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -0500695 -variable PDKPATH \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400696 -link_from ${LINK_TARGETS} |& tee -a ${SKY130A}_migrate.log
697 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_migrate.log
698
699install-dist: install-dist-a
700
701install-dist-a:
702 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_migrate.log
703 ${INSTALL} -source ${STAGING_PATH}/${SKY130A} \
704 -target ${DIST_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -0500705 -variable PDKPATH \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400706 -local ${LOCAL_PATH}/${SKY130A} \
707 -link_from ${DIST_LINK_TARGETS} |& tee -a ${SKY130A}_migrate.log
708 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_migrate.log
709
710clean: clean-a
711
712clean-a:
713 ${STAGE} -target ${STAGING_PATH}/${SKY130A} -clean
714
715veryclean: veryclean-a
716
717veryclean-a: clean-a
718 ${RM} ${SKY130A}_install.log
719 ${RM} ${SKY130A}_migrate.log
Tim Edwards6ee11532021-02-11 12:29:33 -0500720