mady79
New Member
Offline
Posts: 5
|
Thanks Ken for your prompt reply . $abstime() helps a lot .
I am posting complete code for your reference .I would like to know how to get convergence problem solved may be using intial conditions . I did the same modeling with analog lib components using voltage controlled current source,resitors and capacitors ,it worked fine there but not sure why ams does not work .
`timescale 1ns/100ps `include "constants.vams" `include "disciplines.vams"
module vparabola (vpard,clk,vdd,vss ); input clk,vdd,vss; //clk -->clock ,vdd-->supply electrical clk,vdd,vss; output vpard; electrical vpard;
real clk_i,clkdel_i,rstphase;//rstphase used to make parabola starts from zero voltage electrical vinta,vintb;
real itempa,itempb; analog begin @(cross(V(clk,vss)-V(vdd,vss)/2,0,1n,10m) or initial_step) clk_i = (V(clk,vss)>V(vdd,vss)/2 ? 1 : 0); clkdel_i=transition(clk_i,5n,1n,1n); rstphase = clk_i*(1-clkdel_i); itempa= V(vdd,vss)/10e+6; I(vdd,vinta)<+itempa; I(vinta,vss)<+0.5p*ddt(V(vinta,vss)); I(vinta,vss)<+rstphase*V(vinta,vss)/100; //expect a voltage ramp as output proportional to t(time) ; itempb= V(vinta,vss)/100k; I(vdd,vintb)<+itempb; I(vintb,vss)<+0.5p*ddt(V(vintb,vss)); I(vintb,vss)<+rstphase*V(vintb,vss)/100; //expect a voltage parabola proportional to t^2 V(vpard,vss)<+transition(V(vintb,vss),1n,1n,1n); end endmodule //Thanks in advance ...
|