wchlee
New Member
Offline
Posts: 4
Taiwan
|
Hello:
I write a multi-tone voltage source(up to 5 harmonics) in verilog-A to simulate the impact of high order harmonic contents in divider phase noise. But I have problems in PSS convergence when using "oscillator" to find beat frequency nor specify beat frequency as driven ckts, both failed to converge. Could anyone show me how to to? my code is listed below: `include "constants.h" `include "discipline.h"
module multitone_gen(PLUS,MINUS); output PLUS, MINUS; electrical PLUS,MINUS;
parameter real tt=10p from(0:inf); parameter real ttol=1p from (0:inf); parameter real f_fund=2e9; parameter real vpk_fund=1; parameter real dBc_2nd=10; parameter real dBc_3rd=10; parameter real dBc_4th=10; parameter real dBc_5th=10;
real v_minus; real phase_fund; real phase_2nd; real phase_3rd; real phase_4th; real phase_5th; real vpk_2nd; real vpk_3rd; real vpk_4th; real vpk_5th;
analog begin v_minus=V(MINUS); vpk_2nd=vpk_fund*pow(10,dBc_2nd/20); vpk_3rd=vpk_fund*pow(10,dBc_3rd/20); vpk_4th=vpk_fund*pow(10,dBc_4th/20); vpk_5th=vpk_fund*pow(10,dBc_5th/20); phase_fund=2*`M_PI*idtmod(f_fund,0,1,-0.5); phase_2nd=2*`M_PI*idtmod(2*f_fund,0,1,-0.5); phase_3rd=2*`M_PI*idtmod(3*f_fund,0,1,-0.5); phase_4th=2*`M_PI*idtmod(4*f_fund,0,1,-0.5); phase_5th=2*`M_PI*idtmod(5*f_fund,0,1,-0.5); V(PLUS)<+ v_minus+vpk_fund*cos(phase_fund)+vpk_2nd*cos(phase_2nd)+vpk_3rd*cos(phase_3rd)+v pk_4th*cos(phase_4th)+vpk_5th*cos(phase_5th); $bound_step(1.0/(500*f_fund)); end endmodule
|