| Link for ModelSim | ![]() |
You can control the callback timing of a MATLAB test bench function by using that function's tnext input parameter. This parameter passes a time value to ModelSim, which gets added to the MATLAB function's simulation schedule. If the function returns a null value ([]) , no new entries are added to the schedule.
You can set the value of tnext to a string or value of type double or int64. The following table explains how the interface converts each type of data for use in the ModelSim environment.
Time Representations for tnext Parameter
| If You Specify a... | The Interface... |
|---|---|
| String that includes a unit specification | Parses the string as a scaled time value with units of fs (femtoseconds), ps (picoseconds), ns (nanoseconds), us (microseconds), ms (milliseconds),
or sec (seconds). The value is scaled to the nearest multiple
of the current time value resolution. For example, the following string scales
to the simulation time nearest to 12.2 nanoseconds as a multiple of the current
ModelSim time resolution.tnext = '12.2 nsec' |
| String that does not specify units | Parses the string as the number of ticks based on the ModelSim time
resolution limit. For example, the following string parses to 100 ticks of
the current time resolution.tnext = 'le2' |
| double value | Converts the value to seconds. For example, the following value converts
to the simulation time nearest to 1 nanosecond as a multiple of the current
ModelSim time resolution.tnext = 1e-9 |
| int64 value | Converts to an integer multiple of the current ModelSim time resolution
limit. For example, the following value converts to 100 ticks of the current
time resolution.
tnext=int64(100) |
Note The tnext parameter represents time from the start of the simulation. Therefore, tnext should always be greater than tnow. |
| Deciding on Test Bench Scheduling Options | Initializing the Simulator for a MATLAB Test Bench Session | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |