The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> RF Simulators >> convergence difficulties in SpectreRF
https://designers-guide.org/forum/YaBB.pl?num=1034788971

Message started by YFUSA on Oct 16th, 2002, 10:22am

Title: convergence difficulties in SpectreRF
Post by YFUSA on Oct 16th, 2002, 10:22am

I am trying to create a model of VCO using Verilog-A acting as an LC oscillator.
The PSS is asked to converge on the differential output LC oscillator.
When the accuracy is set to conservative, it works.
When the accuracy is set to moderate, it doesn't converge anymore reporting that the voltage on the LC circuit is of 18 TV after 1 or 2 iterations.

I made my model display the voltage and it's always between 0V and 1.8V except when it stops!

Have you already encountered this type of problem?
What was the solution (except simulating always in conservative mode...)?

Thanks

Title: Re: convergence difficulties in SpectreRF
Post by Ken Kundert on Oct 17th, 2002, 12:27am

Yfusa,
   I've never heard of anything like that. Perhaps you can post your model and we'll take a look and see if there is an obvious problem.

-Ken

Title: Re: convergence difficulties in SpectreRF
Post by YFUSA on Oct 17th, 2002, 12:50am

Here is my model (some inputs are not yet used):


Code:

// VerilogA for Test_vco, LC2k2, veriloga

`include "constants.h"
`include "discipline.h"

module LC2k2(LCN, LCP, OUT, CTLN, CTLP, Cap_0, Cap_1, Cap_2, EN, MC, START, VDD, VSS);
output LCN;
electrical LCN;
output LCP;
electrical LCP;
output OUT;
electrical OUT;
input CTLN;
electrical CTLN;
input CTLP;
electrical CTLP;
input Cap_0;
electrical Cap_0;
input Cap_1;
electrical Cap_1;
input Cap_2;
electrical Cap_2;
input EN;
electrical EN;
input MC;
electrical MC;
input START;
electrical START;
input VDD;
electrical VDD;
input VSS;
electrical VSS;

parameter real vthn   =    0.33;         //Vth0 n
parameter real vthp   =    0.33;         //Vth0 p
parameter real trise  =  130.00e-12;     //Rising time(10%-90%)
parameter real tfall  =  130.00e-12;     //Falling time
parameter real induc  =    6.90e-9;      //Inductor  LC
parameter real capaC  =    1.41e-12;     //Capacitor LC
parameter real res_ql =   11.00;         //resistor L Q

