Installing and “tuning up” xschemFor skywater 130nm PDK integration install at least xschem version 3.0.0 sudo apt install xschem Otherwise, download and compile the latest version from the source distribution xschem requires a number of supporting software packages
To check what packages are installed use apt list package-name To install the missing packages use sudo apt install package-name Most packages are already presents on the systems since we already installed them for magic and ngspice Here are the steps for installing, setting up and configuring xschem: 1. download xschem: cd git clone https://github.com/StefanSchippers/xschem.git git_xschem 2. configure and install xschem cd ./git_xschem ./configure --prefix=/home/$(whoami)/opt/xschem make make install the location of xschem's binaries (xschem and rawtovcd) is /home/<unixusername>/opt/xschem/bin 3. edit the .bash_profile file to add the xschem's binaries to the PATH cd .bash_profile
#!/usr/bin/bash PATH=${PATH} # Careful: # when there is .bash_profile the WSL terminal does not source .bashrc by default source ~/.bashrc # prevent "Warning: Missing charset in String to FontSet conversion" export LC_ALL=C # magic: binaries location MAGIC_BIN=$HOME/opt/magic/bin export CAD_ROOT=$HOME/opt/magic/lib # netgen: binaries location NETGEN_BIN=$HOME/opt/netgen/bin # ngspice: binaries location NGSPICE_BIN=$HOME/opt/magic/bin # xschem: binaries location XSCHEM_BIN=$HOME/opt/xschem/bin # setting up PDK root location export PDK_ROOT=$HOME/share/pdks # PATH PATH="$XSCHEM_BIN:$NGSPICE_BIN:$MAGIC_BIN:$NETGEN_BIN:$PATH" # eliminate duplicates from the PATH PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')" # and finally export the PATH export PATH="$PATH" 4. xschem and tclsh
sudo apt install tcl-tclreadline
.tclshrc
if {$tcl_interactive} { package require tclreadline ::tclreadline::Loop } 5. setting up xschem
xschemrc (customization example)
... # CT: 20211201 set XSCHEM_LIBRARY_PATH {} append XSCHEM_LIBRARY_PATH $env(HOME_DIR)/ngs406/xSchems append XSCHEM_LIBRARY_PATH :$env(HOME_DIR)/Lib406 append XSCHEM_LIBRARY_PATH :${XSCHEM_SHAREDIR}/xschem_library append XSCHEM_LIBRARY_PATH :${XSCHEM_SHAREDIR}/xschem_library/devices append XSCHEM_LIBRARY_PATH :$env(HOME)/share/pdks/sky130A/libs.tech/xschem # end CT ... # CT: 20211201 # set XSCHEM_START_WINDOW {sky130_tests/top.sch} # end CT ... # CT: 20211201 set netlist_dir $env(HOME_DIR)/ngs406/xSchems # end CT ... # CT: 20211201 # uncommented first two lines, added last two lines} set hspice_netlist 1 set verilog_2001 1 set flat_netlist 0 set netlist_show 1 # CT end ... # CT: 20211201 # SKYWATER PDK SPECIFIC VARIABLES set SKYWATER_MODELS $env(HOME)/share/pdks/sky130A/libs.tech/ngspice set SKYWATER_STDCELLS $env(HOME)/share/pdks/sky130A/libs.ref/sky130_fd_sc_hd/spice # CT end
.bash_profile
#!/usr/bin/bash PATH=${PATH} # Careful: # when there is .bash_profile the WSL terminal does not source .bashrc by default source ~/.bashrc # prevent "Warning: Missing charset in String to FontSet conversion" export LC_ALL=C # magic: binaries location MAGIC_BIN=$HOME/opt/magic/bin export CAD_ROOT=$HOME/opt/magic/lib # netgen: binaries location NETGEN_BIN=$HOME/opt/netgen/bin # ngspice: binaries location NGSPICE_BIN=$HOME/opt/magic/bin # xschem: binaries location XSCHEM_BIN=$HOME/opt/xschem/bin # setting up PDK root location export PDK_ROOT=$HOME/share/pdks # setting xschem's HOME_DIR variable export HOME_DIR=$HOME/ihome # PATH PATH="$XSCHEM_BIN:$NGSPICE_BIN:$MAGIC_BIN:$NETGEN_BIN:$PATH" # eliminate duplicates from the PATH PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')" # and finally export the PATH export PATH="$PATH"
puts $XSCHEM_LIBRARY_PATH puts $XSCHEM_SHAREDIR puts $USER_CONF_DIR puts $SKYWATER_MODELS puts $SKYWATER_STDCELLS puts $netlist_dir Response to the puts command (example)
/home/talarico/ihome/ngs406/xSchems:/home/talarico/ihome/Lib406:/home/talarico/opt/xschem/share/xschem/xschem_library:/home/talarico/opt/xschem/share/xschem/xschem_library/devices:/home/talarico/share/pdks/sky130A/libs.tech/xschem /home/talarico/opt/xschem/share/xschem /home/talarico/.xschem /home/talarico/share/pdk/sky130A/libs.tech/ngspice /home/talarico/share/pdk/sky130A/libs.ref/sky130_fd_sc_hd/spice /home/talarico/ihome/ngs406/xSchems
6. Circuit simulation and visualization of the output waveforms 7. Installing gaw
sudo apt-get install libgtk-3-dev
tar zxvf gaw3-20200922.tar.gz cd gaw-20200922 ./configure make sudo make install
8. configure xschem for analog simulation (ngspice and gaw)
9. install the xschem's library for the skywater 130nm PDK Instead of manually installing the xschem's skywater library from github (git clone https://github.com/StefanSchippers/xschem_sky130.git) The current (@ 3 Dec. 2021) xschem_sky130 examples use the model file locations installed by open_pdks |