The Thought Process Behind Great Verification: 5 Habits That Find Real Bugs
In short: Great verification starts with how you think, not with which tool you open. Five habits do most of the work: see the whole system, read the designer’s intent, go past the happy path, pick the right method for each job, and share what you find. In this lesson a 16-deep FIFO hides three bugs. The happy-path test passes on all three. Each habit gives you one test, and each of those tests catches a bug.
Why do two engineers with the same tools find different bugs?
Give two engineers the same simulator, the same UVM library and the same spec. One finds the bug before tape-out. The other signs off a clean regression on a broken chip.
The difference is rarely the tool. It is the questions each one asked before writing a test. In the previous lesson you learned a 7-step method to turn a spec into scenarios. This lesson is about the habits of mind behind that method: the ones that make you ask the right questions in the first place.
I will not just list the habits. You will see each one turn into a real test on a real FIFO, and watch it catch a bug that a tidy test plan would have missed.
The picture: a volleyball coach before a big match
Think of a volleyball coach preparing for a strong opponent. The players and the drills are the tools. The match is won by how the coach thinks.
- The whole system. The coach studies the whole team, not one hitter. A great spiker means nothing if the setter is the weak link.
- Why they chose it. The coach asks why the other side uses that rotation. Every choice they made points at where they are strong, and where they are exposed.
- Past the happy path. Practice covers the awkward balls too: the serve that clips the net, the dig off a block, the rally that runs long.
- The right drill. Serve receive gets one drill, blocking footwork gets another. No single drill fixes everything.
- Share it. At every timeout, the coach tells the team what they saw. One player’s read becomes the whole team’s plan.
A verification engineer does the same thing to a chip. The tools are the players. The thinking decides the result.
What will you learn in this lesson?
By the end of this lesson you will be able to:
- Name the five thinking habits and the question each one makes you ask.
- Turn each habit into a concrete test on a small design.
- Explain why a passing happy-path test proves very little.
- Choose between directed, random and formal checks for a given risk.
- Write a bug note that helps the designer and the rest of your team.
What are the five thinking habits of a great verification engineer?
Each habit is really a question you ask before you write a test. The answer to each question is a scenario. Here they are, using one design all the way through: a synchronous FIFO, 16 entries deep, 8 bits wide.
Habit 1: What does the whole system need from this block?
A FIFO never lives alone. It sits between a producer and a consumer, and in a real chip it runs for millions of cycles. So the question is not “does one write work?” but “what happens after hours of traffic?”
That question leads straight to a scenario a short test never reaches: the read and write pointers wrapping around, again and again. A FIFO that works for the first 16 entries and breaks on entry 17 is a very common kind of bug.
Test it gives you: push 48 items through, so both pointers wrap at least twice.
Habit 2: Why did the designer choose this number?
Every number in a spec was picked by someone. The depth is 16. So ask: what must be true at exactly 16? Full must go high at 16 entries, not at 15 and not at 17. Empty must go high at 0.
This habit points you at off-by-one bugs, which hide at the exact edge the designer chose.
Test it gives you: fill to exactly 16 and check full at every step on the way.
Habit 3: What happens one step past the happy path?
The spec says a write when full is dropped. Most tests never write when full, because the testbench author is polite and checks full first. Real producers are not always polite.
Ask “what if?” at every edge: write when full, read when empty, read and write in the same cycle, reset in the middle of traffic.
Test it gives you: fill to 16, write 3 more, then drain and check every value.
Habit 4: Which method fits this risk?
Directed tests are good for the exact corners you already named. Constrained random is good for the mixes you did not think of. Formal is good for proving a rule holds in every state, such as “full and empty are never both high”.
No method wins everywhere. The habit is to ask which risk you are chasing, then pick the method that reaches it fastest. The lesson on directed vs constraint random verification and the one on formal vs functional verification go deeper.
Test it gives you: keep the directed corner tests, and add 2,000 cycles of random reads and writes checked against a model.
Habit 5: Who else needs to know what I found?
A bug you find and fix quietly helps one block. A bug you write up well helps every block that reuses the same idea. A short, clear note also saves the designer an hour of guessing.
A good bug note has four parts: what you did, what you expected, what you saw, and the smallest test that shows it. You will write one at the end of the worked example.
What it gives you: a reusable test, and a team that does not make the same mistake twice.
How do the five habits catch bugs in a real FIFO?
Here is the whole thing in one file: a 16-deep FIFO with three bugs you can switch on, and a UVM bench with six scenarios. Each scenario is a sequence. A driver puts it on the pins, a monitor samples every cycle, and a scoreboard compares every output against a reference model that is just a queue, written from the spec. T1 is the happy path. T2 to T6 each come from one habit.
| Test | Habit it comes from | What it does |
|---|---|---|
| T1 | None (happy path) | Write 4, read 4 |
| T2 | 2: the designer’s number | Fill to exactly 16, check full |
| T3 | 3: past the happy path | Write 3 more while full, then drain |
| T4 | 3: past the happy path | Read 3 times while empty |
| T5 | 1: the whole system | 48 items through, both pointers wrap |
| T6 | 4: right method | 2,000 cycles of random reads and writes |
The three bugs are classic FIFO mistakes: an off-by-one on full, a write that is not blocked when full, and a pointer that wraps to the wrong place.
The code
Paste this into EDA Playground, pick Synopsys VCS with UVM 1.2, set the top module to tav_top, and run. Every name I define starts with tav_, short for The Art of Verification, so it never clashes with your own code or the UVM library. Add +BUG=1, +BUG=2 or +BUG=3 to the run options to switch a bug on.
// tav_fifo_think_uvm.sv : five thinking habits, one 16-deep FIFO, three hidden bugs (UVM 1.2)
// Run on Synopsys VCS X-2025.06-SP1 with UVM 1.2 (EDA Playground), 24 Nov 2026.
// The Art of Verification | theartofverification.com
//
// EDA Playground: Synopsys VCS, UVM 1.2, top module "tav_top".
// Paste this whole file into testbench.sv and leave design.sv empty.
//
// Run options (one per run):
// (none) the clean design
// +BUG=1 full goes high at 15 entries instead of 16
// +BUG=2 a write while full is not blocked, it overwrites the oldest entry
// +BUG=3 the read pointer wraps to 1 instead of 0
//
// Spec:
// 16 entries of 8 bits. First word fall through: dout always shows the oldest entry.
// full = 1 when 16 entries are stored. empty = 1 when 0 entries are stored.
// A write when full is dropped. A read when empty is dropped.
// Read and write in the same cycle are both allowed, judged on the flags
// before the clock edge.
`timescale 1ns/1ns
`include "uvm_macros.svh"
import uvm_pkg::*;
// ---------------------------------------------------------------------------
// The design
// ---------------------------------------------------------------------------
module tav_fifo16 (input logic clk, rst_n,
input logic wr_en, rd_en,
input logic [7:0] din,
output logic [7:0] dout,
output logic full, empty,
input int bug);
logic [7:0] mem [16];
logic [3:0] wp, rp;
logic [4:0] count;
logic do_wr, do_rd;
assign full = (bug == 1) ? (count >= 15) : (count == 16); // BUG=1
assign empty = (count == 0);
assign dout = mem[rp];
assign do_wr = wr_en && (!full || bug == 2); // BUG=2
assign do_rd = rd_en && !empty;
always_ff @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
wp <= 0; rp <= 0; count <= 0;
end else begin
if (do_wr) begin
mem[wp] <= din;
wp <= wp + 1;
end
if (do_rd)
rp <= (rp == 15) ? ((bug == 3) ? 4'd1 : 4'd0) : rp + 1; // BUG=3
if (do_wr && !do_rd && count != 16) count <= count + 1;
else if (do_rd && !do_wr) count <= count - 1;
end
end
endmodule
// ---------------------------------------------------------------------------
// Interface: the monitor samples just before each rising edge
// ---------------------------------------------------------------------------
interface tav_fifo_if (input logic clk);
logic rst_n, wr_en, rd_en;
logic [7:0] din, dout;
logic full, empty;
clocking mon_cb @(posedge clk);
default input #1step;
input rst_n, wr_en, rd_en, din, dout, full, empty;
endclocking
endinterface
// ---------------------------------------------------------------------------
// Transaction: one clock cycle at the FIFO pins
// ---------------------------------------------------------------------------
class tav_fifo_item extends uvm_sequence_item;
rand bit wr, rd; // what the driver asks for this cycle
bit [7:0] din;
bit rst; // 1 = pulse reset instead
// filled in by the monitor
logic [7:0] dout;
logic full, empty;
`uvm_object_utils(tav_fifo_item)
function new(string name = "tav_fifo_item");
super.new(name);
endfunction
endclass
// ---------------------------------------------------------------------------
// Sequences: one per scenario, each from one habit
// ---------------------------------------------------------------------------
class tav_fifo_base_seq extends uvm_sequence #(tav_fifo_item);
`uvm_object_utils(tav_fifo_base_seq)
bit [7:0] next_val = 1; // writes carry 1, 2, 3 and so on, so a skipped entry shows
function new(string name = "tav_fifo_base_seq");
super.new(name);
endfunction
task cyc(bit wr, bit rd);
req = tav_fifo_item::type_id::create("req");
start_item(req);
req.wr = wr; req.rd = rd; req.din = next_val;
finish_item(req);
if (wr) next_val++;
endtask
endclass
class tav_reset_seq extends tav_fifo_base_seq;
`uvm_object_utils(tav_reset_seq)
function new(string name = "tav_reset_seq");
super.new(name);
endfunction
task body();
req = tav_fifo_item::type_id::create("req");
start_item(req);
req.rst = 1;
finish_item(req);
endtask
endclass
// T1: the happy path. Write 4, read 4.
class tav_happy_seq extends tav_fifo_base_seq;
`uvm_object_utils(tav_happy_seq)
function new(string name = "tav_happy_seq");
super.new(name);
endfunction
task body();
repeat (4) cyc(1, 0);
repeat (4) cyc(0, 1);
endtask
endclass
// T2, habit 2: the designer's number. Fill to exactly 16 and watch full.
class tav_fill_seq extends tav_fifo_base_seq;
`uvm_object_utils(tav_fill_seq)
function new(string name = "tav_fill_seq");
super.new(name);
endfunction
task body();
repeat (16) cyc(1, 0);
cyc(0, 0);
endtask
endclass
// T3, habit 3: past the happy path. Write 3 more while full, then drain.
class tav_overfill_seq extends tav_fifo_base_seq;
`uvm_object_utils(tav_overfill_seq)
function new(string name = "tav_overfill_seq");
super.new(name);
endfunction
task body();
repeat (16) cyc(1, 0);
repeat (3) cyc(1, 0);
repeat (16) cyc(0, 1);
endtask
endclass
// T4, habit 3: the other edge. Read 3 times while empty.
class tav_underflow_seq extends tav_fifo_base_seq;
`uvm_object_utils(tav_underflow_seq)
function new(string name = "tav_underflow_seq");
super.new(name);
endfunction
task body();
repeat (3) cyc(0, 1);
cyc(1, 0);
cyc(0, 1);
endtask
endclass
// T5, habit 1: the whole system. Long traffic, so the pointers wrap.
class tav_wrap_seq extends tav_fifo_base_seq;
`uvm_object_utils(tav_wrap_seq)
function new(string name = "tav_wrap_seq");
super.new(name);
endfunction
task body();
repeat (8) cyc(1, 0);
repeat (40) cyc(1, 1);
repeat (8) cyc(0, 1);
endtask
endclass
// T6, habit 4: constrained random mix, 2000 cycles
class tav_random_seq extends tav_fifo_base_seq;
`uvm_object_utils(tav_random_seq)
function new(string name = "tav_random_seq");
super.new(name);
endfunction
task body();
repeat (2000) begin
req = tav_fifo_item::type_id::create("req");
start_item(req);
if (!req.randomize()) `uvm_fatal("RAND", "randomize failed")
req.din = next_val;
finish_item(req);
if (req.wr) next_val++;
end
endtask
endclass
// ---------------------------------------------------------------------------
// Driver: drives on the falling edge, idles when there is no item
// ---------------------------------------------------------------------------
class tav_fifo_driver extends uvm_driver #(tav_fifo_item);
`uvm_component_utils(tav_fifo_driver)
virtual tav_fifo_if vif;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
if (!uvm_config_db#(virtual tav_fifo_if)::get(this, "", "vif", vif))
`uvm_fatal("NOVIF", "no virtual interface")
endfunction
task run_phase(uvm_phase phase);
vif.rst_n <= 0; vif.wr_en <= 0; vif.rd_en <= 0; vif.din <= 0;
forever begin
seq_item_port.try_next_item(req);
if (req == null) begin
@(negedge vif.clk);
vif.wr_en <= 0; vif.rd_en <= 0;
end else begin
if (req.rst) begin
@(negedge vif.clk);
vif.rst_n <= 0; vif.wr_en <= 0; vif.rd_en <= 0;
@(negedge vif.clk);
vif.rst_n <= 1;
end else begin
@(negedge vif.clk);
vif.wr_en <= req.wr; vif.rd_en <= req.rd; vif.din <= req.din;
end
seq_item_port.item_done();
end
end
endtask
endclass
// ---------------------------------------------------------------------------
// Monitor: one transaction per clock, sampled just before the edge
// ---------------------------------------------------------------------------
class tav_fifo_monitor extends uvm_monitor;
`uvm_component_utils(tav_fifo_monitor)
virtual tav_fifo_if vif;
uvm_analysis_port #(tav_fifo_item) ap;
function new(string name, uvm_component parent);
super.new(name, parent);
ap = new("ap", this);
endfunction
function void build_phase(uvm_phase phase);
if (!uvm_config_db#(virtual tav_fifo_if)::get(this, "", "vif", vif))
`uvm_fatal("NOVIF", "no virtual interface")
endfunction
task run_phase(uvm_phase phase);
forever begin
tav_fifo_item t;
@(vif.mon_cb);
t = tav_fifo_item::type_id::create("t");
t.rst = (vif.mon_cb.rst_n !== 1'b1);
t.wr = vif.mon_cb.wr_en;
t.rd = vif.mon_cb.rd_en;
t.din = vif.mon_cb.din;
t.dout = vif.mon_cb.dout;
t.full = vif.mon_cb.full;
t.empty = vif.mon_cb.empty;
ap.write(t);
end
endtask
endclass
// ---------------------------------------------------------------------------
// Scoreboard: the reference model is a plain queue, written from the spec
// ---------------------------------------------------------------------------
class tav_fifo_scoreboard extends uvm_scoreboard;
`uvm_component_utils(tav_fifo_scoreboard)
uvm_analysis_imp #(tav_fifo_item, tav_fifo_scoreboard) imp;
bit [7:0] q[$];
int errors, shown, total_errors, reads;
int hit_full, hit_wr_full, hit_rd_empty, hit_both, hit_wrap;
function new(string name, uvm_component parent);
super.new(name, parent);
imp = new("imp", this);
endfunction
function void start_test(string name);
`uvm_info("TEST", name, UVM_NONE)
errors = 0; shown = 0;
endfunction
function void end_test();
`uvm_info("RESULT", $sformatf("%s, %0d mismatches", errors == 0 ? "PASS" : "FAIL", errors), UVM_NONE)
total_errors += errors;
endfunction
function void write(tav_fifo_item t);
bit m_full, m_empty;
if (t.rst) begin
q.delete(); reads = 0;
return;
end
m_full = (q.size() == 16);
m_empty = (q.size() == 0);
if (t.full !== m_full || t.empty !== m_empty || (!m_empty && t.dout !== q[0])) begin
errors++;
if (shown < 2) begin
shown++;
`uvm_error("MISMATCH", $sformatf("stored=%0d full=%b(exp %b) empty=%b(exp %b) dout=%0d(exp %0d)",
q.size(), t.full, m_full, t.empty, m_empty, t.dout, m_empty ? 0 : q[0]))
end
end
if (t.wr && m_full) hit_wr_full++;
if (t.rd && m_empty) hit_rd_empty++;
if (t.wr && t.rd && !m_full && !m_empty) hit_both++;
if (m_full) hit_full++;
if (t.rd && !m_empty) begin
void'(q.pop_front());
reads++;
if (reads % 16 == 0) hit_wrap++;
end
if (t.wr && !m_full) q.push_back(t.din);
endfunction
function void report_phase(uvm_phase phase);
`uvm_info("CORNERS", $sformatf("full=%0d write_while_full=%0d read_while_empty=%0d both_same_cycle=%0d pointer_wraps=%0d",
hit_full, hit_wr_full, hit_rd_empty, hit_both, hit_wrap), UVM_NONE)
`uvm_info("SUMMARY", $sformatf("total_mismatches=%0d", total_errors), UVM_NONE)
endfunction
endclass
// ---------------------------------------------------------------------------
// Agent and environment
// ---------------------------------------------------------------------------
class tav_fifo_agent extends uvm_agent;
`uvm_component_utils(tav_fifo_agent)
uvm_sequencer #(tav_fifo_item) sqr;
tav_fifo_driver drv;
tav_fifo_monitor mon;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
sqr = uvm_sequencer#(tav_fifo_item)::type_id::create("sqr", this);
drv = tav_fifo_driver::type_id::create("drv", this);
mon = tav_fifo_monitor::type_id::create("mon", this);
endfunction
function void connect_phase(uvm_phase phase);
drv.seq_item_port.connect(sqr.seq_item_export);
endfunction
endclass
class tav_fifo_env extends uvm_env;
`uvm_component_utils(tav_fifo_env)
tav_fifo_agent agt;
tav_fifo_scoreboard scb;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
agt = tav_fifo_agent::type_id::create("agt", this);
scb = tav_fifo_scoreboard::type_id::create("scb", this);
endfunction
function void connect_phase(uvm_phase phase);
agt.mon.ap.connect(scb.imp);
endfunction
endclass
// ---------------------------------------------------------------------------
// Test: reset, run one scenario, report, six times
// ---------------------------------------------------------------------------
class tav_fifo_test extends uvm_test;
`uvm_component_utils(tav_fifo_test)
tav_fifo_env env;
virtual tav_fifo_if vif;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
env = tav_fifo_env::type_id::create("env", this);
if (!uvm_config_db#(virtual tav_fifo_if)::get(this, "", "vif", vif))
`uvm_fatal("NOVIF", "no virtual interface")
endfunction
task run_one(string name, tav_fifo_base_seq s);
tav_reset_seq r = tav_reset_seq::type_id::create("r");
env.scb.start_test(name);
r.start(env.agt.sqr);
s.start(env.agt.sqr);
repeat (2) @(vif.mon_cb); // let the monitor see the last cycle
#1;
env.scb.end_test();
endtask
task run_phase(uvm_phase phase);
phase.raise_objection(this);
run_one("T1 happy path (4 in, 4 out)", tav_happy_seq::type_id::create("t1"));
run_one("T2 fill to 16, check full", tav_fill_seq::type_id::create("t2"));
run_one("T3 write while full, then drain", tav_overfill_seq::type_id::create("t3"));
run_one("T4 read while empty", tav_underflow_seq::type_id::create("t4"));
run_one("T5 48 items through, pointers wrap", tav_wrap_seq::type_id::create("t5"));
run_one("T6 random mix, 2000 cycles", tav_random_seq::type_id::create("t6"));
phase.drop_objection(this);
endtask
endclass
// ---------------------------------------------------------------------------
// Top
// ---------------------------------------------------------------------------
module tav_top;
logic clk = 0;
int BUG = 0;
always #5 clk = ~clk;
tav_fifo_if vif (clk);
tav_fifo16 dut (.clk(clk), .rst_n(vif.rst_n), .wr_en(vif.wr_en), .rd_en(vif.rd_en),
.din(vif.din), .dout(vif.dout), .full(vif.full), .empty(vif.empty), .bug(BUG));
initial begin
void'($value$plusargs("BUG=%d", BUG));
`uvm_info("TOP", $sformatf("Running with BUG=%0d", BUG), UVM_NONE)
uvm_config_db#(virtual tav_fifo_if)::set(null, "uvm_test_top", "vif", vif);
uvm_config_db#(virtual tav_fifo_if)::set(null, "uvm_test_top.env.agt.*", "vif", vif);
run_test("tav_fifo_test");
end
endmodule
What output should you expect?
With no bug switched on, every test passes and the bench prints how often each corner was hit:
UVM_INFO @ 0: reporter [RNTST] Running test tav_fifo_test...
UVM_INFO @ 0: uvm_test_top.env.scb [TEST] T1 happy path (4 in, 4 out)
UVM_INFO @ 116: uvm_test_top.env.scb [RESULT] PASS, 0 mismatches
UVM_INFO @ 116: uvm_test_top.env.scb [TEST] T2 fill to 16, check full
UVM_INFO @ 326: uvm_test_top.env.scb [RESULT] PASS, 0 mismatches
UVM_INFO @ 326: uvm_test_top.env.scb [TEST] T3 write while full, then drain
UVM_INFO @ 716: uvm_test_top.env.scb [RESULT] PASS, 0 mismatches
UVM_INFO @ 716: uvm_test_top.env.scb [TEST] T4 read while empty
UVM_INFO @ 806: uvm_test_top.env.scb [RESULT] PASS, 0 mismatches
UVM_INFO @ 806: uvm_test_top.env.scb [TEST] T5 48 items through, pointers wrap
UVM_INFO @ 1406: uvm_test_top.env.scb [RESULT] PASS, 0 mismatches
UVM_INFO @ 1406: uvm_test_top.env.scb [TEST] T6 random mix, 2000 cycles
UVM_INFO @ 21446: uvm_test_top.env.scb [RESULT] PASS, 0 mismatches
UVM_INFO @ 21446: uvm_test_top.env.scb [CORNERS] full=29 write_while_full=13 read_while_empty=45 both_same_cycle=491 pointer_wraps=61
UVM_INFO @ 21446: uvm_test_top.env.scb [SUMMARY] total_mismatches=0
...
UVM_ERROR : 0
UVM_FATAL : 0
That is from a real run on Synopsys VCS X-2025.06-SP1 with UVM 1.2 on EDA Playground (file and line numbers trimmed). The CORNERS line is worth a look: every corner was hit, many times, so a pass here means something. Your counts may differ a little, because the random seed decides T6.
Now switch the bugs on one at a time. This is what the same VCS run gave, with the mismatch count for each failing test:
| Run | T1 happy | T2 fill | T3 overfill | T4 underflow | T5 wrap | T6 random |
|---|---|---|---|---|---|---|
| No bug | PASS | PASS | PASS | PASS | PASS | PASS |
| +BUG=1 (full at 15) | PASS | FAIL (1) | FAIL (2) | PASS | PASS | FAIL |
| +BUG=2 (write when full) | PASS | PASS | FAIL (5) | PASS | PASS | FAIL |
| +BUG=3 (pointer wrap) | PASS | PASS | PASS | PASS | FAIL (32) | FAIL |
T1 to T5 are directed, so their counts are the same on every run. T6 is random: it failed with over a thousand mismatches for every bug in my runs, but the exact count changes with the seed.
Read that first column again. The happy path passes on all three broken designs. If T1 were your only test, all three bugs would reach silicon.
Each bug is caught by the test its habit produced. Habit 2 (the designer’s number) catches the off-by-one. Habit 3 (past the happy path) catches the overwrite. Habit 1 (the whole system) catches the wrap. And habit 4 adds a safety net: the random mix catches all three, even though nobody aimed it at any of them.
The first mismatch line in each failing test tells you where to look. For +BUG=3 it looks like this:
UVM_ERROR @ 1085: uvm_test_top.env.scb [MISMATCH] stored=8 full=0(exp 0) empty=0(exp 0) dout=18(exp 17)
The expected value is one higher than the value on dout. The FIFO skipped an entry. That points straight at the read pointer.
What does a good bug note look like?
This is habit 5 in practice. Here is the note I would send for +BUG=3:
FIFO read pointer skips entry 0 after the first wrap. Ran T5: 8 writes, then 40 cycles of write plus read. Expected dout to follow 1, 2, 3 and so on. After the 16th read, dout jumped from 16 to 18: entry 17 was skipped. Smallest repro: write 16, read 16, then write 1 and read 1. Suspect the rp wrap logic sets rp to 1 instead of 0.
Four parts: what I did, what I expected, what I saw, and the smallest test that shows it. The designer does not have to rerun anything to see the problem.
What are the most common thinking mistakes, and how do you debug them?
| Mistake | What it looks like | Fix |
|---|---|---|
| Trusting the happy path | All tests pass, but every test checks full before writing | Add at least one test per edge that a polite producer never hits |
| Checking only data, not flags | dout is right, but full goes high one entry early | Compare every output against the model, every cycle |
| Short tests only | Nothing runs long enough for pointers to wrap | Add one long-traffic test and count the wraps |
| One method for everything | Random runs for days and never hits write-while-full | Use a directed test for a named corner, random for the unknown mix |
| A model copied from the RTL | The model has the same bug, so the check passes | Write the model from the spec, never from the design |
| A vague bug report | “FIFO broken, please check” | What you did, what you expected, what you saw, smallest repro |
When a test fails, start with the first mismatch, not the last. In the FIFO bench, once the model and the design disagree, every later value is off too. That is why T6 reports so many mismatches for a single bug. The first line is the bug. The rest is noise.
If the expected and seen values are off by one entry, suspect a pointer. If a flag is wrong but the data is right, suspect the count or the compare. For a deeper method, see the practical verification debug guide and how to find the real cause of a scoreboard mismatch.
How can AI help you think through scenarios?
AI is a good second pair of eyes for habits 2 and 3. It is fast at asking “what if?” It is poor at knowing what your spec really says. Use it to widen your list, then check every line yourself.
Task: get a list of FIFO test scenarios, grouped by the five habits, to compare against your own.
Tool: any general chat assistant. I used Claude while drafting this lesson. Note the tool and version in your own notes, because answers change between versions.
Prompt:
You are a senior design verification engineer.
Here is the spec for a synchronous FIFO:
- 16 entries of 8 bits, first word fall through
- full = 1 at 16 entries, empty = 1 at 0 entries
- a write when full is dropped, a read when empty is dropped
- read and write in the same cycle are both allowed, judged on the flags before the clock edge
List test scenarios grouped under these five questions:
1. What does the whole system need from this block?
2. Why did the designer choose these numbers?
3. What happens one step past the happy path?
4. Which method fits each risk: directed, random or formal?
5. What should the bug note contain if a scenario fails?
Only use behaviour stated in the spec. Mark anything you assumed with ASSUMED.
Output (excerpt): I ran this prompt in Claude, in Anthropic’s Cowork app, on 24 Nov 2026. Here is the core of the answer, lightly trimmed:
1. Whole system: long traffic so both pointers wrap many times;
back-to-back writes at full rate; idle gaps between bursts.
2. The designer's numbers: full exactly at 16, never at 15; empty at 0;
count moving 15 -> 16 -> 15 and 1 -> 0 -> 1.
ASSUMED: dout shows a new entry the cycle after it is written into an empty FIFO.
3. Past the happy path: write when full (stored data unchanged);
read when empty; read + write together when full (read taken, write dropped);
read + write together when empty (write taken, read dropped);
reset in the middle of traffic. ASSUMED: reset empties the FIFO.
4. Method: directed tests for each named corner; constrained random
against a reference model; a formal property that full and empty
are never both 1.
5. Bug note: stimulus, expected value, seen value, cycle, smallest repro.
How I validated it: I mapped each line to the bench. T1 to T6 cover groups 1, 2 and most of 3. Three items have no test yet: read and write together at full or empty (that is the practice challenge below), reset in the middle of traffic, and the formal property. Both ASSUMED lines are real gaps in my spec, so they are questions for the designer, not tests yet. Nothing in this answer was invented; it stayed inside the spec.
What a useful output always has: every scenario names a stimulus and a check. It covers full at exactly 16, write when full, read when empty, both in the same cycle at full and at empty, and pointer wrap. Anything marked ASSUMED is a question for the designer, not a test yet.
How to validate it: map each scenario to a test in your bench. If a scenario has no test, either add one or write down why not. If a scenario relies on behaviour the spec does not state, take it to the designer.
Where it tends to fail:
- It invents signals the spec never mentions, such as an almost-full flag or an error output.
- It suggests writing the reference model from the RTL, which hides bugs instead of finding them.
- It lists scenarios but skips the check, so you get stimulus with nothing to compare against.
- It sounds equally sure about every line, so you cannot tell a real risk from filler.
The thinking stays your job. AI can make the list longer. Only you can tell which line matters for this chip.
Interview questions on verification thinking
- You are handed a FIFO and a passing test. What do you ask first? What the test actually covered. A write-4, read-4 test never reaches full, empty under pressure or pointer wrap. I would list the edges the spec defines and check which ones were hit.
- Why should a reference model be written from the spec and not the RTL? A model copied from the RTL copies its bugs. Both agree, the check passes, and the bug ships.
- When would you pick a directed test over random? When the risk is a named corner I can describe in one sentence, such as write while full. Random is for mixes I did not think of.
- What makes a good bug report? What I did, what I expected, what I saw, and the smallest test that reproduces it, plus my best guess at the cause.
- A random test fails with 1,300 mismatches. Where do you start? At the first mismatch. After the first disagreement, the model and the design drift apart, so later mismatches are mostly echoes.
- How do you know your test reached a corner, and did not just pass near it? Count it. Coverage, or even a simple hit counter, tells you the corner happened. A pass with zero hits proves nothing about that corner.
Practice challenge
Add a fourth bug and catch it with a habit.
- Add a BUG=4 option to the design: when read and write happen in the same cycle while the FIFO is full, the read is dropped.
- Run all six tests. Note which ones fail.
- If none fails, ask habit 3’s question: which edge did no test reach? Write a seventh test that fills to 16, then does read and write together in one cycle.
- Check the CORNERS line. Does the bench count that exact case? If not, add a counter for it.
- Write a four-part bug note for BUG=4.
Hint: look at the both_same_cycle counter. It only counts cycles where the FIFO is neither full nor empty.
Frequently asked questions
What is the verification engineer mindset?
It is the habit of asking how a design could break before asking how to test it. In practice that means five questions: what the system needs, why the designer chose each number, what happens past the happy path, which method fits each risk, and who needs to know what you found.
Why does a passing test not prove a design is correct?
A test only proves the cases it reached. In this lesson’s FIFO, the happy-path test passes on all three broken designs, because it never fills the FIFO or wraps a pointer.
How do I find bugs that tests usually miss?
Look at the edges the spec defines: exact limits such as full at 16, illegal requests such as a write when full, and long-run effects such as pointer wrap. Write one test per edge, and count how often each one is hit.
Do I need UVM to practise verification thinking?
No. The habits are about the questions you ask, and they work with any bench. This lesson uses UVM because that is what you will meet on the job, but the scoreboard’s reference model is still just a SystemVerilog queue.
Is constrained random enough on its own?
Often not. Random is good at mixes you did not plan, but it can take a long time to reach a narrow corner. Pair it with directed tests for the corners you can name, and with coverage so you know what random actually hit.
References and related lessons
References
- Clifford E. Cummings, Simulation and Synthesis Techniques for Asynchronous FIFO Design (SNUG 2002): the classic paper on FIFO pointers and full/empty logic.
- Accellera UVM standard downloads: the UVM library this bench uses.
- EDA Playground: run the demo in your browser with Synopsys VCS.
Related lessons
- Previous lesson: How to Think Like a Verification Engineer: From Spec to Scenarios
- Next lesson: How to Build a Strong Verification Plan
- Directed Testing vs Constraint Random Verification
- Formal Verification vs Functional Verification
- Async FIFO Verification, Part 1: The Design, Gray Pointers and a Starter UVM Bench
- Coverage in SystemVerilog
- The Practical Verification Debug Guide
Part of the learning path Verification fundamentals

How AI play role in verification….. wat next can come after UVM to verify any design….
Very informative blog.
Thanks a lot.