Default sequence in UVM

In reply to SriGanesh D:

In general, you want all of the testbench stimulus generation and response (i.e. sequences) to be configured/started during the run_phase() of your test. This is desired to allow the user to control the exact relationship between these sequences.

There are several reasons using a default_sequence doesn’t follow this:

  • Setting a default_sequence is done outside of the run_phase(). Additionally, changing the default_sequence requires changes outside of the run_phase().
  • There is no mechanism to control when the default_sequence starts, other than at the beginning of a specific phase.
  • You can’t run more than one sequence
  • You can’t easily run additional sequences on the same sequencer
  • Debugging a default_sequence can be difficult since the user may not be aware that the default_sequence exists.
  • The default_sequence can’t be randomized() or otherwise configured

It’s simple enough to create()/randomize()/start() a single sequence at the beginning of the run_phase() instead of setting a default_sequence.

2 Likes