real vdd           ; //Power supply
real capa_p1       ; //Varicap P1
real capa_p2       ; //Varicap P2
real capa_n1       ; //Varicap N1
real capa_n2       ; //Varicap N2
real capa_pb1       ; //Varicap P1
real capa_nb2       ; //Varicap P2
real capa_nb1       ; //Varicap N1
real resneg        ; //negative resistor
electrical hold    ; //hidden states
electrical hold2   ; //hidden states
electrical RL      ; //RL

     analog begin

           vdd=V(VDD);
           resneg=induc/(3*capaC*res_ql);

           if(analysis("static")) begin
                 I(hold)<+V(hold);
                 I(hold2)<+V(hold2);
                 I(RL)<+V(RL);
           end

           I(hold)<+ 1e-12*ddt(V(hold));
           I(hold2)<+ 1e-12*ddt(V(hold2));
           I(Cap_0)<+ 1e-12*ddt(V(Cap_0));            //input not yet used
           I(Cap_1)<+ 1e-12*ddt(V(Cap_1));            //input not yet used
           I(Cap_2)<+ 1e-12*ddt(V(Cap_2));            //input not yet used
           I(EN)<+ 1e-12*ddt(V(EN));            //input not yet used
           I(MC)<+ 1e-12*ddt(V(MC));            //input not yet used
           I(START)<+ 1e-12*ddt(V(START));            //input not yet used
           
           I(LCP,LCN)<+ capaC*ddt(V(LCP,LCN));
           I(LCP,RL)<+ idt(V(LCP,RL),0)/induc;
           I(RL,LCN)<+ V(RL,LCN)/res_ql;            //Quality factor
           I(LCP,LCN)<+ -(V(LCP,LCN))/resneg;

           I(LCP,VSS)<+ -1e-6*(1-exp((V(LCP)-vdd+2*vthp)*100));  //diode
           I(LCN,VSS)<+ -1e-6*(1-exp((V(LCN)-vdd+2*vthp)*100));
           I(LCP,VSS)<+ 1e-6*(1-exp((-V(LCP)+2*vthn)*100));
           I(LCN,VSS)<+ 1e-6*(1-exp((-V(LCN)+2*vthn)*100));
           
           capa_p1 = 1E-3*(-73.2/(7.8*5.7)*ln((7.8*exp(-5.7*(V(LCP)-V(CTLP))))+11.9)+1.35*(V(LCP)-V(CTLP)))*230e-12;      //varactor
           capa_p2 = 1E-3*(-73.2/(7.8*5.7)*ln((7.8*exp(-5.7*(V(LCN)-V(CTLP))))+11.9)+1.35*(V(LCN)-V(CTLP)))*230e-12;
           capa_n1 = 1E-3*(-73.2/(7.8*5.7)*ln((7.8*exp(-5.7*(V(CTLN)-V(LCP))))+11.9)+1.35*(V(CTLN)-V(LCP)))*230e-12;
           capa_n2 = 1E-3*(-73.2/(7.8*5.7)*ln((7.8*exp(-5.7*(V(CTLN)-V(LCN))))+11.9)+1.35*(V(CTLN)-V(LCN)))*230e-12;

           capa_pb1 = 0.14e-15*V(CTLP)*V(CTLP)*230e-12;
           capa_nb2 = 0.5*0.14e-15*V(LCN)*V(LCN)*230e-12;
           capa_nb1 = 0.5*0.14e-15*V(LCP)*V(LCP)*230e-12;
                 
           I(LCP,CTLP)<+ ddt(capa_p1);
           I(LCN,CTLP)<+ ddt(capa_p2);
           I(CTLN,LCP)<+ ddt(capa_n1);
           I(CTLN,LCN)<+ ddt(capa_n2);                  

           I(CTLP) <+ ddt(capa_pb1);                  
           I(LCN)  <+ ddt(capa_nb2);                  
           I(LCP)  <+ ddt(capa_nb1);                  
           I(CTLP)<+ 10e-12*ddt(V(CTLP));
           I(CTLN)<+ 10e-12*ddt(V(CTLN));
           I(VDD)<+ 20e-12*ddt(V(VDD));

           if((V(LCP) > 2*vthn)&&(V(hold)<0.5)) begin
                 I(hold2)<+ 1e3*(V(hold2)-0.001);
           end else if((V(LCP) < vdd-2*vthp)&&(V(hold)>0.5)) begin
                 I(hold2)<+ -1e3*(1.8-V(hold2));
           end

           if((V(LCP) > vdd-2*vthp)&&(V(hold)<0.6)) begin
                 I(hold)<+ -1e3*(1-V(hold));
           end else if((V(LCP) < 2*vthn)&&(V(hold)>0.4)) begin
                 I(hold)<+ 1e3*V(hold);
           end

           $bound_step(0.02/1.22e9);
           V(OUT)       <+ transition(V(hold2),0,trise,tfall);
     end
     
endmodule

Title: Re: convergence difficulties in SpectreRF
Post by Frank Wiedmann on Oct 17th, 2002, 12:09pm

I have not analyzed your model in detail but you might want to try replacing your exp functions with the limexp (or $limexp) function. I had convergence problems in the past when I used the "normal" exp function.

Title: Re: convergence difficulties in SpectreRF
Post by Ken Kundert on Oct 17th, 2002, 10:21pm

This model is pretty complicated. You might consider simplifying it until it works properly, and then adding things back one at a time to try to identify the culprit. Some of the first things I would consider eliminating are the diodes and the varactors - both look to be implemented using very nonlinear expressions and so could likely be the cause of your convergence problems. Frank's suggestion is a good one, replace calls to exp() with calls to limexp().

I notice that in the conditionals where you are setting the voltage on the hold and hold2 capacitors you are using a 1 milliohm resistor. That seems extreme, especially for a current formulation (i = f(v)). Consider increasing the resistance to at least an ohm or converting to a voltage formulation (v = f(i)).

I don't understand your circuit, so this next comment may be off base, but I am a little worried about the transition function at the end. It looks like its argument might be a continuously varying function of time. That would not be a good thing. Consider eliminating the transition function and see if things get better. Then observe V(hold2). If it is not piecewise constant, you will need to do something different.

-Ken

Title: Re: convergence difficulties in SpectreRF
Post by YFUSA on Oct 17th, 2002, 11:43pm

I simplified my model and managed to simulate it in moderate pss when I didn't use the hold signal.
When I increased my 1 milliohm resistors to 1 ohm on the hold signals, it was still working!
I also replaced exp by limexp to make sure it won't provide me convergence problems later.
For the transition function, I had planed to remove it later.

Thanks for your answers!

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.