The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> A capacitance with a second-order input https://designers-guide.org/forum/YaBB.pl?num=1220197822 Message started by ChinFu on Aug 31st, 2008, 8:50am |
Title: A capacitance with a second-order input Post by ChinFu on Aug 31st, 2008, 8:50am Hi: Recently, I need to simulate a capacitance with a second-order voltage input (451.47+4.9*V-0.0143*V^2). For V=sin(1000*t), C=2 pf and a RL=1M ohm, we can get I=RL*d(c*v)/dt, and the pick of the Vout is ≈ 9.8 mV. However, by using spectre, I got different results. In first approach, I used verilog-a to built a capacitance model. `include “discipline.vams” module varactor(p, n); inout p, n; electrical p, n; parameter real c = 2p; parameter real a0 = 451.47; parameter real a1 = 4.9; parameter real a2 = -0.0143; real q, v; analog begin v = V(p,n); q = a0+a1*v+a2*pow(v,2); I(p, n) <+ c*ddt(q); end endmodule This can be compiled in verilog-a, but can not run in spectre. If I modify the input to 1 order (q = a0+a1*v; since a2 is much smaller than a1), it can run in spectre. However, the pick of Vout is ≈62 mV. Furthermore, if I the RL is increased, the Vout wil be increased lineraly until 5V (like a saturation phenomenon). In the second approach, I used an adder (built by verilog-a), a multiplication (built by verilog-a) and voltage sources to synthetize a second-order input in spectre. The synthetized signal is connected to a common capacitance, and also a load resistance is connected to the capacitance in the other side. The simulation result ( in spectre) show that the pick of Vout is ≈60mV. However, simular to approach 1, as the Rl increasing, the Vout is increasing until 5 V and saturated. Could someone tell me 1. Why the simulation result is 60 mV but not 9.8 mV ? 2. Why did the "saturation phenomenon" occur ? 3. How to built a second-order input capacitance that can be used in spectre (approach 1 ) ? Thnaks a lot. |
Title: Re: A capacitance with a second-order input Post by Geoffrey_Coram on Sep 3rd, 2008, 8:26am I don't see any reason that model shouldn't run in Spectre -- are you using a current version? Does it fail in the middle of the sim, or it won't even start? Are you trying transient or dc? I would suggest: q = c * (a0 + a1*v + a2*v*v); // or c * (a0 + v*(a1 * v*a2)); I(p,n) <+ ddt(q); but that shouldn't make a difference. |
Title: Re: A capacitance with a second-order input Post by ChinFu on Sep 22nd, 2008, 2:18am Dear Geoffrey: Thanks a lot for your reply :) ChinFu |
Title: Re: A capacitance with a second-order input Post by Geoffrey_Coram on Sep 23rd, 2008, 7:03am You're welcome -- but I (and other readers of this forum) are probably curious whether my suggestion was the fix, or if there was something else you did to get it to work. |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |