The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 20th, 2024, 3:14am
Pages: 1
Send Topic Print
Confusions about time-step control in Ken's Spice and Spectre book (Read 76 times)
qilongliu
New Member
*
Offline



Posts: 7

Confusions about time-step control in Ken's Spice and Spectre book
Apr 23rd, 2023, 3:40am
 
Hi all,

 Recently convergence issues hit me heavily in my transient simulations. I tried to find some clues in Ken's classical book Designer's guide to Spice and Spectre. But still, I have some confusion about the time-step control:

 On Page 153, the discussion about a step voltage applied on a MOS capacitor, it says the current across the capacitor is not counted in time-step control:
"Unlike the voltage across a capacitor, errors in the current through a capacitor do not accumulate, and therefore the currents through capacitors are ignored by the time-step control algorithm. "

 However, on Page 178, the discussion about the local truncation error of Spice, it says the current across the capacitor IS used in time-step control:
"abstol is the absolute tolerance for the derivate of the state variable in the LTE criterion. Thus, abstol is the absolute tolerance for current though  capacitors and voltage across inductors"

 So is the capacitor current used for time-step control or not? Or is the capacitor current for step control only used in Spice but not in Spectre?

Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Confusions about time-step control in Ken's Spice and Spectre book
Reply #1 - Apr 26th, 2023, 11:04am
 
WIth capacitors you can treat either the voltage or the charge of the capacitor as the state variable. Spectre differs from SPICE in that it treats the voltage as the state variable, meaning that it observes changes in the voltage to determine when to shrink the step because LTE is too high or when to grow the step because LTE is low.  SPICE treats charge as the state variable.

There are trade-offs to both approaches.  Spectre actually uses the node voltages for any node that is connected to a capacitor to estimate LTE rather than the voltage across each capacitor.  Thus if you have a capacitor strung between two nodes whose voltages are far from zero, similar in magnitude, and changing slightly over time, Spectre will under-estimate the LTE for the capacitor because the nodes are seeing small changes in their voltage relative to a large bias voltage, whereas the floating capacitor will see changes in its voltage that are likely large relative to its bias.  SPICE is more conservative in that it computes LTE of each capacitor individually.  However, SPICE computes the LTE in the charge, and capacitors vary widely in size, so charge will also vary widely.  This represents a scaling problem.  The absolute tolerance for charge in SPICE is chgtol, which has a default value of 10-14 Coul.  The absolute tolerance dominates over the relative tolerance when signals are small. The effect of using charge as the state variable is that large capacitors will have their LTE controlled very tightly for small voltages and small capacitors will have their LTE controlled very loosely.  This could result in very small time-steps when the voltage on a large capcitor crosses zero and very loose error control on small capacitors.  Consider a 1fF capacitor. Any change of less that 10V will be ignored by the LTE control algorithm. SPICE tries to overcome these issues by observing and controlling the errors in the charge and its derivative (current) using a hybrid criteria that involves both chgtol and abstol.  Unfortunately I don't remember the details.

Please be aware that when I say SPICE I am not referring to commercially available simulators today.  I am referring to SPICE2 and SPICE3 from Berkeley.  Every simulator developer makes their own decisions on how to implement time step control and I am not privy to their decisions.

So, this response has been a bit long winded, but the essence of the response is that Spectre controls the time step by observing the node voltages for nodes that have capacitors connected to them whereas SPICE controls the time step by observing the the charge of each capacitor.  That approach has scaling issues, which SPICE attempts to overcome by using a hybrid error control strategy that looks at both the charge and current.  Both approaches are not quite kosher, but in my experience the Spectre approach seems better behaved over a wide variety of circuits.  A kosher approach is possible by using the voltage across each capacitor as the state variables, but it would be a bit more conservative.
Back to top
 
 
View Profile WWW   IP Logged
qilongliu
New Member
*
Offline



Posts: 7

Re: Confusions about time-step control in Ken's Spice and Spectre book
Reply #2 - Apr 28th, 2023, 10:50am
 
Hi Ken, your answer is very clear.  I feel very grateful to receive your reply!
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.