blob: 9092a376bd7646cc06fc7bdd088c0c23d6f69de9 [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 Edwards7cbaaba2020-08-05 12:19:18 -040017# --with-sky130-local-path=<path>
18# where <path> is the run-time location of the installed PDK
19# files generated by open_pdks. This option is mandatory and
20# has no default.
21#
22# --with-sky130-dist-path=<path>
23# where <path> is the install-time location of the installed
24# PDK files generated by open_pdks, with the expectation that
25# <path> is something like a git repository that is then
26# distributed across a system. If this option is not specified,
27# then files are installed to the local path.
28#
29# --with-sky130-link-targets=<value>
30# where <value> is one of "none" or "source". If set to "source",
31# then where possible, the installed files are symbolic links
32# back to the source, rather than copies of the source. The
33# default value is "none" if the option is not specified.
34#
35# --with-ef-style
36# If specified, then the installation uses the efabless style,
37# which swaps the file hierarchy of file formats vs. IP libraries;
38# e.g., "gds/sky130_fd_sc_hd/" with ef-style, vs.
39# "sky130_fd_sc_hd/gds/" without it.
40#
Tim Edwards22fdb442020-12-02 12:40:03 -050041# Note that the following is deprecated but kept for backwards compatibility.
42# It is equivalent to "--enable-skywater-pdk=<path>" (see below).
43#
44# --with-sky130-source-path=<path>
45# where <path> is the location of the Google/Skywater repository
46# cloned from https://github.com/google/skywater-pdk. This
47# option is mandatory and has no default.
48#
Tim Edwards22fdb442020-12-02 12:40:03 -050049# Enable/disable for specific libraries to be installed (and downloaded if
50# needed). Libraries that are part of the open_pdks repository are enabled
51# by default and must be disabled by passing an option to configure. Libraries
52# that are not part of the open_pdks repository are disabled by default and
53# must be enabled by passing an option to configure.
54#
55# Internal libraries and tool setups that can be disabled are the following:
56#
57# --disable-magic
58# Do not install setup files for the magic layout tool.
59#
60# --disable-netgen
61# Do not install setup files for the netgen LVS tool.
62#
63# --disable-qflow
64# Do not install setup files for the qflow synthesis flow.
65#
66# --disable-openlane
67# Do not install setup files for the openlane sythesis flow.
68#
69# --disable-klayout
70# Do not install setup files for the klayout layout tool.
71#
Tim Edwardsccaea722020-12-24 10:59:42 -050072#
73# NOTE: The comments below are for features that have not yet been
74# implemented.
75#
Tim Edwards22fdb442020-12-02 12:40:03 -050076# External libraries and tool setups that can be enabled are the following:
77#
78# --enable-skywater-pdk[=<path>]
79# If enabled, install the skywater PDK. If <path> is specified,
80# then the skywater PDK is expected to be found rooted at the
81# given path. If not specified, then the skywater PDK will be
82# cloned from the git repository and installed.
83#
84# --enable-osu-lib[=<path>]
85# If enabled, install the OSU standard cell library. If <path>
86# is specified, then the OSU standard cell library is expected
87# to be found rooted at the given path. If not specified, then
88# the OSU standard cell library will be cloned from the git
89# repository and installed.
90#
91# --enable-alpha-lib[=<path>]
Tim Edwardsbcf59aa2020-12-17 16:55:13 -050092# If enabled, install the sky130_ml_xx_hd font library from
93# Paul Schulz on github. If not specified, then the font
94# library will be cloned from the git repository and installed.
Tim Edwards22fdb442020-12-02 12:40:03 -050095#
96# --enable-xschem[=<path>]
97# If enabled, install the Sky130 setup for the xschem schematic
98# editor. If <path> is specified, then the xschem setup is
99# expected to be found rooted at the given path. If not
100# specified, then the xschem setup will be cloned from the
101# repository and installed.
102#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400103# The variables below are substituted from the configuration options:
104#
105# SKYWATER_PATH: points to vendor sources
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400106# EF_STYLE: 1 for efabless style, 0 otherwise
107# LINK_TARGETS: link back to source or link to 1st PDK when possible
108# DIST_PATH: install location for distributed install
109# LOCAL_PATH: install location for local install or runtime location
110# for distributed install
111#
112# Run "make" to stage the PDK for tool setup and vendor libraries
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400113#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400114# Run "make install" to install all staged files. The installation is
115# either local or distributed, depending on whether --with-sky130-dist-path
116# has been set when running configure.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400117#
118# Run "make clean" to remove all staging files.
119#
120# Run "make veryclean" to remove all staging and install log files.
121#
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400122# For the sake of simplicity, the "standard" installation can be done
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400123# with the usual
124#
125# make
126# make install
127# make clean
128#
129#--------------------------------------------------------------------
130# This Makefile contains bash-isms
131SHELL = bash
Tristan Gingolda5854312020-10-15 18:28:16 +0200132MV = mv
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400133
Tim Edwardsc3baf462020-11-16 12:40:24 -0500134REVISION = `git describe --long`
Tim Edwardsccaea722020-12-24 10:59:42 -0500135TECH = sky130
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400136
137# If EF_STYLE is set to 1, then efabless naming conventions are
138# used, otherwise the generic naming conventions are used.
139# Mainly, the hierarchy of library names and file types is reversed
140# (e.g., sky130_fd_sc_hd/lef vs. lef/sky130_fd_sc_hd).
141
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400142# EF_STYLE = 0 | 1
143EF_STYLE = @EF_STYLE@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400144
145# Normally it's fine to keep the staging path in a local directory,
146# although /tmp or a dedicated staging area are also fine, as long
147# as the install process can write to the path.
148
149STAGING_PATH = `pwd`
150
151# If LINK_TARGETS is set to "none", then files are copied
152# from the SkyWater sources to the target. If set to "source",
153# symbolic links are made in the target directories pointing
154# back to the SkyWater sources. If set to the name of another
155# PDK (e.g, "sky130A"), then symbolic links are made to the
156# same files in that PDK, where they exist, and are copied
157# from source, where they don't.
158
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400159# LINK_TARGETS = source | none | sky130A
160LINK_TARGETS = @SKY130_LINK_TARGETS@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400161
162# Paths:
163
164# Path to skywater_pdk (to be changed to public repo; work in progress)
165# Version below comes from foss-eda-tools.googlesource.com
166# SKYWATER_PATH = ~/gits/skywater-pdk-scratch/skywater-pdk/libraries
167# Version below is also from foss-eda-tools and is more recent than
168# the scratch repo above.
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400169SKYWATER_PATH = @SKY130_SOURCE_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400170
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400171# Path to OSU standard cell library sources (to be added to configuration options).
Tim Edwards31a2adf2020-07-07 21:47:30 -0400172OSU_PATH = ~/gits/osu_130_pdk
173
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500174# Path to independent library sources (to be added to configuration options).
175REPO_PATH = ~/gits
176
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400177# NOTE: Install destination is the git repository of the technology platform.
178# Once updated in git, the git project can be distributed to all hosts.
179#
180ifeq (${EF_STYLE}, 1)
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400181 LOCAL_PATH = @SKY130_LOCAL_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400182 CONFIG_DIR = .ef-config
183 REV_DIR = ${REVISION}
184else
185 # LOCAL_PATH = /usr/local/share/vlsi/SkyWater
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400186 LOCAL_PATH = @SKY130_LOCAL_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400187 CONFIG_DIR = .config
188 REV_DIR = .
189endif
190
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400191# DIST_PATH = ~/gits/ef-skywater-${TECH}
192DIST_PATH = @SKY130_DIST_PATH@
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400193
194# EF process nodes created from the master sources
195SKY130A = sky130A
196
197ifeq (${LINK_TARGETS}, ${SKY130A})
198 DIST_LINK_TARGETS = ${LOCAL_PATH}/${LINK_TARGETS}
199else
200 DIST_LINK_TARGETS = ${LINK_TARGETS}
201endif
202
203# Basic definitions for each EF process node
204SKY130A_DEFS = -DTECHNAME=sky130A -DREVISION=${REVISION}
205
206# Module definitions for each process node
207# (Note that MOS is default and therefore not used anywhere)
Tim Edwards0a0272b2020-07-28 14:40:10 -0400208SKY130A_DEFS += -DMETAL5 -DMIM -DREDISTRIBUTION
209# SKY130A_DEFS += -DMETAL5 -DMIM
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400210
211# Add staging path
212SKY130A_DEFS += -DSTAGING_PATH=${STAGING_PATH}
213
214ifeq (${EF_STYLE}, 1)
215 EF_FORMAT = -ef_format
216 SKY130A_DEFS += -DEF_FORMAT
217else
218 EF_FORMAT = -std_format
219endif
220
221MAGICTOP = libs.tech/magic
222NETGENTOP = libs.tech/netgen
223QFLOWTOP = libs.tech/qflow
224KLAYOUTTOP = libs.tech/klayout
225OPENLANETOP = libs.tech/openlane
226
227ifeq (${EF_STYLE}, 1)
228 MAGICPATH = ${MAGICTOP}/${REVISION}
229else
230 MAGICPATH = ${MAGICTOP}
231endif
232
233# Currently, netgen, qflow, and klayout do not use revisioning (needs to change!)
234NETGENPATH = ${NETGENTOP}
235QFLOWPATH = ${QFLOWTOP}
236KLAYOUTPATH = ${KLAYOUTTOP}
237OPENLANEPATH = ${OPENLANETOP}
238
239MAGICTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICTOP}
240NETGENTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENTOP}
241QFLOWTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWTOP}
242KLAYOUTTOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTTOP}
243OPENLANETOP_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANETOP}
244
245MAGIC_STAGING_A = ${STAGING_PATH}/${SKY130A}/${MAGICPATH}
246NETGEN_STAGING_A = ${STAGING_PATH}/${SKY130A}/${NETGENPATH}
247QFLOW_STAGING_A = ${STAGING_PATH}/${SKY130A}/${QFLOWPATH}
248KLAYOUT_STAGING_A = ${STAGING_PATH}/${SKY130A}/${KLAYOUTPATH}
249OPENLANE_STAGING_A = ${STAGING_PATH}/${SKY130A}/${OPENLANEPATH}
250
251SKY130A_DEFS += -DMAGIC_CURRENT=${MAGICTOP}/current
252
253# Where cpp syntax is followed, this is equivalent to cpp, but it does not
254# mangle non-C source files under the belief that they are actually C code.
255CPP = ../common/preproc.py
256
257# The following script in the ../common directory does most of the work of
258# copying or linking the foundry vendor files to the target directory.
259STAGE = set -f ; ../common/foundry_install.py ${EF_FORMAT}
260INSTALL = ../common/staging_install.py ${EF_FORMAT}
261
262# The script(s) below are used for custom changes to the vendor PDK files
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200263ADDPROP = ../common/insert_property.py ${EF_FORMAT}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400264
265# List the EDA tools to install local setup files for
Tim Edwardsccaea722020-12-24 10:59:42 -0500266TOOLS =
267
268# KLAYOUT_DISABLED = 0 | 1
269KLAYOUT_DISABLED = @KLAYOUT_DISABLED@
270ifneq (${KLAYOUT_DISABLED}, 1)
271 TOOLS += klayout
272endif
273
274# OPENLANE_DISABLED = 0 | 1
275OPENLANE_DISABLED = @OPENLANE_DISABLED@
276ifneq (${OPENLANE_DISABLED}, 1)
277 TOOLS += openlane
278endif
279
280# QFLOW_DISABLED = 0 | 1
281QFLOW_DISABLED = @QFLOW_DISABLED@
282ifneq (${QFLOW_DISABLED}, 1)
283 TOOLS += qflow
284endif
285
286# MAGIC_DISABLED = 0 | 1
287MAGIC_DISABLED = @MAGIC_DISABLED@
288ifneq (${MAGIC_DISABLED}, 1)
289 TOOLS += magic
290endif
291
292# NETGEN_DISABLED = 0 | 1
293NETGEN_DISABLED = @NETGEN_DISABLED@
294ifneq (${NETGEN_DISABLED}, 1)
295 TOOLS += netgen
296endif
297
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400298
299all: all-a
300
301all-a:
302 echo "Starting sky130A PDK staging on "`date` > ${SKY130A}_install.log
303 ${MAKE} tools-a
304 ${MAKE} vendor-a
305 echo "Ended sky130A PDK staging on "`date` >> ${SKY130A}_install.log
306
307tools-a: general-a magic-a qflow-a netgen-a klayout-a openlane-a
308
309general-a: ${TECH}.json
310 mkdir -p ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}
311 rm -f ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}/nodeinfo.json
312 ${CPP} ${SKY130A_DEFS} ${TECH}.json > \
313 ${STAGING_PATH}/${SKY130A}/${CONFIG_DIR}/nodeinfo.json
314
Tim Edwards5778c232020-07-07 16:57:52 -0400315magic-a: magic/${TECH}.tech magic/${TECH}gds.tech magic/${TECH}.magicrc magic/${TECH}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400316 mkdir -p ${MAGICTOP_STAGING_A}
317 mkdir -p ${MAGIC_STAGING_A}
318 rm -f ${MAGICTOP_STAGING_A}/current
319 rm -f ${MAGIC_STAGING_A}/${SKY130A}.tech
320 rm -f ${MAGIC_STAGING_A}/${SKY130A}-GDS.tech
321 rm -f ${MAGIC_STAGING_A}/${SKY130A}.tcl
322 rm -f ${MAGIC_STAGING_A}/${SKY130A}-BindKeys
323 rm -f ${MAGIC_STAGING_A}/magicrc
324 (cd ${MAGICTOP_STAGING_A} ; ln -s ${REV_DIR} current)
325 cp -rp custom/scripts/seal_ring_generator ${MAGIC_STAGING_A}/.
Tim Edwards5778c232020-07-07 16:57:52 -0400326 ${CPP} ${SKY130A_DEFS} magic/${TECH}.tech > ${MAGIC_STAGING_A}/${SKY130A}.tech
327 ${CPP} ${SKY130A_DEFS} magic/${TECH}gds.tech > ${MAGIC_STAGING_A}/${SKY130A}-GDS.tech
328 ${CPP} ${SKY130A_DEFS} magic/${TECH}.magicrc > ${MAGIC_STAGING_A}/${SKY130A}.magicrc
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400329 ${CPP} ${SKY130A_DEFS} ../common/pdk.bindkeys > ${MAGIC_STAGING_A}/${SKY130A}-BindKeys
Tim Edwards5778c232020-07-07 16:57:52 -0400330 ${CPP} ${SKY130A_DEFS} magic/${TECH}.tcl > ${MAGIC_STAGING_A}/${SKY130A}.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400331 ${CPP} ${SKY130A_DEFS} ../common/pdk.tcl >> ${MAGIC_STAGING_A}/${SKY130A}.tcl
332
Tim Edwards5778c232020-07-07 16:57:52 -0400333qflow-a: qflow/${TECH}.sh qflow/${TECH}.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400334 mkdir -p ${QFLOWTOP_STAGING_A}
335 mkdir -p ${QFLOW_STAGING_A}
336 rm -f ${QFLOW_STAGING_A}/${SKY130A}hd.sh
337 rm -f ${QFLOW_STAGING_A}/${SKY130A}hd.par
338 rm -f ${QFLOW_STAGING_A}/${SKY130A}hdll.sh
339 rm -f ${QFLOW_STAGING_A}/${SKY130A}hdll.par
340 rm -f ${QFLOW_STAGING_A}/${SKY130A}hs.sh
341 rm -f ${QFLOW_STAGING_A}/${SKY130A}hs.par
342 rm -f ${QFLOW_STAGING_A}/${SKY130A}hvl.sh
343 rm -f ${QFLOW_STAGING_A}/${SKY130A}hvl.par
344 rm -f ${QFLOW_STAGING_A}/${SKY130A}ls.sh
345 rm -f ${QFLOW_STAGING_A}/${SKY130A}ls.par
346 rm -f ${QFLOW_STAGING_A}/${SKY130A}lp.sh
347 rm -f ${QFLOW_STAGING_A}/${SKY130A}lp.par
348 rm -f ${QFLOW_STAGING_A}/${SKY130A}ms.sh
349 rm -f ${QFLOW_STAGING_A}/${SKY130A}ms.par
Tim Edwards7ec76972020-07-07 21:56:08 -0400350 rm -f ${QFLOW_STAGING_A}/${SKY130A}osu.sh
351 rm -f ${QFLOW_STAGING_A}/${SKY130A}osu.par
Tim Edwards5778c232020-07-07 16:57:52 -0400352 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hd qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400353 ${QFLOW_STAGING_A}/${SKY130A}hd.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400354 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hdll qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400355 ${QFLOW_STAGING_A}/${SKY130A}hdll.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400356 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hvl qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400357 ${QFLOW_STAGING_A}/${SKY130A}hvl.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400358 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_hs qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400359 ${QFLOW_STAGING_A}/${SKY130A}hs.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400360 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_lp qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400361 ${QFLOW_STAGING_A}/${SKY130A}lp.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400362 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_ls qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400363 ${QFLOW_STAGING_A}/${SKY130A}ls.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400364 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_fd_sc_ms qflow/${TECH}.sh > \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400365 ${QFLOW_STAGING_A}/${SKY130A}ms.sh
Tristan Gingolda5854312020-10-15 18:28:16 +0200366 ${CPP} ${SKY130A_DEFS} -DLIBRARY=sky130_osu_sc_t18 qflow/sky130osu.sh > \
Tim Edwards7ec76972020-07-07 21:56:08 -0400367 ${QFLOW_STAGING_A}/${SKY130A}osu.sh
Tim Edwards5778c232020-07-07 16:57:52 -0400368 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}hd.par
369 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}hdll.par
370 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}hvl.par
371 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}hs.par
372 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}ms.par
373 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}lp.par
374 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}ls.par
375 ${CPP} ${SKY130A_DEFS} qflow/${TECH}.par > ${QFLOW_STAGING_A}/${SKY130A}osu.par
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400376
Tim Edwards5778c232020-07-07 16:57:52 -0400377netgen-a: netgen/${TECH}_setup.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400378 mkdir -p ${NETGENTOP_STAGING_A}
379 mkdir -p ${NETGEN_STAGING_A}
380 rm -f ${NETGEN_STAGING_A}/${SKY130A}_setup.tcl
381 rm -f ${NETGEN_STAGING_A}/setup.tcl
Tim Edwards5778c232020-07-07 16:57:52 -0400382 ${CPP} ${SKY130A_DEFS} netgen/${TECH}_setup.tcl > ${NETGEN_STAGING_A}/${SKY130A}_setup.tcl
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400383 (cd ${NETGEN_STAGING_A} ; ln -s ${SKY130A}_setup.tcl setup.tcl)
384
Tim Edwards5778c232020-07-07 16:57:52 -0400385klayout-a: klayout/${TECH}.lyp klayout/${TECH}.lyt
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400386 mkdir -p ${KLAYOUTTOP_STAGING_A}
387 mkdir -p ${KLAYOUT_STAGING_A}
388 rm -f ${KLAYOUT_STAGING_A}/${SKY130A}.lyp
389 rm -f ${KLAYOUT_STAGING_A}/${SKY130A}.lyt
Tim Edwards5778c232020-07-07 16:57:52 -0400390 ${CPP} ${SKY130A_DEFS} klayout/${TECH}.lyp > ${KLAYOUT_STAGING_A}/${SKY130A}.lyp
391 ${CPP} ${SKY130A_DEFS} klayout/${TECH}.lyt > ${KLAYOUT_STAGING_A}/${SKY130A}.lyt
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400392
Tristan Gingolda5854312020-10-15 18:28:16 +0200393openlane-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 -0400394 mkdir -p ${OPENLANETOP_STAGING_A}
395 mkdir -p ${OPENLANE_STAGING_A}
Tim Edwards3c1dd9a2020-11-27 13:49:58 -0500396 rm -rf ${OPENLANE_STAGING_A}/custom_cells/*
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400397 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hd
Tim Edwards5778c232020-07-07 16:57:52 -0400398 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hs
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200399 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_ls
400 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_ms
401 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll
402 mkdir -p ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl
Tristan Gingolda5854312020-10-15 18:28:16 +0200403 mkdir -p ${OPENLANE_STAGING_A}/sky130_osu_sc_t18
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400404 rm -f ${OPENLANE_STAGING_A}/common_pdn.info
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400405 rm -f ${OPENLANE_STAGING_A}/config.tcl
406 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/config.tcl
Tim Edwards5778c232020-07-07 16:57:52 -0400407 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/tracks.info
408 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/no_synth.cells
Tim Edwards5778c232020-07-07 16:57:52 -0400409 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/config.tcl
410 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/tracks.info
411 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/no_synth.cells
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200412 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/config.tcl
413 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/tracks.info
414 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/no_synth.cells
415 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/config.tcl
416 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/tracks.info
417 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/no_synth.cells
418 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/config.tcl
419 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/tracks.info
420 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/no_synth.cells
421 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/config.tcl
422 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/tracks.info
423 rm -f ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/no_synth.cells
Tristan Gingolda5854312020-10-15 18:28:16 +0200424 rm -f ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/config.tcl
425 rm -f ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/tracks.info
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200426 cp -r openlane/custom_cells ${OPENLANE_STAGING_A}
Tim Edwards5778c232020-07-07 16:57:52 -0400427 ${CPP} ${SKY130A_DEFS} openlane/common_pdn.tcl > ${OPENLANE_STAGING_A}/common_pdn.tcl
428 ${CPP} ${SKY130A_DEFS} openlane/config.tcl > ${OPENLANE_STAGING_A}/config.tcl
429 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hd/config.tcl > ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/config.tcl
430 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hd/tracks.info > ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/tracks.info
431 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hd/no_synth.cells > ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/no_synth.cells
manarabdelatya6e75452020-11-30 19:12:12 +0200432 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hd/tribuff_map.v > ${OPENLANE_STAGING_A}/sky130_fd_sc_hd/tribuff_map.v
Tim Edwards5778c232020-07-07 16:57:52 -0400433 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hs/config.tcl > ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/config.tcl
434 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hs/tracks.info > ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/tracks.info
435 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hs/no_synth.cells > ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/no_synth.cells
manarabdelatyf2abe532020-12-01 13:24:40 +0200436 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hs/tribuff_map.v > ${OPENLANE_STAGING_A}/sky130_fd_sc_hs/tribuff_map.v
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200437 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ms/config.tcl > ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/config.tcl
438 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ms/tracks.info > ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/tracks.info
439 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ms/no_synth.cells > ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/no_synth.cells
manarabdelatyf2abe532020-12-01 13:24:40 +0200440 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ms/tribuff_map.v > ${OPENLANE_STAGING_A}/sky130_fd_sc_ms/tribuff_map.v
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200441 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ls/config.tcl > ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/config.tcl
442 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ls/tracks.info > ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/tracks.info
443 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ls/no_synth.cells > ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/no_synth.cells
manarabdelatyf2abe532020-12-01 13:24:40 +0200444 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_ls/tribuff_map.v > ${OPENLANE_STAGING_A}/sky130_fd_sc_ls/tribuff_map.v
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200445 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hdll/config.tcl > ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/config.tcl
446 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hdll/tracks.info > ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/tracks.info
447 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hdll/no_synth.cells > ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/no_synth.cells
manarabdelatyf2abe532020-12-01 13:24:40 +0200448 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hdll/tribuff_map.v > ${OPENLANE_STAGING_A}/sky130_fd_sc_hdll/tribuff_map.v
Ahmed Ghazy8e84e5c2020-07-27 14:32:34 +0200449 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hvl/config.tcl > ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/config.tcl
450 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hvl/tracks.info > ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/tracks.info
451 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hvl/no_synth.cells > ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/no_synth.cells
manarabdelatyf2abe532020-12-01 13:24:40 +0200452 ${CPP} ${SKY130A_DEFS} openlane/sky130_fd_sc_hvl/tribuff_map.v > ${OPENLANE_STAGING_A}/sky130_fd_sc_hvl/tribuff_map.v
Tristan Gingolda5854312020-10-15 18:28:16 +0200453 ${CPP} ${SKY130A_DEFS} openlane/sky130_osu_sc_t18/config.tcl > ${OPENLANE_STAGING_A}/sky130_osu_sc_t18/config.tcl
454 ${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 -0400455
456vendor-a:
agorararmard14a276b2020-10-07 20:40:48 +0200457 # Modify the LEF files to update hs and ms libraries
Tim Edwards106e38b2020-09-20 13:07:54 -0400458 # Install device subcircuits from vendor files
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400459 ${STAGE} -source ${SKYWATER_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards995c1332020-09-25 15:33:58 -0400460 -ngspice sky130_fd_pr/latest/models/* \
461 filter=custom/scripts/rename_models.py \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400462 |& tee -a ${SKY130A}_install.log
463 # Install base device library from vendor files
464 ${STAGE} -source ${SKYWATER_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards106e38b2020-09-20 13:07:54 -0400465 -gds %l/latest/cells/*/*.gds compile-only \
466 -cdl %l/latest/cells/*/*.cdl compile-only \
467 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwardsbfc82692020-09-20 21:33:08 -0400468 -spice %l/latest/cells/*/*.spice filter=custom/scripts/rename_cells.py \
Tim Edwards106e38b2020-09-20 13:07:54 -0400469 -library primitive sky130_fd_pr |& tee -a ${SKY130A}_install.log
Tim Edwardse60b4862020-11-23 16:56:52 -0500470 # Custom: Add "short" resistor model and subcircuit to the r+c models file
Tim Edwards42f79a32020-09-21 14:18:09 -0400471 cat ./custom/models/short.spice >> \
472 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
Tim Edwardse60b4862020-11-23 16:56:52 -0500473 # Custom: Add diodes as subcircuits to the r+c models file
474 cat ./custom/models/diode.spice >> \
475 ${STAGING_PATH}/${SKY130A}/libs.tech/ngspice/sky130_fd_pr__model__r+c.model.spice
476
Ahmed Ghazy59370ab2020-10-29 02:04:45 +0200477 # Install custom additions to I/O pad library
478 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
479 -verilog %l/verilog/*.v \
480 -cdl %l/cdl/*.cdl \
481 -gds %l/gds/*.gds \
482 -lef %l/lef/*.lef compile-only rename=sky130_ef_io \
483 -library general sky130_fd_io |& tee -a ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400484 # Install SkyWater I/O pad library
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400485 ${STAGE} -source ${SKYWATER_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards1134fbc2020-10-12 22:35:42 -0400486 -spice %l/latest/cells/*/*.spice compile-only \
487 sort=custom/scripts/sort_pdkfiles.py \
488 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
489 sort=custom/scripts/sort_pdkfiles.py \
490 -lef %l/latest/cells/*/*.magic.lef compile-only \
491 sort=custom/scripts/sort_pdkfiles.py \
492 -doc %l/latest/cells/*/*.pdf \
493 -lib %l/latest/timing/*.lib \
494 -gds %l/latest/cells/*/*.gds compile-only \
495 sort=custom/scripts/sort_pdkfiles.py \
496 -verilog %l/latest/cells/*/*.*.v \
497 -verilog %l/latest/cells/*/*.v exclude=*.*.v \
498 compile-only filter=custom/scripts/inc_verilog.py \
499 sort=custom/scripts/sort_pdkfiles.py \
500 -library general sky130_fd_io |& tee -a ${SKY130A}_install.log
501 # Remove the base verilog files which have already been included into
502 # the libraries
503 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_io/verilog/*.*.v
Ahmed Ghazy5fd61d22020-11-24 21:44:28 +0200504 # Install custom additions to standard cell libraries
505 ${STAGE} -source ./custom -target ${STAGING_PATH}/${SKY130A} \
506 -gds %l/gds/*.gds \
507 -lef %l/lef/*.lef \
508 -library digital sky130_fd_sc_hd |& tee -a ${SKY130A}_install.log
Ahmed Ghazya285ff42020-07-27 17:52:14 +0200509 # Install all SkyWater digital standard cells.
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400510 ${STAGE} -source ${SKYWATER_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400511 -techlef %l/latest/tech/*.tlef \
512 -spice %l/latest/cells/*/*.spice compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400513 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400514 -cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400515 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards106e38b2020-09-20 13:07:54 -0400516 -lef %l/latest/cells/*/*.magic.lef compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400517 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwardsfd5136b2020-07-08 22:57:04 -0400518 -doc %l/latest/cells/*/*.pdf \
519 -lib %l/latest/timing/*.lib \
520 -gds %l/latest/cells/*/*.gds compile-only \
Tim Edwards995c1332020-09-25 15:33:58 -0400521 sort=custom/scripts/sort_pdkfiles.py \
522 -verilog %l/latest/models/*/*.v exclude=*.*.v compile-only \
523 rename=primitives filter=custom/scripts/inc_verilog.py \
524 sort=custom/scripts/sort_pdkfiles.py \
525 -verilog %l/latest/cells/*/*.*.v \
526 -verilog %l/latest/cells/*/*.v exclude=*.*.v,primitives.v \
527 compile-only filter=custom/scripts/inc_verilog.py \
528 sort=custom/scripts/sort_pdkfiles.py \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400529 -library digital sky130_fd_sc_hd \
530 -library digital sky130_fd_sc_hdll \
531 -library digital sky130_fd_sc_hvl \
532 -library digital sky130_fd_sc_hs \
533 -library digital sky130_fd_sc_ls \
534 -library digital sky130_fd_sc_ms \
535 -library digital sky130_fd_sc_lp |& tee -a ${SKY130A}_install.log
Tim Edwards995c1332020-09-25 15:33:58 -0400536 # Remove the base verilog files which have already been included into
537 # the libraries
538 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hd/verilog/*.*.v
539 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hdll/verilog/*.*.v
540 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hvl/verilog/*.*.v
541 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_hs/verilog/*.*.v
542 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_ms/verilog/*.*.v
543 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_ls/verilog/*.*.v
544 ${RM} ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_fd_sc_lp/verilog/*.*.v
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500545 # Install alphanumeric library.
546 ${STAGE} -source ${REPO_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwards88bd42e2020-12-18 15:29:48 -0500547 -mag %l/mag/*.mag filter=custom/scripts/text2m5.py \
Tim Edwardsbcf59aa2020-12-17 16:55:13 -0500548 -library general sky130_ml_xx_hd |& tee -a ${SKY130A}_install.log
549 # Install text2mag.py script for alphanumeric library
550 mkdir -p ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_ml_xx_hd/scripts
551 cp custom/scripts/text2mag.py \
552 ${STAGING_PATH}/${SKY130A}/libs.ref/sky130_ml_xx_hd/scripts
Tristan Gingolda5854312020-10-15 18:28:16 +0200553 # Install OSU digital standard cells.
554 ${STAGE} -source ${SKYWATER_PATH} -target ${STAGING_PATH}/${SKY130A} \
Tim Edwardsbbab9f62020-11-02 10:12:20 -0500555 -techlef %l/latest/lef/sky130_osu_sc.tlef rename=sky130_osu_sc_t18.tlef \
Tristan Gingolda5854312020-10-15 18:28:16 +0200556 -cdl %l/latest/cdl/*.cdl ignore=topography compile-only \
557 -lef %l/latest/lef/*.lef compile-only \
558 -lib %l/latest/lib/*.lib \
559 -gds %l/latest/gds/*.gds compile-only \
560 -library digital sky130_osu_sc_t18 |& tee -a ${SKY130A}_install.log
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400561
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400562install:
Ahmed Ghazyf45cbf32020-08-08 17:11:53 +0200563 if test "x${DIST_PATH}" == "x" ; then \
564 ${MAKE} install-local ; \
565 else \
566 ${MAKE} install-dist; \
Tim Edwards7cbaaba2020-08-05 12:19:18 -0400567 fi
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400568
569install-local: install-local-a
570
571install-local-a:
572 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_migrate.log
573 ${INSTALL} -source ${STAGING_PATH}/${SKY130A} \
574 -target ${LOCAL_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -0500575 -variable PDKPATH \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400576 -link_from ${LINK_TARGETS} |& tee -a ${SKY130A}_migrate.log
577 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_migrate.log
578
579install-dist: install-dist-a
580
581install-dist-a:
582 echo "Starting SKY130 PDK migration on "`date` > ${SKY130A}_migrate.log
583 ${INSTALL} -source ${STAGING_PATH}/${SKY130A} \
584 -target ${DIST_PATH}/${SKY130A} \
Tim Edwardsb184e852020-12-04 15:30:05 -0500585 -variable PDKPATH \
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400586 -local ${LOCAL_PATH}/${SKY130A} \
587 -link_from ${DIST_LINK_TARGETS} |& tee -a ${SKY130A}_migrate.log
588 echo "Ended SKY130 PDK migration on "`date` >> ${SKY130A}_migrate.log
589
590clean: clean-a
591
592clean-a:
593 ${STAGE} -target ${STAGING_PATH}/${SKY130A} -clean
594
595veryclean: veryclean-a
596
597veryclean-a: clean-a
598 ${RM} ${SKY130A}_install.log
599 ${RM} ${SKY130A}_migrate.log