<@U01819B63HP> I am running mismatch simulations o...
# xschem
p
@Stefan Schippers I am running mismatch simulations on a dynamic comparator and I am not sure if I am using the correct ngspice commands. I found from one of the examples about CHGTOL. Please let me know if there is any mistake in the commands, and also how to set the range of variations of the process variations.
Copy code
.OPTIONS CHGTOL=1.0e-17 method=gear
.temp 27

.param ton = 2n
.param vip = 0.05
.param shift = 0.05

.control
  option seed = 1
  let mc_runs = 5
  let run = 1
  set o2_node = ' '
  reset
  dowhile run < = mc_runs
    save all
    tran 100p 100n uic
    let vdiff = v(o2)-v(o1)
    set o2_node = ( $o2_node {$curplot}.vdiff )
    let run = run + 1
    reset
  end

** loop end, start plotting **
set color0 = white
set xbrushwidth=2             ; increase linewidth of graphs
plot $o2_node   ; plot all 27 magnitudes

.endc