Part 5 · Sequences · Intermediate

Sequence Debugging: Hangs, Null p_sequencer, and Tracing

Hub — systematic triage for sequence stalls: silence failures, driver checklist, sequencer connection, randomize/locks, and verbosity tracing.

Overview

Sequence problems manifest as silence — simulation runs, time advances, objections may drop, but nothing happens on the bus. Or the sim hangs forever with no error. The failure is almost always a blocked thread , not a thrown exception. Randomize asserts are the exception; finish_item blocking is the rule.

This topic is an ordered debugging playbook split into five lessons. Work top to bottom: confirm the symptom class, verify the driver is running, check sequencer wiring and p_sequencer typing, eliminate randomize and arbitration lock issues, then apply targeted verbosity tracing.

Lessons in this topic

  1. Symptom & Hang Overview — silence failures and the quick diagnosis table.

  2. Driver Running Checklist — objections, active agent, virtual interface.

  3. Sequencer Connection & p_sequencer — connect_phase and null declare macro.

  4. Randomize & Arbitration Locks — constraint conflicts and forgotten unlock.

  5. Verbosity Tracing & Plusargs — uvm_set_verbosity and strategic uvm_info.

The stimulus debug stack

diagram
Legend: [STIM] [SEQ] [DRV] [UVM]

┌─────────────────────────────────────────────────────────────────────────┐
│  SEQUENCE DEBUG — triage order (top  bottom)                             │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                           │
│  1. SYMPTOM        silence vs hang vs null ptr — classify first           │
│  2. DRIVER [DRV]   run_phase? objection? is_active? vif null?             │
│  3. CONNECT [UVM]  seq_item_port ↔ seq_item_export in connect_phase       │
│  4. START [STIM]   seq.start(sqr) — sqr null? wrong sequencer?            │
│  5. P_SEQ [SEQ]    declare macro matches start target? vseq vs agent sqr?  │
│  6. HANDSHAKE      start_item ↔ get_next_item ↔ item_done pairing         │
│  7. RAND/LOCK      randomize fail? lock without unlock? bg seq starvation │
│  8. TRACE [UVM]    uvm_set_verbosity at handshake boundaries              │
│                                                                           │
└─────────────────────────────────────────────────────────────────────────┘
diagram
[SEQ] quick diagnosis table (full detail in sub-lessons)

  SYMPTOM                          LIKELY CAUSE
  ─────────────────────────────────────────────────────────
  Hang at finish_item              missing item_done() in driver
  Hang at start_item               arbitration lock / starvation
  Hang at get_next_item            no seq started / no run_phase objection
  Null ptr on p_sequencer.apb_sqr  wrong declare macro or start target
  No bus activity, sim ends        objection dropped before seq.start
  Randomize assert                 constraint conflict
  Driver log never prints          passive agent or driver never entered run_phase

Key takeaways

  • Sequence hangs are almost always driver handshake or wrong sequencer.

  • Work the checklist in order — do not jump to randomize before checking item_done.

  • Strategic uvm_info at start_item/finish_item/get_next_item localizes the stall.

Common pitfalls

  • Starting sequence before run_phase objections raised.

  • UVM_FULL on entire testbench — log too large to read.

  • Assuming hang is randomize when last line was finish_item.

  • Killing sim without checking forked bg_seq still holds lock.