The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 4:54am
Pages: 1
Send Topic Print
Timer function with tolerance parameter (Read 1312 times)
nthoangga
New Member
*
Offline



Posts: 4

Timer function with tolerance parameter
Jul 24th, 2019, 9:45am
 
Hi, Here is the timer function documentation:

timer(time[, period][, ttol][, enable])

Parameters
time (real) – time of needed evaluation point
period (real) – period or repetion
ttol (real) – time tolerance
enable (real) – enable

Only 'time' is required, other parameters are optional.
If I want to provide 'ttol' parameter, but don't have a need for 'period', how could I do it?

One idea is just to give a very big value for 'period' (ex. period=10). But is there any other ways around it?
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Timer function with tolerance parameter
Reply #1 - Jul 24th, 2019, 11:12am
 
Don't know for sure, but you might want to try:

Code:
timer(1u, ttol(1n)) 


or

Code:
timer(1u,,1n) 



-Ken
Back to top
 
 
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Timer function with tolerance parameter
Reply #2 - Jul 25th, 2019, 5:11am
 
It seems like the syntax should be

timer(time [, [period] [, [tol] [, [enable]]]] )

instead of

timer(time[, period][, ttol][, enable])

if null/missing arguments are supported.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Timer function with tolerance parameter
Reply #3 - Jul 25th, 2019, 5:13am
 
Actually, Annex A of the Verilog-AMS Language Reference Manual version 2.4 has:

timer ( analog_expression [ , analog_expression_or_null
[ , constant_expression_or_null [ , analog_expression ] ] ] )

and it's clear that null arguments are allowed (per the syntax - your simulator may not be fully compliant).
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
nthoangga
New Member
*
Offline



Posts: 4

Re: Timer function with tolerance parameter
Reply #4 - Jul 25th, 2019, 3:26pm
 
Ken Kundert wrote on Jul 24th, 2019, 11:12am:
Don't know for sure, but you might want to try:

Code:
timer(1u, ttol(1n)) 


or

Code:
timer(1u,,1n) 



-Ken


Just to confirm the comments above, first method does not work. Second method works.
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Timer function with tolerance parameter
Reply #5 - Jul 25th, 2019, 4:34pm
 
Whoops. It should have been:

Code:
timer(1u, .ttol(1n)) 


I was missing the period before ttol. Even then it might not work. I don't know whether named arguments are supported for functions and tasks.

-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.