Minimal Setup for sky130 - Enviroment
This tutorial requires sudo access. If you are not the owner of the server or system, you should use a virtual machine or Docker.
Notation Guides:
$means Ubuntu shell commands%means tcl/tk consoleln[1]means interactive Python command- UPPERCASE words denote user-defined paths
Install MAGIC
Install dependent packages
CentOS uses
yuminstead ofapt-getfor package management. Package names could be slightly different.1 2 3 4 5 6
$ sudo apt-get install m4 $ sudo apt-get install tcsh $ sudo apt-get install csh $ sudo apt-get install libx11-dev $ sudo apt-get install TCL-dev tk-dev $ sudo apt-get install libcairo2-dev
Clone Magic source
Make or go to a directory for the source
DIR_FOR_SOURCEand clone the source from Git.1 2
$ cd DIR_FOR_SOURCE $ git clone git://opencircuitdesign.com/magic
If it doesn’t work, clone the GitHub mirror.
1
$ git clone https://github.com/RTimothyEdwards/magicThe command
apt-get install magicinstalls an outdated version!Compile and Install
This step requires sudo access.
1 2 3 4
$ cd magic $ ./configure $ make $ sudo make install
Test
You can run Magic in any directory.
1
$ magic &Check Magic’s cell search path with the following:
1
% path
If
CAD_ROOTappears after “System search path is”, you need to setCAD_ROOTas an environment variable pointing to where Magic’s basic libraries are installed. The default is ‘/usr/local/lib’.
Install XSCHEM, NETGEN, NGSPICE
XSCHEM
Install the following packages using
sudo apt-get installClone the XSCHEM source and install:
1 2 3 4 5 6
$ cd DIR_FOR_SOURCE $ git clone https://github.com/StefanSchippers/xschem.git_ $ cd xschem $ ./configure --prefix=ROOT_FOR_XSCHEM (default: '/usr/local') $ make $ make install
NETGEN
1 2 3 4 5 6
$ cd DIR_FOR_SOURCE $ git clone git://opencircuitdesign.com/netgen $ cd netgen $ ./configure $ make $ sudo make install
NGSPICE
NGSPICE uses
wgetinstead ofgit clone.1 2 3 4 5 6 7 8 9
$ cd DIR_FOR_SOURCE $ wget https://sourceforge.net/projects/ngspice/files/ng-spice-rework/37/ngspice-37.tar.gz $ tar -zxvf ngspice-37.tar.gz $ cd ngspice-37 $ mkdir release $ cd release $ ../configure --with-x --enable-xspice --enable-cider --enable-openmp --with-readlines=yes --disable-debug $ make $ sudo make install
Install SKY130-PDK
Google/Skywater open SKY130-PDK
Clone the PDK source from GitHub and activate submodules. Since
laygo2doesn’t use digital standard libraries, we install primitive and IO libraries only.1 2 3 4 5 6 7
$ cd DIR_FOR_SOURCE $ git clone https://github.com/google/skywater-pdk $ cd skywater-pdk $ git submodule init libraries/sky130_fd_io/latest $ git submodule init libraries/sky130_fd_pr/latest $ git submodule update $ make timing
Set up PDK using open-pdks
The
open-pdksapp installs Skywater-PDK into thePDK_ROOTdirectory and generates Magic library files with them. It also downloads some useful third-party libraries, such as primitives for XSCHEM.1 2 3 4
$ cd DIR_FOR_SOURCE $ git clone git://opencircuitdesign.com/open_pdks $ cd open_pdks $ ./configure --enable-sky130-pdk-DIR_FOR_SOURCE/skywater-pdk --disable-alpha-sky130
Before installing, consider these configuration options:
--prefix=PDK_ROOT- PDK files are installed in ‘PDK_ROOT/share/pdk’
- Default PDK_ROOT: ‘/usr/local’
- We use the default path in this tutorial
--enable-xschem-sky130[=PATH]- If not disabled, the third-party Sky130 setup for XSCHEM will be installed as part of the sky130A PDK.
- If the path is omitted or the configuration option is not specified, the library will be pulled automatically from the repository and installed.
- To disable the package, use
--disable-xschem-sky130.
--enable-alpha-sky130[=PATH]- The third-party alphanumeric layout library will be installed. Everything else is identical to option 2.
After choosing and setting the configuration, you can install. It could take some time.
1 2
$ make $ sudo make install
Set Startup Files for MAGIC and XSCHEM
MAGIC
Create a symbolic link mapping sky130 tech-files into the MAGIC system search path.
1
$ sudo ln -s SKY130A_INTALL_ROOT_DIR/sky130A/libs.tech/magic/* /usr/local/lib/magic/sys/
The default
SKY130A_INTALL_ROOT_DIRis ‘/usr/local/share/pdk’, which is identical to “PDK_ROOT/share/pdk”.Set the
.magicrcfile in your home directory.1 2 3
$ cd ~ $ cat > .magicrc source $CAD_ROOT/magic/sys/sky130A.magicrc
Test whether it’s connected well.
1 2
$ magic & % pathIt’s successful if the result looks like the image below.
XSCHEM
Check xschem_sky130 library
The
xschem_sky130library should have been installed inSKY130A_INSTALL_ROOT_DIR/sky130A/libs.tech.1 2 3
$ cd SKY130A_INSTALL_ROOT_DIR/sky130A/libs.tech $ cd xschem $ ls
If the following directories don’t appear, you should download them manually.
Set xschemrc
1 2 3 4
$ cd ~/.xschem $ cat > xschemrc source /usr/local/share/pdk/sky130A/libs.tech/xschem/xschemrc (press ctrl+D to finish writing) $ xschem
The result should look like the image below. Select the desired cell and press ‘e’ to check various circuits.



