[source]

Class uvm_tlm_time

Canonical time type that can be used in different timescales

This time type is used to represent time values in a canonical form that can bridge initiators and targets located in different timescales and time precisions.

For a detailed explanation of the purpose for this class, see <Why is this necessary>.

Constructors

function new ( string name, real res ) [source]

Create a new canonical time value.

The new value is initialized to 0. If a resolution is not specified, the default resolution, as specified by set_time_resolution(), is used.

Functions

static function void set_time_resolution ( real res ) [source]

Set the default canonical time resolution.

Must be a power of 10. When co-simulating with SystemC, it is recommended that default canonical time resolution be set to the SystemC time resolution.

By default, the default resolution is 1.0e-12 (ps)

function string get_name ( ) [source]

Return the name of this instance

function void reset ( ) [source]

Reset the value to 0

function real get_realtime ( time scaled, real secs ) [source]

Return the current canonical time value, scaled for the caller's timescale

scaled must be a time literal value that corresponds to the number of seconds specified in secs (1ns by default). It must be a time literal value that is greater or equal to the current timescale.

#(delay.get_realtime(1ns));
#(delay.get_realtime(1fs, 1.0e-15));
function void incr ( real t, time scaled, real secs ) [source]

Increment the time value by the specified number of scaled time unit

t is a time value expressed in the scale and precision of the caller. scaled must be a time literal value that corresponds to the number of seconds specified in secs (1ns by default). It must be a time literal value that is greater or equal to the current timescale.

delay.incr(1.5ns, 1ns);
delay.incr(1.5ns, 1ps, 1.0e-12);
function void decr ( real t, time scaled, real secs ) [source]

Decrement the time value by the specified number of scaled time unit

t is a time value expressed in the scale and precision of the caller. scaled must be a time literal value that corresponds to the number of seconds specified in secs (1ns by default). It must be a time literal value that is greater or equal to the current timescale.

delay.decr(200ps, 1ns);
function real get_abstime ( real secs ) [source]

Return the current canonical time value, in the number of specified time unit, regardless of the current timescale of the caller.

secs is the number of seconds in the desired time unit e.g. 1e-9 for nanoseconds.

$write(&quot;%.3f ps\n&quot;, delay.get_abstime(1e-12));
function void set_abstime ( real t, real secs ) [source]

Set the current canonical time value, to the number of specified time unit, regardless of the current timescale of the caller.

secs is the number of seconds in the time unit in the value t e.g. 1e-9 for nanoseconds.

delay.set_abstime(1.5, 1e-12));