Hello, How could i simulate the corners (ss, sf, f...
# general
h
Hello, How could i simulate the corners (ss, sf, fs and ff) with the tt and plot it in same graph? Could i do it just using ngspice+gaw or ngspice only?
p
What do mean by with tt and plot in the same graph?
s
@Hugo Dias Run multiple simulations with different corners, use the write nsgspice command to save in different .raw files, then use gaw and load these files. Picture shows ring oscillator simulated with ss and tt corners. 2 raw files loaded into gaw.
🙌 1
h
@Stefan Schippers It works, thanks! But how to export to raw files more than voltages and currents (like variables)?
j
Hello, How can I do all the simulations with all the corners? Do I have to do many simulations or can I do that in one
s
@Juan Andres Yes you have to run more simulations. you can write all data in a single raw file if you want, by doing
set appendwrite
before issuing the write command. Check the ngspice manual for this.
@Hugo Dias ngspice saves all voltages and voltage source currents if command
save all
is given before the tran , dc, ac command. If you give
.option savecurrents
ngspice saves everything including all device currents (gate, drain, source currents for MOS etc).
.option savecurrents
.control
save all
save @m.xm2.msky130_fd_pr__nfet_01v8_lvt[gm]
tran 1n 100n
remzerovec
write test.raw
.endc
If you want additional variables (transistor gm for example) you must explicitly save it as shown above for mos
m2
. The remzerovec is a quirk that eliminates zero vectors to prevent errors from ngspice when writing the raw file (see https://sourceforge.net/p/ngspice/bugs/596/)
j
But I can join all the files at the end? I ask because in the manual it presents during the simulation
s
@Juan Andres I don't know what you want to do, however if you have 2 raw files you can append these 2 files into a new raw file: on linux:
cat test_gm_id1.raw test_gm_id2.raw > test_gm_id.raw
and you can see the 2 traces in a waveform graph:
j
Yes I want that but with set appendwrite .raw1 .raw2 > .rawnew I will can to get a one file?
s
@Juan Andres
set appendwrite
does exactly what it says, simulation data is appended to the existing raw file. If you run 1st simulation with no
set appendwrite
and all next sims with
set appendwrite
you get a unique raw file with all sims 1st simulation:
Copy code
.control
  save all
  tran ...
  write file.raw
.endc
next simulations:
Copy code
.control
  save all
  set appendwrite
  tran ...
  write file.raw
.endc
At the end
file.raw
contains all simulations.
h
@Stefan Schippers But if i want to export variables which was created by "let" command. Like in my case, i want to export "tc" and tc is: "let tc=deriv(v(vts))". What i need to do? (vts is a node and i ran the temperature sweep)
@Juan Andres Lopez Cubides I changed the final of the .lib content. Change tt to ss, sf, fs and ff and run diffrent simulations. In each simulation, i go to xschem simulation path and change manually the .raw file name. But i will try the Stefan suggestion.