https://open-source-silicon.dev logo
w

Weston Braun

05/20/2021, 7:38 PM
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

Siddharth Joshi

05/20/2021, 9:26 PM
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

J. Scott Elder

05/20/2021, 11:24 PM
You could set TMAX in the .tran line to 1ns. That makes sure SPICE doesn't jump past any events.
w

Weston Braun

05/21/2021, 12:56 AM
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

Siddharth Joshi

05/21/2021, 1:05 AM
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

J. Scott Elder

05/21/2021, 1:08 AM
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

Siddharth Joshi

05/21/2021, 1:09 AM
@J. Scott Elder don’t most solvers have adaptive step-size for this reason?
j

J. Scott Elder

05/21/2021, 1:10 AM
Yes, but when nothing is happening it keeps increasing the time step up to something like 1% of total time.
s

Siddharth Joshi

05/21/2021, 1:10 AM
Understood