Uvm Test Termination
Uvm Test Termination
Uvm Test Termination
Terminating Tests
Compiling designs & running UVM - overview
1. Non-Stopping Threads
Non-Stopping threads are run() tasks that either execute their code without
issuing a stop command or are run() tasks with a forever loop that never ends.
A run() task that does not make a call to global_stop_request() or that does not
raise any objections would be a non-stopping thread.
2. Stop-Request Threads
Stop-Request threads are run() tasks that call the global_stop_request()
command inside of the run() task. If there are no Objections-Raised threads, the
run() phase will immediately process the stop_request(), terminate the Active
Stage and start the Stop-Interrupt Stage if any of the enable_stop_interrupt bits
were set in any of the run() phase threads.
If there are any Objections-Raised threads, the global_stop_request()
command is largely ignored. For this reason, using the global_stop_request()
command is largely discouraged as a way to terminate the Active Stage of the
run() phase. It only takes is a single Objections-Raised thread to invalidate all
of the global_stop_request() commands in all of the Stop-Request threads.
3. Objections-Raised Threads
A run() task that calls uvm_test_done.raise_objection(), is
specifying that it "objects to the termination of the Active Stage of
the run() phase," until the objection is dropped using the
uvm_test_done.drop_objection() command. Dropping all
objections will issue an immediate and implicit stop_request(),
even if there is a free-running forever-loop in a Non-Stopping
thread.
4. Enabling Stop-Interrupts In Threads
To interrupt the stoppage of the run() phase requires that a thread set the
enable_stop_interrupt bit, typically at the beginning of the run() task.
Once the enable_stop_interrupt bit is set, the thread will also execute a
stop() task in the Stop-Interrupt Stage.
HOW UVM SIMULATIONS WORK
import uvm_pkg::*;
package uvm_pkg;
`include "uvm.svh"
endpackage
uvm.svh file itself includes-
//`include "uvm_macros.svh"
`include "base/base.svh"
//`include "uvm_tlm/uvm_tlm.svh"
//`include "methodology/methodology.svh"
When the run() phase starts, a parallel timeout timer is also started.
If the timeout timer reaches one of the specified timeout limits before
the run() phase completes, the run() phase will timeout and:
All run() tasks will be immediately disabled.
1. A timeout message will be issued.
2. Execution of the post-run() phases will begin.
There are two timeout counters that may become active during the
run() phase and their timeout limits
are kept in the variables uvm_top.phase_timeout and
uvm_top.stop_timeout.
The phase_timeout is the time that the entire run() phase
(ActiveStage and Stop-Interrupt Stage) is allowed to run before
timing out. The phase_timeout is often referred to as the
global_timeout limit. If the phase_timeout time limit is reached,
a UVM_ERROR will be reported.
The default value for the phase_timeout limit is set from the
`UVM_DEFAULT_TIMEOUT macro and has a default timeout
value of 9200 seconds. This value can be shortened by using the
set_global_timeout() command.
As part of the run() phase, various components of a test might
execute stop() tasks in the Stop-Interrupt Stage. The maximum
execution time of the stop() tasks is stored in the stop_timeout
limit and can be controlled by the set_global_stop_timeout()
command. The default stop_timeout value is also 9200 seconds.
The stop_timeout is often referred to as the global_stop_timeout
limit.