The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 10:14pm
Pages: 1
Send Topic Print
time step management (Read 3199 times)
spinfab
Junior Member
**
Offline



Posts: 10

time step management
Jun 20th, 2013, 1:32am
 
Hello,

In my verilgA code I would like to manage time step, instead of setting it in the simulator.
indeed I would like to improve the accuracy at some point by reducing times tep.

Is it possible in verilogA

regards,

Fab
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: time step management
Reply #1 - Jun 24th, 2013, 5:37am
 
Hello spinfab,
Quote:
In my verilgA code I would like to manage time step, instead of setting it in the simulator.
Yes: $bound_step.

- B O E
Back to top
 
 
View Profile   IP Logged
spinfab
Junior Member
**
Offline



Posts: 10

Re: time step management
Reply #2 - Jun 25th, 2013, 6:02am
 
thanks, but I think I will use @cross, to have a kind of dynamic time step adaptation.

fab
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: time step management
Reply #3 - Jul 5th, 2013, 10:59am
 
Why don't you leave time step control to the simulator? It should be much better at it than you could be. You should limit your self to just informing the simulator of things that it cannot know. There are only a few situations where you really need to give involved in time step selection. They are:

1. If your module is producing a high frequency signal, particularly sine waves, without having a high frequency. Here you need to use $bound_step to inform the simulator of the Nyquist rate for the signal. Typically telling the simulator to take 3-10 points per cycle is sufficient.
2. If your module produces a signal that changes abruptly, like a pulse, or if the module behavior changes abruptly, such as with switches. In this case you generally use an event (@(timer(...)) or @(cross(...))) to force the simulator to place a time point at the time of the abrupt change.
3. If you module is sensitive to a threshold crossing. In this case you would use and @(cross(...)) to accurately resolve the threshold crossing.

That is basically it. If you are not in one of the above situations, you should not be trying to control the time point selection from within Verilog-A. Instead, if you do not feel like you are getting accurate enough results you should tighten reltol. Many people try to control accuracy of a simulation by setting maxstep, but that is a very poor approach.

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