Hi all,
I have a problem to get a Verilog-A signal source with two output tones to work in harmonic balance. So far my code looks more or less like this (deleted some calculations):
// VerilogA for
`include "constants.vams"
`include "disciplines.vams"
module emulator(out,gnd);
output out;
input gnd;
electrical out,gnd,internal1,internal2;
real freq1,freq2,amp1,amp2;
parameter real centerFreq = 70G;
parameter string fundname1 = "rf1";
parameter string fundname2 = "rf2";
analog begin
freq1 = 10M;
freq2 = 100M;
amp1=1;
amp2=1;
$cds_set_rf_source_info ( fundname1, centerFreq + freq1);
V(out,internal1) <+ (amp1)*sin(2*`M_PI*(centerFreq+freq1)*$abstime));
if (twoTargets>0)
begin
$cds_set_rf_source_info ( fundname2, centerFreq + freq2);
V(internal1,internal2) <+ (amp2)*sin(2*`M_PI*(centerFreq+freq2)*$abstime);
end
else
V(internal1,internal2) <+ 0;
V(internal2,gnd) <+ 50*I(internal2,gnd);
$bound_step(0.01/(centerFreq+freq1));
end
endmodule
With the help of a blog post I am able to make a signle source run in transient and Harmonic Balance. However when I try to use 2 sources harmonic balance will not calculate the correct results!
What am I doning wrong here? How to use $cds_set_rf_spurce_info() correct in my case?
Thanks in advance!