Inheritance diagram for class svt_timer:
This class provides basic timer capabilities. The client uses this timer to watch for a timeout, after which a notification is generated. If the specified activities occur before the timeout expiry, the client can avoid the timeout by stopping the timer.
The timer also accepts an optional svt_err_check object at construction. If provided, this check instance is used to register a timeout check and to flag successes and failures relative to the timeout check.
The timer is started by calling start_timer with timeout value. The timer is started immediately, and allowed to run until the timer expires or the timer is stopped.
Once the timer has been stopped or has expired, the timer stops execution. In the total absence of activity, the timer will not indicate a timeout condition. The timer must be restarted by a new call to start_timer, or by a call to restart_timer.
Public Member Functions | |
| function void | calibrate ( longint client_ns ) |
| task | do_delay ( real delay_value ) |
| function real | get_expired_time ( ) |
| function real | get_fuse_length ( ) |
| function string | get_instance ( ) |
| function real | get_remaining_time ( ) |
| function real | get_start_time ( ) |
| function real | get_stop_time ( ) |
| function string | get_suite_name ( ) |
| function void | init ( svt_err_check check = null, ovm_report_object reporter = null ) |
| function bit | is_active ( ) |
| function void | new ( string suite_name, string inst, svt_err_check check = null, ovm_report_object reporter = null ) |
| function void | reset ( ) |
| function void | restart_timer ( string reason = "" ) |
| function void | set_instance ( string inst ) |
| function void | set_timeout_sev ( svt_types :: severity_enum sev ) |
| function void | start_finite_timer ( real positive_fuse_value, string reason = "" ) |
| function void | start_infinite_timer ( real positive_fuse_value, string reason = "" ) |
| function void | start_timer ( real positive_fuse_value, string reason = "", bit zero_is_infinite = 1, bit allow_restart = 0 ) |
| function void | stop_timer ( string reason = "" ) |
| task | track_timeout_forever ( ) |
| task | wait_for_timeout ( output bit timed_out ) |
Public Attributes | |
| ovm_event | EXPIRED |
| ovm_report_object | reporter |
| ovm_event | STARTED |
| ovm_event | STOPPED |
| ovm_event | TIMEOUT |
| ovm_severity | timeout_sev = OVM_WARNING; |
| ovm_verbosity | timeout_verb |
Protected Member Functions | |
| task | main ( bit zero_is_infinite ) |
Protected Attributes | |
| protected string | suite_name = ""; |
|
||
As the SVT library may be accessed by multiple VIP and testbench clients, possibly with timescale settings which differ from each other and/or which differ from the SVT timescale, the svt_timer includes a scaling factor to convert from the client timescale to the SVT timescale.
This method sets the scaling factor for time literal logic. All clients that use svt_timer instances must call this method with a value of '1ns' before using these timers. This calibrates the timers so that they can convert client provided time literal values (i.e., interpreted using the client timescale) into values consistent with the timescale being used by the SVT package. |
|
||
Method which actually implements the delay. By default implemented to just do a time unit based celay. Extended classes could override this method to implement cycle or other types of delays.
|
|
||
If the timer is active, returns the time delta between the current time and the start time. Otherwise returns 0.
|
|
||
Returns the current fuse_length.
|
|
||
Returns the instance name of this object.
|
|
||
If the timer is active, returns the time delta between the current time and the expected stop time. Otherwise returns 0.
|
|
||
If the timer is active, returns the current start time. Otherwise returns 0.
|
|
||
If the timer is active, returns the current stop time. Otherwise returns 0.
|
|
||
Returns the suite name associated with the timer.
|
|
||
|
||
Returns 1 if timer is running, 0 otherwise
|
|
||
Block for fuse_length time delay
|
|
||||
Creates a new instance of this class.
suite_name - A String that identifies the product suite to which the transaction object belongs. inst - The name of the timer instance, for its logger. check - Provides access to a checker package to track the success/failure of the timer. reporter - A component through which messages are routed | ||||
|
|
||
Resets the contents of the object.
|
|
||
Retart the timer, using the current fuse_length, as specified by the most recent call to any of the start_timer methods. reason - String that describes the reason for the restart, and which is used to indicate the restart reason in the restart messages. |
|
||
Sets the instance name of this object.
|
|
||
Set the message verbosity associated with timer timeout. This method takes care of the methodology specific severity settings.
sev - The severity level to be established. |
|
||
Start the timer, setting up a timeout based on positive_fuse_value. For this timer, a positive_fuse_value of 0 results in an immediate timeout. positive_fuse_value - The timeout time, interpreted by the do_delay method. reason - String that describes the reason for the start, and which is used to indicate the start reason in the start messages. |
|
||
Start the timer, setting up a timeout based on positive_fuse_value. For this timer, a positive_fuse_value of 0 results in an infinite timeout. positive_fuse_value - The timeout time, interpreted by the do_delay method. reason - String that describes the reason for the start, and which is used to indicate the start reason in the start messages. |
|
||||||
Start the timer, setting up a timeout based on positive_fuse_value. If timer is already active and allow_restart is 1 then the positive_fuse_value and zero_is_infinite fields are used to update the state of the timer and then a restart is initiated. If timer is already active and allow_restart is 0 then a warning is generated and the timer is not restarted. positive_fuse_value - The timeout time, interpreted by the do_delay method. reason - String that describes the reason for the start, and which is used to indicate the start reason in the start messages. zero_is_infinite - Indicates whether a positive_fuse_value of zero should be interpreted as an immediate (0) or infinite (1) timeout request. allow_restart - When set to 1, allow a restart if the timer is already active. | ||||||
|
|
||
Stop the timer. reason - String that describes the reason for the stop, and which is used to indicate the stop reason in the stop messages. |
|
||
Method to track a timeout forever, flagging timeouts if and when they occur.
|
|
||
Watch out for the EXPIRED or STOPPED indication.
timed_out - Indicates whether the method is returning due to a timeout (1) or due to the timer being stopped (0). |
|
|
Event used to indicate that the timer has expired. The event is an ON_OFF event and is reset whenever the timer is restarted.
|
|
|
Component through which messages are routed.
|
|
|
Event used to indicate whether the timer is active. The event is an ON_OFF event.
|
|
|
Event used to indicate that the timer has been stopped. The event is an ON_OFF event and is reset whenever the timer is restarted.
|
|
|
Identifies the product suite with which a derivative class is associated. Can be accessed through 'get_suite_name', but cannot be altered after object creation.
|
|
|
Event used to indicating a timeout event. The event is a ONE_SHOT event. A message is also issued, with the severity of the message controlled by the timeout_sev data field.
|
|
|
Public data member which can be modified to change the severity of the timeout message when timeout_verb is MEDIUM (i.e., when the timeout message is a 'warning' or 'note' message. Defaults to the severity corresponding to a 'warning' message.
|
|
|
Public data member which can be modified to change the verbosity of the timeout message. Defaults to the verbosity corresponding to a 'warning' or 'note' message.
|