I am seeing some interesting behavior with ngspice...
# analog-design
w
I am seeing some interesting behavior with ngspice (I think) where it is really reducing the time-stepping for some of my transistions but not others. I have a deadtime circuit that generates ~2ns of deadtime and it seems that ngspice is completely skipping that on some transitions. Anyone else seen similar behavior?
s
I've seen this happen in other tools if your relative tolerances between iterations get relaxed due to non-convergence. Does ngspice give you a warning?
j
You could set TMAX in the .tran line to 1ns. That makes sure SPICE doesn't jump past any events.
w
If I set my tmax to some really small value the simulation is going to take forever.
Whats weird, is some switching cycles it skips, some it does not.
s
I believe the idea is that something in the simulation dynamics is causing tolerances to be tested and your solvers iterations ar conducted with relaxed assumptions. This doesn’t have to always happen, just needs to happen under some circumstances when for eg., you get a discontinuity or something similar.
j
Think about it this way. If SPICE is running through a simulation at time step=100ns when you generate a 1ns pulse, it will jump right past the event. How would it know to do otherwise?
s
@J. Scott Elder don’t most solvers have adaptive step-size for this reason?
j
Yes, but when nothing is happening it keeps increasing the time step up to something like 1% of total time.
s
Understood