The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 29th, 2024, 4:10am
Pages: 1
Send Topic Print
What function is available in a sine wave measurement? (Read 2951 times)
ruwan2
Junior Member
**
Offline



Posts: 15

What function is available in a sine wave measurement?
Apr 07th, 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,
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: What function is available in a sine wave measurement?
Reply #1 - 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
Back to top
 
 
View Profile WWW   IP Logged
ruwan2
Junior Member
**
Offline



Posts: 15

Re: What function is available in a sine wave measurement?
Reply #2 - 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,
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: What function is available in a sine wave measurement?
Reply #3 - 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

Back to top
 
 
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.