With the help of <@U01819B63HP> I managed to do a ...
# analog-design
h
With the help of @Stefan Schippers I managed to do a fancy loop for MOSFET characterization in
ngspice
. I post it here for the benefit of others. This is the code to write a host of data files:
Copy code
.control

let vg_val = 0
let vd_val = 0.6

while vg_val le 1.9

  alter vg vg_val
  dc vd 0 1.8 10e-3

  set fn = test_nmos_lvt_vg_{$&vg_val}.txt
  echo Writing $fn
  wrdata $fn i(vids_lvt)

  set fn = test_nmos_svt_vg_{$&vg_val}.txt
  echo Writing $fn
  wrdata $fn i(vids_svt)

  let vg_val = vg_val + 0.2
end

while vd_val le 1.9

  alter vd vd_val
  dc vg 0 1.8 10e-3

  set fn = test_nmos_lvt_vd_{$&vd_val}.txt
  echo Writing $fn
  wrdata $fn i(vids_lvt)

  set fn = test_nmos_svt_vd_{$&vd_val}.txt
  echo Writing $fn
  wrdata $fn i(vids_svt)

  let vd_val = vd_val + 0.6
end

.endc
Used in this
xschem
testbench (see figure) to produce these plots in LaTeX (see figure).
👍 6