The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Simulators >> Circuit Simulators >> cadence Monte Carlo runs take 15x longer than tran https://designers-guide.org/forum/YaBB.pl?num=1118447349 Message started by huber on Jun 10th, 2005, 4:49pm |
Title: cadence Monte Carlo runs take 15x longer than tran Post by huber on Jun 10th, 2005, 4:49pm I am simulating a circuit that contains a MOS varactor with a verilogA model. When I run a normal transient simulation I get no errors or warnings and spectre finishes in less than 1 minute. When I run a Monte Carlo (mismatch only) simulation, each tran run takes 17 minutes and is full of minimum time step warnings. The varactor is part of an ST design kit (I didn't write the model) and uses several files, but from what I can gather the core of the model is: V(vdifdt) <+ ddt(V(plus,minus))*1e-9 ; I(plus,minus) <+ cvalue*V(vdifdt)*1e9; where cvalue is some function of the tuning voltage. Is there some way to figure out what is causing the minimum time step warnings? I am runing with the default (moderate) error tolerances. Changing to liberal gets rid of the time step warnings but results are quite different. Thanks in advance to anyone who can offer help. |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by Ken Kundert on Jun 10th, 2005, 11:51pm The model can be improved by eliminating vdifdt and rewriting the model as I(plus,minus) <+ cvalue*V(plus,minus); This could eliminate some scaling problems caused by large values on the unnecessary vdifdt. In addition, if cvalue is a function of V(plus,minus) then even the improved model will not be charge conserving. Meaning that in the best case the model is inaccurate, but in worst case it could produce anomolous results. See the paper titled "Modeling Varactors" in www.designers-guide.org/Modeling/. -Ken |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by huber on Jun 11th, 2005, 10:08am cvalue is too complex a function of the control voltage for me to integrate analytically (if-then statements) so I'm not sure how to rewrite the model as sugested in the varactor paper. Can I do a numerical integration? Any thoughts on why I only see warnings durring Monte Carlo? If I end up staying with the existing (non-charge conserving, but supported) model, what can I do to verify that it is accurate enough? I am using the varactor as a coupling capacitor in an autozeroing network, so I'm a little worried about the effect of switching transients on that vdift expression. Thanks again for the help. |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by Ken Kundert on Jun 11th, 2005, 12:38pm Using a non-charge conserving capacitor model in an auto-zero circuit is not a good idea. I don't know what is causing your monte carlo problems. If you suspect it is the varactor model, try it with the varactor replaced by a simple linear capacitor and see if the problem remains or disappears. A circuit that suddenly runs very slow in transient may either be oscillating or the simulator may be experiencing trapezoidal ringing. You can address the second problem by using method=gear2only (transient analysis option). If the problem does not go away, look for an oscillation. Look first in the power supply current. -Ken |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by huber on Jun 11th, 2005, 3:18pm The varactor is definately causing it. I've run the sim many times with linear metal capacitors and never seen this problem. I want to use the varactor because of it's high capacatince density, but in order to do that I've got to have confidence in the models. Guess I might have to eat the area and use metal. |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by huber on Jun 11th, 2005, 3:51pm If I'm going to fix the varactor model, I'll want to change the existing code as little as possible. It's too complex for me to sort out and not get way behind schedule. If I could copy a section of the existing model and modify it to form a function that maps V(plus,minus) to cvalue, does verilogA have a way to create a function that is its integral? I'm pretty sure this would be easy in Matlab, but I'm not that farmiliar with verilogA. |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by Ken Kundert on Jun 11th, 2005, 5:37pm There is no way to compute the integral symbolically in Verilog-A. You can do it in Matlab and code it into Verilog-A. If the slowness is not caused by ringing or parasitic oscillations, and it goes away when you use a linear capacitor, it may be a result of errors or discontinuities in the model. Can you post the model? -Ken |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by huber on Jun 11th, 2005, 11:14pm I've mailed you the model. Thanks again, Ken. This is Dan Huber, by the way. I met you recently at UCLA. |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by Ken Kundert on Jun 12th, 2005, 8:54am Dan, I took a look at the model and do not see an obvious explaination for the problems you are having. Though the model does have some obvious problems. The most glaring is the use of the internal vdifdt node. Here, the derivative of the capacitor voltage is scaled by 1e-9 and converted to a voltage and applied to a node. This creates two problems. First, it is inefficient and slows the simulator. There is no need for this value to be a node voltage, and making it one causes the simulator to run slower. That voltage also affects the tolerance. If the slewrate on the capacitor ever goes higher than 1V/ns then the voltage on vdifdt will go above 1V, which with default settings, will loosen the tolerances on all voltages in the circuit. To avoid this problem, you should use relref=siglocal. The second problem with the model is that it is inefficiently implemented. Code optimization is not very advanced in Verilog-A compilers, and so people writing models should optimize their models by hand. The third, and most significant problem in the model, is that the model does not conserve charge. This is especially damaging in charge storage circuits, such as your auto-zero circuit. To see a good example of the problems caused by non-charge-conserving models, take a look at page 167 in my Spice & Spectre book. However, none of these problems should be made substantially worse when using Monte Carlo. -Ken |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by sheldon on Jun 13th, 2005, 6:22am Ken, Hope this doesn't get me struck by lightening, but aren't the choices for relref: allglobal, sigglobal, alllocal, and pointlocal? Best Regards, Sheldon |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by Ken Kundert on Jun 13th, 2005, 12:40pm Whoops. Use 'alllocal'. -Ken |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by Ken Kundert on Jun 13th, 2005, 12:44pm By the way, Dan sent me email indicating that using method=gear2only eliminates the slow-down, as such the problem must have been trapezoidal ringing. -Ken |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by Geoffrey_Coram on Jun 23rd, 2005, 7:12am Ken - You wrote: Quote:
but this leaves off the ddt in the original model. I assume you meant I(plus,minus) <+ cvalue*ddt(V(plus,minus)); And, to address the non-charge-conserving question, one might try: I(plus,minus) <+ ddt(cvalue*V(plus,minus)); It's possible that the original equations for "cvalue" were derived with this in mind. -Geoffrey |
Title: Re: cadence Monte Carlo runs take 15x longer than Post by Ken Kundert on Jun 23rd, 2005, 9:43am Geoffrey, See section 3 "A Common Modeling Error" of http://www.designers-guide.org/Modeling/varactors.pdf for an explanation of why that would be problematic if cvalue represents the true capacitance. -Ken |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |