The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> time step management
https://designers-guide.org/forum/YaBB.pl?num=1371717167

Message started by spinfab on Jun 20th, 2013, 1:32am

Title: time step management
Post by spinfab on 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

Title: Re: time step management
Post by boe on 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

Title: Re: time step management
Post by spinfab on Jun 25th, 2013, 6:02am

thanks, but I think I will use @cross, to have a kind of dynamic time step adaptation.

fab

Title: Re: time step management
Post by Ken Kundert on 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

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