View waveforms in Xschem
Ming Sun / November 06, 2022
6 min read • ––– views
Cell name: SIM_nand2
PDK: Skywater130
Schematic capture: Xschem
Simulator: Ngspice
In this tutorial, we will keep using the SIM_nand2.sch
schematic test bench. In the previous blog post[1], we use Ngspice
to view the simulation results. Another alternative to view the simulation results is to use the built-in waveform viewer from Xschem
.
Run simulation
- Open the
SIM_nand2
test bench, change thecode_shown
stimulus to the following:
code_show.sym
name=NGSPICE
only_toplevel=true
value="
.control
save all
tran 100p 4u
write SIM_nand2.raw
set appendwrite
.endc
"
- Add a
launcher.sym
symbol fromxschem_library/devices
folder with the following content:
launcher.sym
ame=h1
descr="Select arrow and
Ctrl-Left-Click to load/unload
simulation .raw file"
tclcommand="
xschem raw_read $netlist_dir/[file tail [file rootname [xschem get current_name]]].raw
"
- Add two waveform viewer into the schematic from
Simulation
=>Add waveform graph
. To resize thewaveform graph
, pressctrl
key and use mouse left button to select the bottom right corner of thewaveform graph
. Then pressm
key to stretch[2].
The finished schematic is as shown in Fig. 1.
Fig. 1Modified SIM_nand2 schematic
View simulation results
- click
Netlist
=>Simulate
. After simulation is done,ctrl+click
the bottom green arrow to load the waveform. You can also go toSimulation
=>Load/Unload spice .raw file
to load the simulation data.
Select the first waveform graph and then select Vin1
net, press option-g
to load Vin1
waveform to the first waveform graph as shown in Fig. 2.
Fig. 2Simulation result - Vin1
Following the same procedure, we can load Vin2
and Vout
to the waveform graph as well, which is as shown in Fig. 3.
Fig. 3Nand2 simulation results
Cursor and zoom in
The following bindkeys can be useful to check the wavefroms in the waveform graph[2].
a
: toggle cursor ab
: toggle cursor bmouse left button drag
: pan left or rightmouse right button select
: zoom inf
: full scaleleft arrow
: pan leftright arrow
: pan righttop arrow
: zoom indown arrow
: zoom out
Fig. 4Zoomed in simulation results