Stefan Schippers
11/26/2021, 12:37 PMsudo apt-get purge xschem
. Same considerations for ngspice. Please build xschem from sources by cloning from git: git clone git@github.com:StefanSchippers/xschem.git xschem-src
, then running ./configure with optional --prefix parameter, see instructions here. In particular please verify you have all the required packages installed. refer to the install page in the xschem manual.
• To install xschem, ngspice and the open_pdks data follow this step by step tutorial.
• After installing open_pdks you can run simulations by including the top skywater model file: .lib /your/path/to/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt
.
• The recommended way to design and simulate a circuit is to create a new empty directory and copy the open_pdks provided `xschemrc`: mkdir my_example ; cp /your/path/to/share/pdk/sky130A/libs.tech/xschem/xschemrc my_example/
, then cd into that directory and start xschem.
• xschem uses the terminal where it is started from as a command interface, if you don't want to use the terminal you can start xschem with '`xschem -b &`', so the terminal will be free. Do not start xschem in the background without -b: xschem &
, this will cause xschem to freeze since input from terminal will block the program. Just use xschem -b &
.
• Xschem writes netlists in a directory defined by the tcl '`netlist_dir`' variable. You can change the location by editing the xschemrc
file (locate the '`set netlist_dir`' line and change according to your needs). By default the netlist directory is set to ~/.xschem/simulations
. Always verify you have write permissions in the directory you are using for netlist generation. The spice simulator will be invoked by xschem and will also be running in this directory, so all spice generated files will also be in this directory.
• Xschem uses a terminal
and an editor
to allow editing some files or displaying some content. For this there are two variables defined in xschemrc: editor
and terminal
. By default editor is set to '`gvim -f`' and terminal is set to '`xterm`'. I suggest to install xterm
on your system, it is a very small package and has much less problems than 'modern' terminal emulators, and verify '`editor`' is set to an existing editor installed on the system. Please note that for gvim a -f
option is added to avoid gvim forking in the backgound. If your editor of choice forks itself in the background please provide an option do avoid doing so. Xschem needs for the editor sub-process to finish, so it syncs up the edited file, before going forward.
• Xschem is able to produce Spice, Verilog and VHDL netlists, the default open source tools for simulating these are by default ngspice, icarus verilog and ghdl respectively. If you plan to simulate verilog designs in addition to spice, please install icarus verilog (i recommend building from git, git clone <git://github.com/steveicarus/iverilog.git> verilog-src
), for VHDL simulations install ghdl from git, git clone <https://github.com/ghdl/ghdl.git> ghdl-src
. xschem can invoke these simulator by pressing the 'Simulate' button, this works if the paths for the simulators are correctly configured. To verify the configuration go to xschem Simulation
menu and click '`Configure simulators and tools`'. A dialog box appears with the various command lines xschem uses to invoke the simulator. There is a 'Help' button giving more information. The Configure simulators and tools dialog box can be used to invoke different simulators, even commercial tools. Xschem has been used with HSPICE, cadence NCSIM digital simulator and Mentor Modelsim.
• For ngspice specific issues please read the manual! it has lot of very useful information.
• Please note that skywater-pdk has a .option scale=1.0u
in the spice files, that means that all transistor dimensions you give (L=0.18, W=2
) will be scaled down by 1e6. so a '1' means 1 micro-meter. DO not use l=0.18u
, since that will reduce to 0.18 pico-meters!!