- Notifications
You must be signed in to change notification settings - Fork9
Minimal SKY130 example with self-checking LVS, DRC, and PEX
License
sgherbst/sky130-hello-world
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repo contains a minimal example of LVS, DRC, PEX, and SPICE simulation in SKY130. It has a self-checking regression that runs on a GitHub Actions Linux host, so the intent is that one should be able to follow along with the steps in.github/workflows/regression.yml
,install.sh
, andregress.sh
to fully reproduce the functionality shown here.
The example is based around the minimum-size inverter from the SKY130 PDK. DRC is run on the GDS for that inverter, and then it is extracted for LVS and PEX. On the LVS front, the extracted SPICE netlist is compared to the netlist given in the PDK usingnetgen
. On the PEX front,ngspice
is used to run a transient simulation of the inverter with parasitic capacitances included. The regression tests also include some tests to make sure that DRC and LVS errors can in fact be detected, using the intentionally broken fileinv1_bad.gds
.
The full details for this example can always be found by examining the source code here, but the main functions are also summarized below.
Certain dependencies need to be installed before moving on to the SKY130-specific tools.
sudo apt-get install m4 tcsh csh libx11-dev tcl-dev tk-dev libcairo2-dev libncurses-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev ngspice
This script walks through the installation ofmagic
,netgen
,skywater-pdk
, andopen_pdks
.
# create directory to hold open-source PDKSmkdir PDKS# install magicgit clone https://github.com/RTimothyEdwards/magic.gitcd magicgit checkout magic-8.3./configuremakesudo make installcd ..# install netgengit clone https://github.com/RTimothyEdwards/netgen.gitcd netgengit checkout netgen-1.5./configuremakesudo make installcd ..# install skywater-pdkgit clone https://github.com/google/skywater-pdkcd skywater-pdkgit submodule init libraries/sky130_fd_pr/latestgit submodule updatecd ..# install open_pdksgit clone https://github.com/RTimothyEdwards/open_pdks.gitcd open_pdks./configure --with-sky130-source=`realpath ../skywater-pdk` --with-sky130-local-path=`realpath ../PDKS`makemake installcd ..
In addition, thePDKPATH
environment variable should be set to the absoute path ofPDKS/sky130A
, e.g.
export PDKPATH=`realpath PDKS/sky130A`
For simulations in ngspice, the regression uses theSKYWATER
environment variable, set to the absolute path of the skywater repositoryskywater-pdk
, e.g.
export SKYWATER=`realpath skywater-pdk`
magic
can run TCL scripts (DRC, extraction, etc.) in a non-interactive fashion using the following command:
magic -noconsole -dnull script.tcl
Make sure that your scripts havequit
at the end, to avoid ending up at an interactive prompt!
The followingmagic
TCL script reads in a GDS and counts up the number of DRC violations. For some reason, the final line says that there are zero DRC errors, even if previous lines show errors. Run this script using themagic
command from the previous section.
gds read path_to_gds_fileload name_of_top_celldrc catchupdrc countquit
The followingmagic
TCL script reads in a GDS and extracts it to an LVS-ready netlist.
gds read path_to_gds_fileload name_of_top_cellextract allext2spice lvsext2spice subcircuits offext2spice -o lvs_output_filequit
The followingmagic
TCL script reads in a GDS and extracts it to an netlist for SPICE simulation.
gds read path_to_gds_fileload name_of_top_cellextract allselect top cellport makeallext2spice lvsext2spice cthresh 0.01ext2spice rthresh 0.01ext2spice subcircuit onext2spice ngspiceext2spice pex_output_filequit
LVS can be run to compare the design netlist with the extracted netlist usingnetgen
:
netgen -batch lvs"design_netlist design_top_cell""ext_netlist ext_top_cell"$PDKPATH/libs.tech/netgen/sky130A_setup.tcl
SPICE simulations can be run without special options (e.g.,ngspice myfile.spice
), but the following line should be placed near the top of the input file.
.lib "skywater-pdk/libraries/sky130_fd_pr/latest/models/sky130.lib.spice" tt
You'll probably need to make that an absolute path unlessskywater-pdk
happens to be in your current direction. Also, remember that for ngspice, the very first line of the input file must be a comment!
- SKY130 inverter example with a video
- SKY130 chip example with DRC/LVS/PEX scripts
- SkyWater Open Source PDK
- Open Circuit Design Tools