UVM Sequences Interview Questions

Questions on Sequence mechanics, Macros, Arbitration, and Layering.

Beginner Level

What is the `body()` task?

It is the main execution task of a sequence. When a sequence is started, `body()` is called. This is where you write the scenario (create items, randomization, start_item, finish_item).

What does `uvm_do` do?

It is a macro that automates the handshake: Create -> Start Item -> Randomize -> Finish Item.

Intermediate Level

How do you run a sequence on a specific sequencer?

`seq.start(my_sequencer);`

Difference between `lock()` and `grab()`? (Tricky)

Both give exclusive access.

  • lock(): Waits for all currently RUNNING sequences to finish before taking control. (Polite)
  • grab(): Takes control immediately at the next arbitration cycle, pausing others. (Rude)

Advanced Level

Can you run a Virtual Sequence without a Virtual Sequencer?

Yes! A virtual sequence is just a sequence that controls other sequences. You can run it on "null" sequencer: `vseq.start(null)`. Inside the vseq, you must manually assign the sub-sequencer handles (e.g., `uvm_config_db` or direct assignment from `env`) before starting sub-sequences.

Explain Sequencer Arbitration: Weighted Mode.

By default, arbitration is FIFO. If you use `SEQ_ARB_WEIGHTED`, the sequencer picks items based on their priority weight. `seq.start(sqr, parent, PRIORITY)`. High priority items have Higher Probability of being picked.