UVM Coding Practice · Senior

Sequences Tricky Q&A

20 senior sequence interview questions.

Q&A bank

Sequence interview bank.

start_item vs start_item(req)?

diagram
[INT][SENIOR][UVM-CODE]

Q: start_item vs start_item(req)?

A:
start_item(req, -1, parent) for child seq; default for inline item.

FOLLOW-UP TRAP: Wrong parent — sequencer resolution fails.

Objection in sequence vs test?

diagram
[INT][SENIOR][UVM-CODE]

Q: Objection in sequence vs test?

A:
raise in test main or seq pre_start; drop in seq post_body or test — match pairs.

FOLLOW-UP TRAP: Objection leak hang.

Virtual sequence layering?

diagram
[INT][SENIOR][UVM-CODE]

Q: Virtual sequence layering?

A:
vseq starts child seq on sub-sequencers via `uvm_do_on macros or start on p_sequencer.

FOLLOW-UP TRAP: Starting on wrong sequencer.

grab vs lock?

diagram
[INT][SENIOR][UVM-CODE]

Q: grab vs lock?

A:
grab: exclusive access with ungrab. lock: simpler exclusive — know team style.

FOLLOW-UP TRAP: Deadlock two virtual seqs grabbing.

Sequence library arbitration?

diagram
[INT][SENIOR][UVM-CODE]

Q: Sequence library arbitration?

A:
uvm_sequence_library rand pick weighted sequences.

FOLLOW-UP TRAP: No weights — uniform unwanted.

pre_body post_body use?

diagram
[INT][SENIOR][UVM-CODE]

Q: pre_body post_body use?

A:
Hooks for objection, delay, logging — keep body focused on items.

FOLLOW-UP TRAP: Heavy logic only in body.

Rand stability in seq?

diagram
[INT][SENIOR][UVM-CODE]

Q: Rand stability in seq?

A:
set_rand_seed from test plusarg; same seed replay.

FOLLOW-UP TRAP: Different seeds each run — debug hard.

Constraint on seq item?

diagram
[INT][SENIOR][UVM-CODE]

Q: Constraint on seq item?

A:
Inside item class — seq randomizes before start_item.

FOLLOW-UP TRAP: Constraining in seq body on non-rand fields.

Response handler in seq?

diagram
[INT][SENIOR][UVM-CODE]

Q: Response handler in seq?

A:
get_response(rsp) after start_item with rsp enabled.

FOLLOW-UP TRAP: Blocking rsp on pipelined driver.

Default sequence type?

diagram
[INT][SENIOR][UVM-CODE]

Q: Default sequence type?

A:
uvm_config_db set default_sequence on sequencer.

FOLLOW-UP TRAP: Hardcoded seq in driver.

Sequence on null sequencer?

diagram
[INT][SENIOR][UVM-CODE]

Q: Sequence on null sequencer?

A:
p_sequencer cast fails — check factory create path.

FOLLOW-UP TRAP: m_sequencer not set.

Layered seq objection count?

diagram
[INT][SENIOR][UVM-CODE]

Q: Layered seq objection count?

A:
One objection per top virtual seq or per child — pick policy.

FOLLOW-UP TRAP: Double raise from child and parent.

Sequence item clone?

diagram
[INT][SENIOR][UVM-CODE]

Q: Sequence item clone?

A:
Clone before randomize for unique items per iteration.

FOLLOW-UP TRAP: Reuse same item object.

Kill sequence mid-flight?

diagram
[INT][SENIOR][UVM-CODE]

Q: Kill sequence mid-flight?

A:
seq.kill() — driver must handle item_done or hang.

FOLLOW-UP TRAP: Kill without driver cleanup.

uvm_do macro pitfalls?

diagram
[INT][SENIOR][UVM-CODE]

Q: uvm_do macro pitfalls?

A:
Hidden create/randomize — prefer explicit in interviews for clarity.

FOLLOW-UP TRAP: Can't explain what uvm_do does.

Sequence timeout?

diagram
[INT][SENIOR][UVM-CODE]

Q: Sequence timeout?

A:
wait fork or timeout in parallel with body.

FOLLOW-UP TRAP: Infinite body on stuck bus.

Seq item field automation?

diagram
[INT][SENIOR][UVM-CODE]

Q: Seq item field automation?

A:
`uvm_field_* for print/compare — interview may ask compare in scoreboard.

FOLLOW-UP TRAP: Manual compare all fields.

Virtual seq env access?

diagram
[INT][SENIOR][UVM-CODE]

Q: Virtual seq env access?

A:
Cast p_sequencer to virtual_sequencer; get sub sequencer handles.

FOLLOW-UP TRAP: Direct agent lookup from seq.

Sequence arbitration UVM_MAX_QUIT?

diagram
[INT][SENIOR][UVM-CODE]

Q: Sequence arbitration UVM_MAX_QUIT?

A:
Separate from seq — test level quit count.

FOLLOW-UP TRAP: Confusing seq errors with test quit.

Whiteboard basic seq 8 min?

diagram
[INT][SENIOR][UVM-CODE]

Q: Whiteboard basic seq 8 min?

A:
item class + seq body start_item/finish_item + objection mention.

FOLLOW-UP TRAP: Full env before seq body.