Hello everyone, I was trying to analyze the corner...
# xschem
a
Hello everyone, I was trying to analyze the corner impact on the circuit and I need to plot transient waveforms in different corners. I would appreciate it if anyone let me know how should I do that in xschem. Also, where can I find the script for plotting ngspice signals in matlab? Thanks @Tim Edwards
s
In the xschem schematic you can change the model from tt to ss, ff, sf, fs: Depending on the symbol you use, see the pictures:
a
Thank you for the reply, I could change the corner but I need all of them on a single plot. Is it possible or I should plot them in matlab? Thanks
s
There is no easy way to simulate different corners in a single ngspice run, the easiest way is to simulate the same circuit multiple times and writing the raw file of the simulations after the first one with the
set appendwrite
option set. You can then view all curves in the same graph.
Following schematic shows ss, tt, ff corners for the drain current of a 01v8_lvt nfet:
a
Thank you so much
s
You are welcome. Set corner to '`ss`' and comment
set appendwrite
, run simulation, then set corner to
tt
and then
ff
and simulate with
set appendwrite
enabled. You get all 3 sims written into the same raw file.
t
@Amirhossein zanjani: The best way I've found to plot data from ngspice in octave/Matlab is to write data in ASCII format using
wrdata
. This generates output in columnar format which is easy to read into octave/Matlab as a data file, and then select columns from the data and reformat as needed to make the plots. Recently, however, I've come to prefer using
matplotlib
in Python. If you use Python, there are also packages available for reading SPICE raw files, so you can just read the raw file in and plot the data.
a
Should I unload/load again after simulating in another corner? should set appendwrite be commented? I'm still trying to have the signals on the same plot
s
run the first simulation with corner
ss
and no
set appendwrite
, then run corner
tt
with
set appendwrite
, then run simulation with corner
ff
and
set appendwrite
, then unload/load graphs. With waves loaded, double click inside the graph and ensure the '`dataset`' textbox is empty