The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> What function is available in a sine wave measurement?
https://designers-guide.org/forum/YaBB.pl?num=1428473936

Message started by ruwan2 on Apr 7th, 2015, 11:18pm

Title: What function is available in a sine wave measurement?
Post by ruwan2 on Apr 7th, 2015, 11:18pm

Hi,
I need to write a AMS code to synchronize a sine wave phase. That is, the code measure the value of a phase not known sine wave. After it measures for some periods of the sine wave, it outputs a pulse at the maximum sine magnitude. Of course, the accuracy depends on the sine wave SNR to the noise. Now, I only consider no noise case to make it simpler.

Because I am new to verilog-AMS, I would get help from you on beginning my work. Are there some functions helpful to the problem? What procedures and partition to the problem? This question is all from my personal interest. I can provide any info if you think that is required in the discussion.


Thanks,

Title: Re: What function is available in a sine wave measurement?
Post by Ken Kundert on Apr 8th, 2015, 10:28am

You probably want to take a look a the models on the Verilog-AMS page, particularly the period measurement models.

-Ken

Title: Re: What function is available in a sine wave measurement?
Post by ruwan2 on Apr 15th, 2015, 7:04am

When I try to use the example code with period measurement, it is found that the EDA software does not support last_crossing() function. I would like to know whether there is a method to work around it. That is, to save the present crossing time for future use. In C language, there is a static variable can work. In verilog-AMS, is there a similar struct for this purpose?


Thanks,

Title: Re: What function is available in a sine wave measurement?
Post by Ken Kundert on Apr 15th, 2015, 10:28am

Which simulator are you using? last_crossing is pretty simple functionality, I am surprised they would leave it out.

You can delete last_crossing() and just output the time of the crossing as measured by $abstime. However, it is less accurate. Alternatively, you can add code to do the linear interpolation yourself.

You should complain to your simulator vendor. They won't provide what you need unless you tell them what you need.

-Ken


The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.