I tried to build pll linear model in cadence spectre. but when i do ac simulation, I found that the magnitude of the bode response plot is different from that I got from matlab simulink model, why there is this diference?
in the figure below, the bode plot of these three model are the same.
and the veriloga model is:
Code:// VerilogA for pllveriloga, plltransferfunction, veriloga
`include "constants.vams"
`include "disciplines.vams"
module plltransferfunction(in,out);
input in;
output out;
electrical in,out;
parameter ICP=125u from(0:inf);//charge pump current
parameter R1=33K from(0:inf);//loop filter R1
parameter C1=161p from(0:inf);//loop filter C1
parameter C2=2p from(0:inf);//loop filter C2
parameter R3=36K from(0:inf);//loop filter R3
parameter C3=2p from(0:inf);//loop filter C3
parameter KVCO=40M from(0:inf);// vco gain(MHz/V)
parameter N=115 from(0:inf);//divider ratio
real K,a1,a0,b4,b3,b2,b1,b0;
real a[0:1];
real b[0:4];
analog begin
K=KVCO*2*3.1415926*ICP/2/3.1415926/N;
a1=K*R1*C1;
a0=K*1;
b4=R1*R3*C1*C2*C3;
b3=R1*C1*(C2+C3)+R3*C3*(C1+C2);
b2=(C1+C2+C3);
b1=0;
b0=0;
a[1]=a1;
a[0]=a0;
b[4]=b4;
b[3]=b3;
b[2]=b2;
b[1]=b1;
b[0]=b0;
//V(out)<+ laplace_nd(V(in),{a0,a1},{b0,b1,b2,b3,b4});//this expression can't work because laplace function can't handle varible, it must be in vector version
V(out)<+ laplace_nd(V(in),a,b);
//V(out)<+ laplace_nd(V(in),{41,2.6e-4},{0,0,2.41e-10,1.1e-16,3.74e-24});
end
endmodule