Part 5 · Sequences · Intermediate
Sequence Body Handshake: start_item / finish_item
Hub — pull-model handshake between sequence, sequencer, and driver; test start(), objections, pipelining, and read responses.
Overview
UVM uses a pull model : the driver requests the next item when ready to drive, not when the sequence happens to produce one. The sequence blocks at finish_item until the driver finishes driving and calls item_done(). This back-pressure matches real protocols where the DUT may not accept a new beat every cycle.
This topic breaks the handshake into five focused lessons. Each lesson answers a different why question: why pull beats push, why start_item does not randomize, why missing item_done hangs forever, why objections gate driver startup, and why pipelined reads need item_done(req).
Lessons in this topic
Pull Model Overview — timeline diagram of sequence, sequencer, and driver.
start_item / finish_item — full apb_wr_seq walkthrough on the sequence side.
Driver get_next_item / item_done — run_phase loop and drive_apb.
Test start() & Objections — run_phase raise/drop and seq.start(sqr).
Pipelining & Read Responses — try_next_item sketch and rdata via item_done(req).
Handshake in the stimulus stack
Legend: [STIM] [SEQ] [DRV] [ITEM] [UVM]
[STIM] TEST.run_phase
│ raise_objection
│ seq.start(sqr)
▼
[SEQ] SEQUENCE.body()
│ start_item(req) ──► [SEQ] SEQUENCER queues item
│ randomize(req) [ITEM] fields filled
│ finish_item(req) ◄── blocks until [DRV] item_done
▼
[DRV] DRIVER.run_phase
get_next_item(req) ◄── pull when ready
drive_apb(req) ──► DUT pins
item_done()Every sub-lesson expands one arrow in this diagram. Missing item_done is the #1 cause of sequence hangs.
[SEQ] [DRV] handshake contract
ONE in-flight item per driver–sequencer pair (unless explicitly pipelined)
PAIRING: start_item ↔ get_next_item
finish_item ↔ item_done
VIOLATION: get_next_item twice without item_done → sequencer corruptionKey takeaways
Pull model: driver requests items when ready; sequence blocks at finish_item.
get_next_item / item_done on the driver must pair with start_item / finish_item on the sequence.
Missing item_done is the #1 cause of sequence hangs.
Common pitfalls
Missing item_done() — sequence blocks forever at finish_item.
Starting sequence before run_phase objections — driver not running.
Using put() on seq_item_port — wrong API; use get_next_item/item_done.