The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Aug 18th, 2024, 12:19am
Pages: 1
Send Topic Print
cadence Monte Carlo runs take 15x longer than tran (Read 2807 times)
huber
Community Member
***
Offline

GO BEARS!

Posts: 45
Los Angeles
cadence Monte Carlo runs take 15x longer than tran
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.
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: cadence Monte Carlo runs take 15x longer than
Reply #1 - 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
Back to top
 
 
View Profile WWW   IP Logged
huber
Community Member
***
Offline

GO BEARS!

Posts: 45
Los Angeles
Re: cadence Monte Carlo runs take 15x longer than
Reply #2 - 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.
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: cadence Monte Carlo runs take 15x longer than
Reply #3 - 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
Back to top
 
 
View Profile WWW   IP Logged
huber
Community Member
***
Offline

GO BEARS!

Posts: 45
Los Angeles
Re: cadence Monte Carlo runs take 15x longer than
Reply #4 - 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.
Back to top
 
 
View Profile   IP Logged
huber
Community Member
***
Offline

GO BEARS!

Posts: 45
Los Angeles
Re: cadence Monte Carlo runs take 15x longer than
Reply #5 - 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.
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: cadence Monte Carlo runs take 15x longer than
Reply #6 - 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
Back to top
 
 
View Profile WWW   IP Logged
huber
Community Member
***
Offline

GO BEARS!

Posts: 45
Los Angeles
Re: cadence Monte Carlo runs take 15x longer than
Reply #7 - 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.
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: cadence Monte Carlo runs take 15x longer than
Reply #8 - 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
Back to top
 
 
View Profile WWW   IP Logged
sheldon
Community Fellow
*****
Offline



Posts: 751

Re: cadence Monte Carlo runs take 15x longer than
Reply #9 - 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
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: cadence Monte Carlo runs take 15x longer than
Reply #10 - Jun 13th, 2005, 12:40pm
 
Whoops. Use 'alllocal'.

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



Posts: 2386
Silicon Valley
Re: cadence Monte Carlo runs take 15x longer than
Reply #11 - 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
Back to top
 
 
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: cadence Monte Carlo runs take 15x longer than
Reply #12 - Jun 23rd, 2005, 7:12am
 
Ken -
You wrote:
Quote:
The model can be improved by eliminating vdifdt and rewriting the model as
   I(plus,minus) <+ cvalue*V(plus,minus);


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
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: cadence Monte Carlo runs take 15x longer than
Reply #13 - 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
Back to top
 
 
View Profile WWW   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.