UVM Sequences Interview Questions
Questions on Sequence mechanics, Macros, Arbitration, and Layering.
Beginner Level
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).
It is a macro that automates the handshake: Create -> Start Item -> Randomize -> Finish Item.
Intermediate Level
`seq.start(my_sequencer);`
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
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.
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.