The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 2:40pm
Pages: 1
Send Topic Print
convergence difficulties in SpectreRF (Read 1260 times)
YFUSA
New Member
*
Offline

Success isn't
permanent, and
failure isn't fatal

Posts: 4
Paris, FRANCE
convergence difficulties in SpectreRF
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
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: convergence difficulties in SpectreRF
Reply #1 - 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
Back to top
 
 
View Profile WWW   IP Logged
YFUSA
New Member
*
Offline

Success isn't
permanent, and
failure isn't fatal

Posts: 4
Paris, FRANCE
Re: convergence difficulties in SpectreRF
Reply #2 - 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
 

Back to top
 
 
View Profile   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 677
Munich, Germany
Re: convergence difficulties in SpectreRF
Reply #3 - 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.
Back to top
 
 
View Profile WWW   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: convergence difficulties in SpectreRF
Reply #4 - 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
Back to top
 
 
View Profile WWW   IP Logged
YFUSA
New Member
*
Offline

Success isn't
permanent, and
failure isn't fatal

Posts: 4
Paris, FRANCE
Re: convergence difficulties in SpectreRF
Reply #5 - 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!
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.