The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 12:18am
Pages: 1
Send Topic Print
convergence problem (Read 6296 times)
priya
New Member
*
Offline



Posts: 2
india
convergence problem
Jan 13th, 2008, 11:20am
 
Dear Friends,
First of all my thanks to the wonderful site,so informative and helpful.

I have modeled a double gate MOSFET using verilog-a(on mentor graphics ADvance MS tool).Its running properly and showing me the expected characteristics of the device.Then I used the model developed to design an inverter(on ELDO),and it does not simulate.It shows convergence error.When I run the code,it starts DC ramping and then the system hangs.
Please help and suggest.
Thanks.
Back to top
 
 
View Profile   IP Logged
rajdeep
Senior Member
****
Offline



Posts: 220
UK
Re: convergence problem
Reply #1 - Jan 15th, 2008, 2:04am
 
Hi,

It is hard to comment without seeing the code.

So I wud make one general comment on this.

Make sure that the interface of the MOS model is electrical in nature.
By electrical I mean all the interfaces should have some finite impedance.
Only writing say "electrical out" is not suffiecient.  Convergence issues can arise
if say two voltage sources are in parallel or two current sources are connected
to one node without any finite impedance connected to that node.

Don't know how much will it help..

Rajdeep
Back to top
 
 

Design is fun, verification is a requirement.
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: convergence problem
Reply #2 - Jan 16th, 2008, 7:41am
 
I agree with Rajdeep: hard to say without seeing the code.

Did you read my tutorials from BMAS 2004:
http://www.bmas-conf.org/2004/papers/bmas04-coram.pdf
http://www.bmas-conf.org/2004/presentations/bmas04-coram-preso.pdf

There are a number of poor modeling techniques that might work fine in a digital or mixed-signal tool, but that don't really make sense in an analog simulator.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
rajdeep
Senior Member
****
Offline



Posts: 220
UK
Re: convergence problem
Reply #3 - Jan 17th, 2008, 7:12am
 
Hi Geoffrey,

I found the paper quite useful and in some cases it reminded me of the mistakes I have done while coding with VerilogA. But I could not understand the example that illustrates bad usage of if statement.

Quote:
if (vbs == 0.0) begin
                 qbs = 0.0;
                 capbs = czbs+czbssw+czbsswg;
           end else if (vbs < 0.0) begin
                 qbs = …
     …
           I(b,s) <+ ddt(qbs);


Quote:
Resulting C code:
           if (vbs == 0.0) {
                 qbs = 0.0;
                 dqbs_dvbs = 0.0;
                 //capbs=czbs+czbssw+czbsswg;
           } else if (vbs < 0.0) {
                 qbs = …
     …


I have pasted the two slides I could not understand well. What is the relation between dqbs_dvbs and the next line ( shown commented)??

Rajdeep
Back to top
 
 

Design is fun, verification is a requirement.
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: convergence problem
Reply #4 - Jan 28th, 2008, 6:58am
 
rajdeep wrote on Jan 17th, 2008, 7:12am:
Hi Geoffrey,
I have pasted the two slides I could not understand well. What is the relation between dqbs_dvbs and the next line ( shown commented)??


dqbs_dvbs is what the simulator computes as the derivative of qbs; the next line is what the model-writer wanted.

In C, the model-writer knows that, when vbs==0, q=0 and there's no need to do all the calculations.  However, in Verilog-A, if you try to skip the calculations, you end up with the wrong derivative!
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
rajdeep
Senior Member
****
Offline



Posts: 220
UK
Re: convergence problem
Reply #5 - Jan 31st, 2008, 11:04pm
 
Does this mean we should not assign the derivative of a variable dependent on node voltage
or current by ourselves in verilogA?
bcoz the C code generated by the 'model-writer' (a compiler???) ignores
that line and computes its own derivative.

Plz confirm!

Thanks!
Rajdeep
Back to top
 
 

Design is fun, verification is a requirement.
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: convergence problem
Reply #6 - Feb 4th, 2008, 5:21am
 
rajdeep wrote on Jan 31st, 2008, 11:04pm:
Does this mean we should not assign the derivative of a variable dependent on node voltage
or current by ourselves in verilogA?
bcoz the C code generated by the 'model-writer' (a compiler???) ignores
that line and computes its own derivative.

Plz confirm!

Thanks!
Rajdeep


That's right, the Verilog-A compiler computes all the derivatives that the simulator needs, based on the potential or flow (voltage or current) contributions (<+) in the model.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
NKS
New Member
*
Offline



Posts: 7
Seoul, Korea
Re: convergence problem
Reply #7 - Feb 12th, 2008, 1:03am
 
Geoffrey_Coram wrote on Feb 4th, 2008, 5:21am:
rajdeep wrote on Jan 31st, 2008, 11:04pm:
Does this mean we should not assign the derivative of a variable dependent on node voltage
or current by ourselves in verilogA?
bcoz the C code generated by the 'model-writer' (a compiler???) ignores
that line and computes its own derivative.

Plz confirm!

Thanks!
Rajdeep


That's right, the Verilog-A compiler computes all the derivatives that the simulator needs, based on the potential or flow (voltage or current) contributions (<+) in the model.


Hello Geoffrey,

I didn't quite catch your response to rajdeep's question about ending up with the wrong derivative if you skip a calculation in Verilog-A. Embarrassed Where did you skip the calculation in your bad usage example?  Or rather, I think it would be more helpful if you could post the proper/correct coding for the bad usage example. What would a proper Verilog-A code look like in the example mentioned?

Thanks in advance,

NKS
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: convergence problem
Reply #8 - Feb 22nd, 2008, 6:54am
 
The original C code had something like
 if (vbs == 0.0) {
   qbs = 0.0;
   cbs = czero_bs;
 } else ...

You should *NEVER* have a == test involving a voltage-dependent quantity (vbs) in Verilog-A, because you'll end up lying about the derivatives.

The Verilog-A code should be
 if (vbs <= 0) begin
   qbs =
 end else begin
   qbs =
 end

that is, only 2 branches, and there's no cbs calculation, because Verilog-A computes the derivatives automatically.  You of course need to be sure that qbs(vbs=0-) = qbs(vbs=0+), but the original model developer did that for you in this case.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
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.