UVM Coding Practice · Senior

Objection Count & Drain Time

raise/drop pairing and pipeline drain.

Interview prompt

Test hangs at end — walk through objection debug.

diagram
WHITEBOARD CHAIN

1. DECLARE    interfaces / types / ports you need
2. SKELETON   class extends + utils macro + key methods
3. MECHANISM  fill one critical method while narrating
4. PITFALL    name one bug juniors make on this pattern
5. TEST       how you would smoke-test the component

Reference sketch (≤40 lines)

systemverilog
task run_phase(uvm_phase phase);
  phase.raise_objection(this);
  seq.start(env.sqr);
  phase.phase_done.set_drain_time(this, 100);
  phase.drop_objection(this);
endtask

Mechanism to narrate

  • Draw timeline: raise → stimulus → drain → drop

  • If hang: print who still has objection (UVM objection trace)

  • Pipelined DUT needs drain_time before drop

Smoke test (5 minutes)

  • Normal test ends within timeout.

  • Remove drop_objection — sim hangs (repro leak).

  • Zero drain on pipelined DUT — compare with 100ns drain.

Common pitfalls

  • Missing drop_objection.

  • No drain on pipelined DUT.

  • Seq and test both raise without policy.