<@U01819B63HP> Trying to plot Id-Vd curve for NMOS...
# xschem
v
@Stefan Schippers Trying to plot Id-Vd curve for NMOS with sweeping Vgs. But not able to plot waveform inside xschem window. Please see attached gif file and suggest what might be wrong here.
s
The reason is that the circuit is called
nmos.sch
and the raw file is saved as
nmos2.raw
. Save the simulation data as
nmos.raw
. Alteratively give this comand at the xschem console:
xschem raw_read $netlist_dir/nmos2.raw
v
Hi @Stefan Schippers, raw file was renamed same as schematic file name i.e. nmos but still the issue is persisting. Please check attached gif.
s
Move save and simulation commands inside the .control:
Copy code
.options savecurrents
.control
  save all
  dc Vd 0 1.8 0.1 Vg 0 1.2 0.01
  write nmos.raw
.endc
... or place a
run
instruction into your .control:
Copy code
.save all
.dc Vd 0 1.8 0.1 Vg 0 1.2 0.01
.control
  run
  write nmos.raw
.endc
v
Thanks @Stefan Schippers, I am able to get plots on xschem window. Little confuse on use of .control block. I have worked on HSPICE and though ngspice is similar; but it's not. Any guidelines how to use .control block?
s
I think the best source is the ngspice user manual, chapter 17.
ngspice has an interactive mode (the ngspice prompt) where you can write commands to run a simulation, plot results and so on. the .control ... .endc blocks allow to put commands as they were typed on the terminal in interactive mode. ngspice has also a batch mode (
ngspice -b file.cir -r file.raw
) where .control / .endc is not used at atll.
v
Ok...can you please confirm that netlist syntax for ngspice batch mode will be same or similar to HSPICE batch mode. I believe that ngspice batch mode provides all features as interactive mode.
s
ngspice netlist is simialr to hspice but not all hspice devices are supported in the exact way. In some cases ngspice has a different equivalent device/syntax. For sky130 the
.spiceinit
file is set to:
set ngbehavior=hsa
to read hspice format .lib files.