Reset Testing in UVM: phase.jump() With a Working Example
In short: To test a reset in the middle of traffic in UVM, run your traffic in main_phase, stop the sequences, then call phase.jump(uvm_pre_reset_phase::get()). Every component in the UVM domain goes back to pre_reset_phase and your reset driver asserts reset again in reset_phase. Drivers and monitors live in run_phase, which a jump never restarts, so they watch the reset pin and clean up on their own.
A chip that works after power-on but breaks after a second reset is a real bug, and a common one. Most testbenches apply reset once, at time 0, so that bug walks straight past them.
In this lesson we build a small accumulator bench that resets halfway through traffic and checks every step after it. I ran it on Synopsys VCS, and my first run failed in two instructive ways, so you get those too.
What you will learn
- What the 12 UVM run-time phases are and how they sit next to
run_phase. - How
phase.jump()works, and what it does and does not restart. - How to make drivers, monitors and scoreboards survive a mid-traffic reset.
- The other ways to test reset, and when each one fits.
- Two real failures from my first VCS run, and how to fix them.
Cheat sheet: mid-traffic reset in 5 rules
| Rule | Where | Why |
|---|---|---|
| 1. Drive reset in a phase task | reset_phase | It runs again after every jump back |
| 2. Run traffic in a phase task | main_phase | A jump ends it and its sequences |
| 3. Stop sequences, then jump | stop_sequences(), then phase.jump(uvm_pre_reset_phase::get()) | No zombie request is left on the sequencer |
| 4. Watch the pin in drivers and monitors | run_phase | A jump never restarts run_phase |
| 5. Clear models when the DUT sees reset | On the reset your monitor reports | The DUT keeps working until reset reaches its clock edge |
The UVM run-time phases
run_phase runs from the start to the end of the test. Next to it, the UVM domain runs 12 sub-phases in order, and both start at the same time.
| Group | Sub-phases | Typical use |
|---|---|---|
| Reset | pre_reset, reset, post_reset | Assert and release reset |
| Configure | pre_configure, configure, post_configure | Program registers, set modes |
| Main | pre_main, main, post_main | The test traffic |
| Shutdown | pre_shutdown, shutdown, post_shutdown | Drain outstanding work, final checks |
- Each sub-phase is a task that ends when every objection raised in it is dropped.
- All components move together: no one starts
mainwhile another is still inreset. run_phaseis in a separate schedule, so it keeps running whatever the sub-phases do.
main replays every sub-phase from pre_reset. run_phase carries on untouched.How phase.jump() works
- The call: inside a phase task,
phase.jump(uvm_pre_reset_phase::get());on thephaseargument you were given. - What ends: the current sub-phase, for every component in the domain. VCS printed
[PH_JUMP] phase main (schedule uvm_sched, domain uvm) is jumping to phase pre_reset. - What runs again: every sub-phase from the target forward:
pre_reset,reset,post_reset, configure, thenmain. - What it leaves alone:
run_phase. Your driver and monitor never see the jump. They only see the reset pin. - Objections: my test still held its
main_phaseobjection when it jumped. VCS ended the phase anyway, with no hang and no objection error.
Analogy: a phase jump is like a referee restarting a volleyball rally. Everyone goes back to their starting positions, but a ball already in the air does not vanish by itself. Your driver and monitor are the players who must notice the whistle (the reset pin) and stop chasing that ball.
Ways to test reset, and when each fits
| Method | How | Best for | Watch out for |
|---|---|---|---|
| Reset only at time 0 | One reset_phase pass | Every test, as a baseline | Never finds a second-reset bug |
| Phase jump (this lesson) | phase.jump() back to pre_reset | Block and subsystem benches that use run-time phases | Drivers, monitors and scoreboards must be reset-aware |
Reset sequence in run_phase | A virtual sequence drives reset, then restarts traffic | VIP and benches that avoid run-time phases | You write the restart order yourself |
| Separate domains | set_domain() on one sub-tree, jump only that domain | Resetting one IP while others keep running | Sync points between domains need care |
Both main styles need the same thing underneath: drivers, monitors and scoreboards that know what to do when reset arrives.
The working example: a reset in the middle of traffic
I ran this exact file on Synopsys VCS X-2025.06 with UVM 1.2. Every user name uses the tav_ prefix.
Run it yourself: the same file is on GitHub. Paste it into testbench.sv on EDA Playground, leave design.sv empty, pick VCS and UVM 1.2, and set the top module to tav_top.
| Piece | Phase | Job on reset |
|---|---|---|
tav_acc (DUT) | none | Synchronous active-low reset clears acc to 0 |
tav_reset_driver | reset_phase | Holds rst_n low for 3 clocks, on every pass |
tav_acc_driver | run_phase | Stops driving at negedge rst_n and flushes the sequencer |
tav_acc_monitor | run_phase | Reports reset on the cycle the DUT sees it, drops a half-captured step |
tav_acc_scoreboard | none (analysis write) | Clears its model when the monitor reports reset |
tav_reset_test | main_phase | Starts 16 steps, stops the sequences and jumps back after 8 |
Four details carry the whole bench:
- The driver uses
get(), notget_next_item().get()completes the item at once, so a reset can never cut off a pendingitem_done(). - The driver forks its drive loop against
@(negedge vif.rst_n), then callsdisable forkandstop_sequences()when reset wins. - The monitor sends a reset item the first cycle it samples
rst_nlow, so the scoreboard clears at the same edge as the DUT. - The test calls
stop_sequences()right beforephase.jump(), so the killed sequence leaves no request behind.
Planted bug: run with +BUG=1 and the scoreboard ignores the reset and keeps its old total.
// tav_reset_jump_uvm.sv : reset testing with UVM run-time phases and phase.jump(), a complete working example (UVM 1.2)
// The Art of Verification | theartofverification.com
// Run on Synopsys VCS X-2025.06-SP1 with UVM 1.2 (EDA Playground), 30 Nov 2026.
// EDA Playground: Synopsys VCS, UVM 1.2, top module "tav_top".
// Paste this whole file into testbench.sv and leave design.sv empty.
//
// What is in here:
// the design tav_acc: an 8-bit to 16-bit accumulator with a synchronous active-low reset.
// Every cycle valid is high, acc <= acc + data. Reset clears acc to 0.
// the interface tav_acc_if: pins plus drv_cb and mon_cb clocking blocks
// the UVM bench item, sequence, reset-aware driver and monitor (run_phase),
// a reset driver (reset_phase), a scoreboard that clears its model when the monitor sees reset,
// and a test that jumps from main_phase back to pre_reset_phase in the middle of traffic
//
// Run options:
// (none) the clean bench: one mid-traffic reset, then a full second pass, 0 errors
// +BUG=1 the scoreboard ignores reset and keeps its old total, so the first check after reset fails
`include "uvm_macros.svh"
// ================================ the design ================================
module tav_acc (
input logic clk,
input logic rst_n,
input logic valid,
input logic [7:0] data,
output logic [15:0] acc
);
always_ff @(posedge clk) begin
if (!rst_n) acc <= '0;
else if (valid) acc <= acc + data;
end
endmodule
// ================================ the interface ================================
interface tav_acc_if (input logic clk);
logic rst_n = 1'b0;
logic valid = 1'b0;
logic [7:0] data = '0;
logic [15:0] acc;
clocking drv_cb @(posedge clk);
default input #1step output #1;
output valid, data;
endclocking
clocking mon_cb @(posedge clk);
default input #1step;
input rst_n, valid, data, acc;
endclocking
endinterface
// ================================ the UVM bench ================================
package tav_reset_pkg;
import uvm_pkg::*;
`include "uvm_macros.svh"
// ---------------------------------------------------------------
// Transaction: one accumulate step
// ---------------------------------------------------------------
class tav_acc_item extends uvm_sequence_item;
`uvm_object_utils(tav_acc_item)
bit [7:0] data;
bit [15:0] acc; // filled by the monitor: acc after this step
bit is_reset; // set by the monitor on the first cycle the DUT is in reset
function new(string name = "tav_acc_item");
super.new(name);
endfunction
function string convert2string();
return is_reset ? "RESET" : $sformatf("data=%0d acc=%0d", data, acc);
endfunction
endclass
// ---------------------------------------------------------------
// Sequence: 16 back-to-back steps with data 1, 2, 3 ... 16
// ---------------------------------------------------------------
class tav_acc_seq extends uvm_sequence #(tav_acc_item);
`uvm_object_utils(tav_acc_seq)
function new(string name = "tav_acc_seq");
super.new(name);
endfunction
task body();
tav_acc_item tr;
for (int i = 1; i <= 16; i++) begin
tr = tav_acc_item::type_id::create("tr");
start_item(tr);
tr.data = 8'(i);
finish_item(tr);
end
endtask
endclass
// ---------------------------------------------------------------
// Driver: lives in run_phase, so phase jumps never kill it.
// It watches the reset pin itself and cleans up when reset arrives.
// ---------------------------------------------------------------
class tav_acc_driver extends uvm_driver #(tav_acc_item);
`uvm_component_utils(tav_acc_driver)
virtual tav_acc_if vif;
uvm_sequencer #(tav_acc_item) tav_sqr; // set by the agent, used to flush on reset
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
if (!uvm_config_db#(virtual tav_acc_if)::get(this, "", "vif", vif))
`uvm_fatal("TAV_NOVIF", {"No virtual interface for ", get_full_name()})
endfunction
task run_phase(uvm_phase phase);
forever begin
vif.drv_cb.valid <= 1'b0;
wait (vif.rst_n === 1'b1);
`uvm_info("TAV_DRV", "Reset released: driving", UVM_LOW)
fork
tav_drive_items();
@(negedge vif.rst_n);
join_any
disable fork;
// Reset arrived: forget anything queued on the sequencer
tav_sqr.stop_sequences();
`uvm_info("TAV_DRV", "Reset seen: stopped driving and flushed the sequencer", UVM_LOW)
end
endtask
// get() takes the item and completes it at once, so the sequencer
// never waits on an item_done() that a reset could cut off.
task tav_drive_items();
tav_acc_item tr;
forever begin
seq_item_port.get(tr);
@(vif.drv_cb);
vif.drv_cb.valid <= 1'b1;
vif.drv_cb.data <= tr.data;
@(vif.drv_cb);
vif.drv_cb.valid <= 1'b0;
end
endtask
endclass
// ---------------------------------------------------------------
// Monitor: also in run_phase. Ignores everything while reset is low,
// and drops a half-captured step if reset cuts it off.
// ---------------------------------------------------------------
class tav_acc_monitor extends uvm_monitor;
`uvm_component_utils(tav_acc_monitor)
virtual tav_acc_if vif;
uvm_analysis_port #(tav_acc_item) ap;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
ap = new("ap", this);
if (!uvm_config_db#(virtual tav_acc_if)::get(this, "", "vif", vif))
`uvm_fatal("TAV_NOVIF", {"No virtual interface for ", get_full_name()})
endfunction
task run_phase(uvm_phase phase);
tav_acc_item tr, rst_tr;
bit pending, in_reset;
forever begin
@(vif.mon_cb);
if (vif.mon_cb.rst_n !== 1'b1) begin
pending = 0; // a step cut off by reset is not a step
if (!in_reset) begin // tell the scoreboard once, on the cycle the DUT sees reset
rst_tr = tav_acc_item::type_id::create("rst_tr");
rst_tr.is_reset = 1;
ap.write(rst_tr);
in_reset = 1;
end
continue;
end
in_reset = 0;
if (pending) begin
tr.acc = vif.mon_cb.acc; // acc one cycle after valid
ap.write(tr);
pending = 0;
end
if (vif.mon_cb.valid) begin
tr = tav_acc_item::type_id::create("tr");
tr.data = vif.mon_cb.data;
pending = 1;
end
end
endtask
endclass
// ---------------------------------------------------------------
// Reset driver: drives the reset pin in reset_phase. Because it is a
// phase task, it runs again every time the test jumps back.
// ---------------------------------------------------------------
class tav_reset_driver extends uvm_component;
`uvm_component_utils(tav_reset_driver)
virtual tav_acc_if vif;
int tav_count;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
if (!uvm_config_db#(virtual tav_acc_if)::get(this, "", "vif", vif))
`uvm_fatal("TAV_NOVIF", {"No virtual interface for ", get_full_name()})
endfunction
task reset_phase(uvm_phase phase);
phase.raise_objection(this);
tav_count++;
`uvm_info("TAV_RST", $sformatf("reset_phase pass %0d: asserting reset for 3 cycles", tav_count), UVM_LOW)
@(posedge vif.clk);
vif.rst_n <= 1'b0;
repeat (3) @(posedge vif.clk);
vif.rst_n <= 1'b1;
phase.drop_objection(this);
endtask
endclass
// ---------------------------------------------------------------
// Scoreboard: a model of the accumulator. It clears the model when the
// monitor reports reset, which is when the DUT really clears acc.
// ---------------------------------------------------------------
class tav_acc_scoreboard extends uvm_scoreboard;
`uvm_component_utils(tav_acc_scoreboard)
uvm_analysis_imp #(tav_acc_item, tav_acc_scoreboard) imp;
bit [15:0] tav_model;
int tav_pass, tav_fail, tav_bug;
function new(string name, uvm_component parent);
super.new(name, parent);
imp = new("imp", this);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
void'($value$plusargs("BUG=%d", tav_bug));
endfunction
// Clear the model on the reset the DUT actually sees, not at the phase jump:
// the DUT keeps accumulating until reset reaches its clock edge.
function void write(tav_acc_item tr);
if (tr.is_reset) begin
if (tav_bug == 1)
`uvm_info("TAV_SCB", $sformatf("BUG=1: reset seen but model NOT cleared, still %0d", tav_model), UVM_LOW)
else begin
tav_model = '0;
`uvm_info("TAV_SCB", "Reset seen by the monitor: model cleared to 0", UVM_LOW)
end
return;
end
tav_model = tav_model + tr.data;
if (tr.acc == tav_model) begin
tav_pass++;
`uvm_info("TAV_SCB", $sformatf("PASS %s", tr.convert2string()), UVM_MEDIUM)
end
else begin
tav_fail++;
`uvm_error("TAV_SCB", $sformatf("FAIL data=%0d exp acc=%0d got acc=%0d",
tr.data, tav_model, tr.acc))
tav_model = tr.acc; // resync so one bug gives one error, not a cascade
end
endfunction
function void report_phase(uvm_phase phase);
`uvm_info("TAV_SCB", $sformatf("Steps checked: %0d pass, %0d fail", tav_pass, tav_fail), UVM_NONE)
endfunction
endclass
// ---------------------------------------------------------------
// Agent and env
// ---------------------------------------------------------------
class tav_acc_agent extends uvm_agent;
`uvm_component_utils(tav_acc_agent)
tav_acc_driver drv;
tav_acc_monitor mon;
uvm_sequencer #(tav_acc_item) sqr;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
drv = tav_acc_driver::type_id::create("drv", this);
mon = tav_acc_monitor::type_id::create("mon", this);
sqr = uvm_sequencer#(tav_acc_item)::type_id::create("sqr", this);
endfunction
function void connect_phase(uvm_phase phase);
drv.seq_item_port.connect(sqr.seq_item_export);
drv.tav_sqr = sqr;
endfunction
endclass
class tav_acc_env extends uvm_env;
`uvm_component_utils(tav_acc_env)
tav_acc_agent agt;
tav_reset_driver rst;
tav_acc_scoreboard scb;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
agt = tav_acc_agent::type_id::create("agt", this);
rst = tav_reset_driver::type_id::create("rst", this);
scb = tav_acc_scoreboard::type_id::create("scb", this);
endfunction
function void connect_phase(uvm_phase phase);
agt.mon.ap.connect(scb.imp);
endfunction
endclass
// ---------------------------------------------------------------
// Test: traffic in main_phase. On the first pass, cut it off halfway
// with phase.jump() back to pre_reset_phase. On the second pass, let
// the sequence finish.
// ---------------------------------------------------------------
class tav_reset_test extends uvm_test;
`uvm_component_utils(tav_reset_test)
tav_acc_env env;
int tav_main_pass;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
env = tav_acc_env::type_id::create("env", this);
uvm_top.set_timeout(5000); // a hang ends as a clear UVM_FATAL, not a stuck run
endfunction
task main_phase(uvm_phase phase);
tav_acc_seq seq = tav_acc_seq::type_id::create("seq");
phase.raise_objection(this);
tav_main_pass++;
`uvm_info("TAV_TEST", $sformatf("main_phase pass %0d: starting traffic", tav_main_pass), UVM_LOW)
if (tav_main_pass == 1) begin
fork
seq.start(env.agt.sqr);
join_none
#170; // each step takes 2 clocks: about 8 steps reach the DUT first
`uvm_info("TAV_TEST", "Mid-traffic reset: stopping sequences, then jumping back to pre_reset_phase", UVM_LOW)
env.agt.sqr.stop_sequences(); // kill the sequence through the sequencer, so no zombie request is left
phase.jump(uvm_pre_reset_phase::get());
end
else begin
seq.start(env.agt.sqr);
#50; // get() finishes an item before it is driven: wait for the last step to be driven and checked
end
phase.drop_objection(this);
endtask
endclass
endpackage
// ================================ the top ================================
module tav_top;
import uvm_pkg::*;
import tav_reset_pkg::*;
logic clk = 1'b0;
always #5 clk = ~clk;
tav_acc_if tav_acc_if_inst (clk);
tav_acc dut (
.clk (clk),
.rst_n (tav_acc_if_inst.rst_n),
.valid (tav_acc_if_inst.valid),
.data (tav_acc_if_inst.data),
.acc (tav_acc_if_inst.acc)
);
initial begin
uvm_config_db#(virtual tav_acc_if)::set(null, "uvm_test_top.env.*", "vif", tav_acc_if_inst);
run_test("tav_reset_test");
end
initial begin
$dumpfile("tav_reset.vcd");
$dumpvars(0, tav_top);
end
endmodule
What the run shows

What to notice:
- 205 ns: the test stops the sequences and jumps.
[PH_JUMP]confirms main goes back to pre_reset. - 215 ns: the driver sees
rst_nfall and flushes the sequencer. Step 9 still passes with acc = 45. - 225 ns: the monitor reports reset and the scoreboard clears its model, at the same edge the DUT clears acc.
- 245 ns: reset is released,
main_phaseruns again, and all 16 steps pass, ending at acc = 136. - Result: 25 pass, 0 fail, 0
UVM_ERROR.
Here is the clean run from VCS:
UVM_INFO @ 0: reporter [RNTST] Running test tav_reset_test...
UVM_INFO testbench.sv(222) @ 0: uvm_test_top.env.rst [TAV_RST] reset_phase pass 1: asserting reset for 3 cycles
UVM_INFO testbench.sv(260) @ 5: uvm_test_top.env.scb [TAV_SCB] Reset seen by the monitor: model cleared to 0
UVM_INFO testbench.sv(121) @ 35: uvm_test_top.env.agt.drv [TAV_DRV] Reset released: driving
UVM_INFO testbench.sv(357) @ 35: uvm_test_top [TAV_TEST] main_phase pass 1: starting traffic
UVM_INFO testbench.sv(267) @ 55: uvm_test_top.env.scb [TAV_SCB] PASS data=1 acc=1
UVM_INFO testbench.sv(267) @ 75: uvm_test_top.env.scb [TAV_SCB] PASS data=2 acc=3
UVM_INFO testbench.sv(267) @ 95: uvm_test_top.env.scb [TAV_SCB] PASS data=3 acc=6
UVM_INFO testbench.sv(267) @ 115: uvm_test_top.env.scb [TAV_SCB] PASS data=4 acc=10
UVM_INFO testbench.sv(267) @ 135: uvm_test_top.env.scb [TAV_SCB] PASS data=5 acc=15
UVM_INFO testbench.sv(267) @ 155: uvm_test_top.env.scb [TAV_SCB] PASS data=6 acc=21
UVM_INFO testbench.sv(267) @ 175: uvm_test_top.env.scb [TAV_SCB] PASS data=7 acc=28
UVM_INFO testbench.sv(267) @ 195: uvm_test_top.env.scb [TAV_SCB] PASS data=8 acc=36
UVM_INFO testbench.sv(363) @ 205: uvm_test_top [TAV_TEST] Mid-traffic reset: stopping sequences, then jumping back to pre_reset_phase
UVM_INFO /apps/vcsmx/vcs/X-2025.06-SP1//etc/uvm-1.2/src/base/uvm_phase.svh(1558) @ 205: reporter [PH_JUMP] phase main (schedule uvm_sched, domain uvm) is jumping to phase pre_reset
UVM_INFO testbench.sv(222) @ 205: uvm_test_top.env.rst [TAV_RST] reset_phase pass 2: asserting reset for 3 cycles
UVM_INFO testbench.sv(129) @ 215: uvm_test_top.env.agt.drv [TAV_DRV] Reset seen: stopped driving and flushed the sequencer
UVM_INFO testbench.sv(267) @ 215: uvm_test_top.env.scb [TAV_SCB] PASS data=9 acc=45
UVM_INFO testbench.sv(260) @ 225: uvm_test_top.env.scb [TAV_SCB] Reset seen by the monitor: model cleared to 0
UVM_INFO testbench.sv(121) @ 245: uvm_test_top.env.agt.drv [TAV_DRV] Reset released: driving
UVM_INFO testbench.sv(357) @ 245: uvm_test_top [TAV_TEST] main_phase pass 2: starting traffic
UVM_INFO testbench.sv(267) @ 265: uvm_test_top.env.scb [TAV_SCB] PASS data=1 acc=1
UVM_INFO testbench.sv(267) @ 285: uvm_test_top.env.scb [TAV_SCB] PASS data=2 acc=3
UVM_INFO testbench.sv(267) @ 305: uvm_test_top.env.scb [TAV_SCB] PASS data=3 acc=6
UVM_INFO testbench.sv(267) @ 325: uvm_test_top.env.scb [TAV_SCB] PASS data=4 acc=10
UVM_INFO testbench.sv(267) @ 345: uvm_test_top.env.scb [TAV_SCB] PASS data=5 acc=15
UVM_INFO testbench.sv(267) @ 365: uvm_test_top.env.scb [TAV_SCB] PASS data=6 acc=21
UVM_INFO testbench.sv(267) @ 385: uvm_test_top.env.scb [TAV_SCB] PASS data=7 acc=28
UVM_INFO testbench.sv(267) @ 405: uvm_test_top.env.scb [TAV_SCB] PASS data=8 acc=36
UVM_INFO testbench.sv(267) @ 425: uvm_test_top.env.scb [TAV_SCB] PASS data=9 acc=45
UVM_INFO testbench.sv(267) @ 445: uvm_test_top.env.scb [TAV_SCB] PASS data=10 acc=55
UVM_INFO testbench.sv(267) @ 465: uvm_test_top.env.scb [TAV_SCB] PASS data=11 acc=66
UVM_INFO testbench.sv(267) @ 485: uvm_test_top.env.scb [TAV_SCB] PASS data=12 acc=78
UVM_INFO testbench.sv(267) @ 505: uvm_test_top.env.scb [TAV_SCB] PASS data=13 acc=91
UVM_INFO testbench.sv(267) @ 525: uvm_test_top.env.scb [TAV_SCB] PASS data=14 acc=105
UVM_INFO testbench.sv(267) @ 545: uvm_test_top.env.scb [TAV_SCB] PASS data=15 acc=120
UVM_INFO testbench.sv(267) @ 565: uvm_test_top.env.scb [TAV_SCB] PASS data=16 acc=136
UVM_INFO testbench.sv(278) @ 585: uvm_test_top.env.scb [TAV_SCB] Steps checked: 25 pass, 0 fail
--- UVM Report Summary ---
UVM_INFO : 39
UVM_WARNING : 0
UVM_ERROR : 0
UVM_FATAL : 0
And the key lines with +BUG=1. The scoreboard keeps 45, so the first step after reset fails, then it resyncs:
UVM_INFO testbench.sv(267) @ 215: uvm_test_top.env.scb [TAV_SCB] PASS data=9 acc=45
UVM_INFO testbench.sv(257) @ 225: uvm_test_top.env.scb [TAV_SCB] BUG=1: reset seen but model NOT cleared, still 45
UVM_INFO testbench.sv(121) @ 245: uvm_test_top.env.agt.drv [TAV_DRV] Reset released: driving
UVM_INFO testbench.sv(357) @ 245: uvm_test_top [TAV_TEST] main_phase pass 2: starting traffic
UVM_ERROR testbench.sv(271) @ 265: uvm_test_top.env.scb [TAV_SCB] FAIL data=1 exp acc=46 got acc=1
UVM_INFO testbench.sv(267) @ 285: uvm_test_top.env.scb [TAV_SCB] PASS data=2 acc=3
...
UVM_INFO testbench.sv(267) @ 565: uvm_test_top.env.scb [TAV_SCB] PASS data=16 acc=136
UVM_INFO testbench.sv(278) @ 585: uvm_test_top.env.scb [TAV_SCB] Steps checked: 24 pass, 1 fail
UVM_ERROR : 1
What my first run taught me
My first version of this bench did not pass. VCS ended the clean run with 3 UVM_ERRORs: 22 pass, 2 fail. Both causes are mistakes you will meet in real benches.
| What VCS reported | Root cause | Fix |
|---|---|---|
[SEQREQZMB] at 205 ns: the task requesting a wait_for_grant has been killed | The jump killed the sequence while it waited in start_item() | Call stop_sequences() right before phase.jump() |
FAIL data=9 exp acc=9 got acc=45 at 215 ns | The scoreboard cleared its model in pre_reset_phase, at 205 ns. The DUT only saw reset at the 225 ns edge, so step 9 was legal | Clear the model when the monitor reports reset |
FAIL data=1 exp acc=46 got acc=1 at 265 ns | A knock-on from the first FAIL | Gone with the fix above |
| Only 15 of 16 steps checked in pass 2 | get() finishes an item before it is driven, so the test ended one step early | Wait #50 after the sequence, not #30 |
The lesson: the phase jump is a testbench event, and reset is a DUT event. They happen at different times. Tie your scoreboard to what the DUT sees, not to the phase.
Common mistakes to avoid
| Mistake | What you see | Fix |
|---|---|---|
| Scoreboard clears its model at the jump | A false FAIL on the last legal step before reset | Clear when the monitor sees reset |
| Scoreboard never clears its model | The first check after reset fails (+BUG=1) | Handle the monitor’s reset item |
| Jump without stopping sequences | [SEQREQZMB] UVM_ERROR | stop_sequences(), then jump |
Driver in main_phase instead of run_phase | The driver dies at the jump and never comes back | Keep drivers and monitors in run_phase |
| Driver ignores the reset pin | Stimulus during reset, or stale items replayed after it | Fork the drive loop against @(negedge rst_n), then disable fork |
get_next_item() cut off by reset | “get_next_item called twice”, or a hang after reset | Use get(), or call stop_sequences() after reset |
| Monitor keeps a half-captured step | One phantom compare right after reset | Drop pending captures while reset is low |
| No timeout | A reset bug hangs the run forever | uvm_top.set_timeout() turns a hang into a clear fatal |
How to debug a reset test
| Tool | How to use it | What it shows |
|---|---|---|
+UVM_PHASE_TRACE | Add to the run options | Every phase start, end and jump, with time |
+UVM_OBJECTION_TRACE | Add to the run options | Who raised and dropped objections, so you see what holds a phase open |
Waveform of rst_n, valid, acc | Dump the interface | Whether stimulus stopped, and when the DUT really saw reset |
A uvm_info on every reset action | One line in the driver, monitor and scoreboard | The order of reset events, as in the log above |
How AI helps you master this
- Read the log: paste the lines around the jump and ask why a step failed. The “exp 9, got 45” pattern is easy for a model to explain once it sees the timestamps.
- Review a driver: paste it and ask “what happens if reset asserts while this task is blocked in get_next_item?”. It is good at walking through the cases.
- Generate reset scenarios: ask for reset timings to test: idle, mid-burst, back-to-back resets, reset during configure.
Warning: a convincing AI answer is not the same as a correct engineering result. AI tools often claim a jump restarts run_phase, or that clearing in pre_reset_phase is safe, and my VCS run showed it is not. Run the bench and read the timestamps.
Interview questions on reset testing
- What does
phase.jump()restart, and what does it not? It re-runs the UVM sub-phases from the target forward. It does not restartrun_phase. - Why keep drivers in
run_phasefor reset testing? A jump ends the phase it leaves and kills what that phase started. A driver inrun_phasesurvives and handles reset from the pin. - When should a scoreboard clear its expected values? When its monitor sees the DUT in reset, not at the phase jump. The DUT keeps working until reset reaches its clock edge.
- What is
SEQREQZMB? A UVM_ERROR when a sequence is killed while waiting for grant. Stop sequences through the sequencer before the jump.
More practice: verification interview questions.
Practice challenge
- Run the clean bench and confirm 25 pass, 0 fail, ending at acc = 136.
- Run with
+BUG=1and explain the expected value in the one FAIL line. - Remove the
stop_sequences()call in the test and run again. Find theSEQREQZMBline. - Bonus: change
#170to#60and predict how many PASS lines come before the reset.
FAQ
What is reset testing in UVM? Applying reset while the design and testbench are busy, then checking that everything recovers and works correctly after it.
What is phase jump in UVM? A call, phase.jump(target), that ends the current run-time sub-phase early and sends every component in the domain back to the target phase, such as pre_reset.
Does phase.jump() restart run_phase? No. run_phase sits in a different schedule and keeps running, which is why drivers and monitors there must watch the reset pin.
What happens to running sequences on a phase jump? Sequences started from the phase that ends are killed with it. If one is waiting for grant, UVM 1.2 reports SEQREQZMB, so call stop_sequences() before jumping.
Can I reset only part of the testbench? Yes, by putting that part in its own uvm_domain with set_domain() and jumping only that domain.
Should I use phase jump or a reset sequence? Phase jump suits benches that already use run-time phases. A reset sequence in run_phase suits reusable VIP and benches that avoid them.
References
- IEEE 1800.2, UVM class reference:
uvm_phase::jump(), the run-time phases,uvm_domainanduvm_sequencer_base::stop_sequences(). - Accellera, Universal Verification Methodology (UVM) 1.2 class reference and user guide: phasing.
- DVCon paper: Handling Asynchronous Reset(s) Testing by building reset-awareness into UVM testbench components.
- DVCon paper: Reboot your reset methodology: resetting anytime with the UVM reset package.
Keep learning
- Phasing: UVM phasing and how UVM phasing is triggered.
- Objections: how to end a UVM test and why a UVM test never ends.
- The driver handshake: UVM sequencer and driver communication.
- Full course: the UVM methodology learning path.
Part of the learning path UVM methodology
