More on Setting up and installing the required EDA softwaresEnable Windows Subsystem for Linux (WSL)
2. Enable the Windows Subsystem for Linux feature
4. Install your Linux distribution of choice
5. Create a UNIX user
6. Update the Linux distribution sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y The -y flag signifies automatic yes to any prompts that may come up in the command line 7. Accessing the Windows filesystem from WSL
ln -s /mnt/c/Users/<windowsusername> ~/winhome (example of windowsusername: ctalarico) 8. Starting up WSL
9. Graphical Applications
echo "export DISPLAY=localhost:0.0" >> ~/.bashrc
. ~/.bashrc Installing magic
To install the latest version compile and build magic from the source distribution 1. download the latest source distribution using git git clone https://github.com/RTimothyEdwards/magic.git git_magic 2. magic 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 The process of installing packages is quite empirical, and depends on the order in which you installed packages on you machine. This is because, To check the dependencies of a package you can use apt show package-name or apt rdepends package-name To check if a program belongs to a certain package you can use dpkg --search file-name or Example: dpkg --search c99 To check all the files in a package you can use apt-file list package-name 4. configure and install magic cd ~/git_magic ./configure --prefix=/home/<unixusername>/opt/magic make make install The location of magic's binaries is ~/opt/magic/bin 5. create a .bash_profile file and add the location of the magic binaries to the PATH cd .bash_profile
#!/usr/bin/bash PATH=${PATH} # Careful: # when there is a .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 PATH="$MAGIC_BIN:$PATH" # eliminate duplicates from the PATH PATH=$(echo $PATH | gawk -F: ' { for (i = 1; i <= NF; i++) arr[$i]; } END { for (i in arr) printf "%s:" , i; printf "\n"; } ') # and finally export the PATH export PATH="$PATH" Installing ngspice
To install the latest version download and compile ngspice from the source distribution 1. download ngspice-<xx>.tar.gz from here 2. expand ngspice-<xx>.tar.gz into your home directory tar xvfz ngspice-<xx>-tar.gz -C ~ 3. ngspice requires a number of packages
To check what packages are installed use apt list package-name To install the missing packages use sudo apt install package-name 4. browse to the location of ngspice's source files and configure and compile them cd ~/ngspice-<xx> mkdir release cd release ../configure --with-x --enable-xspice --disable-debug --enable-cider --with-readline=yes --enable-openmp --prefix=/home/<unixusername>/opt/ngspice make 2>&1 | tee make.log make install The location of ngspice's binary is ~/opt/ngspice/bin 5. edit the .bash_profile file and add the ngspice's binary location to the PATH cd .bash_profile
#!/usr/bin/bash PATH=${PATH} # Careful: # when there is a .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 # ngspice: binaries location NGSPICE_BIN=$HOME/opt/ngspice/bin PATH="$NGSPICE_BIN:$MAGIC_BIN:$PATH" # eliminate duplicates from the PATH PATH=$(echo $PATH | gawk -F: ' { for (i = 1; i <= NF; i++) arr[$i]; } END { for (i in arr) printf "%s:" , i; printf "\n"; } ') # and finally export the PATH export PATH="$PATH" “Aside” for Mac Users only
cd ~ explorer.exe .
1. How to make a folder on the Mac's hard drive accessible to WSL
b. on the Mac OS
c. on the Windows OS
d. start the WSL terminal
sudo mkdir -p /mnt/u sudo mount -t drvfs U: /mnt/u
sudo vi /etc/fstab
U: /mnt/u drvfs defaults 0 0
sudo mount -a
id
sudo mount -t drvfs U: /mnt/u -o metadata,uid=1000,gid=1000
U: /mnt/u drvfs rw,relatime,uid=1000,gid=1000,case=off 0 0
sudo mount -a
ln -s /mnt/u ~/machome 2. How to access data on a cloud storage service using WSL (example: iCloud)
/mnt/c/Users/<windowsusername>/iCloudDrive/
ln -s /mnt/c/Users/<windowsusername>/iCloudDrive ~/ihome A few Linux commands we may need
sudo -s
sudo -i
exit
lsb_release -a
ls -ltr
apt list [package_name]
apt show [package_name]
tar -czvf filename.tgz directory
tar -xzvf filename.tgz
gzip -dk filename.gz Installing and “tuning up” xschem
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/<unixusername>/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 # ngspice: binaries location NGSPICE_BIN=$HOME/opt/ngspice/bin # xschem: binaries location XSCHEM_BIN=$HOME/opt/xschem/bin PATH="$XSCHEM_BIN:$NGSPICE_BIN:$MAGIC_BIN:$PATH" # eliminate duplicates from the PATH PATH=$(echo $PATH | gawk -F: ' { for (i = 1; i <= NF; i++) arr[$i]; } END { for (i in arr) printf "%s:" , i; printf "\n"; } ') # 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 (customizations)
... # 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/pdk/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/pdk/sky130A/libs.tech/ngspice set SKYWATER_STDCELLS $env(HOME)/share/pdk/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 # ngspice: binaries location NGSPICE_BIN=$HOME/opt/magic/bin # xschem: binaries location XSCHEM_BIN=$HOME/opt/xschem/bin # setting xschem's HOME_DIR variable export HOME_DIR=$HOME/ihome PATH="$XSCHEM_BIN:$NGSPICE_BIN:$MAGIC_BIN:$PATH" # eliminate duplicates from the PATH PATH=$(echo $PATH | gawk -F: ' { for (i = 1; i <= NF; i++) arr[$i]; } END { for (i in arr) printf "%s:" , i; printf "\n"; } ') # 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/utalarico/ihome/ngs406/xSchems:/home/utalarico/ihome/Lib406:/home/utalarico/opt/xschem/share/xschem/xschem_library:/home/utalarico/opt/xschem/share/xschem/xschem_library/devices:/home/utalarico/share/pdk/sky130A/libs.tech/xschem /home/utalarico/opt/xschem/share/xschem /home/utalarico/.xschem /home/utalarico/share/pdk/sky130A/libs.tech/ngspice /home/utalarico/share/pdk/sky130A/libs.ref/sky130_fd_sc_hd/spice /home/utalarico/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 Install open_pdks and the skywater sky130 PDK
git clone https://github.com/RTimothyEdwards/open_pdks.git git_open_pdks cd ~/git_open_pdks #./configure --enable-sky130-pdk=/home/<unixusername>/skywater-pdk \ #--with-sky130-variants=all --prefix=/home/<unixusername> ./configure --enable-sky130-pdk --with-sky130-variants=all --prefix=/home/<unixusername> make make install The PDK gets installed at the location ~/share/pdk Libraries in the SKY130 PDK are named using the following scheme:
make sure the xschem_sky130 library is installed correctly
mkdir -p ~/example_xschem_sky130 cd example_xschem_sky130
cp ~/share/pdk/sky130A/libs.tech/xschem/xschemrc .
Build your own xschem library
|