Default sequece

Hi,

While going through a UVM testbench containing multiple sequences, I found that in the build_phase of the test,
uvm_config_db is used to select and run the default sequence.

For example

If i have two independent sequence classes say

class seq_a extends uvm_sequence


endclass

class seq_b extends uvm_sequence


endclass

In the test class

class test extends uvm_test

function build_phase(uvm_phase phase)
uvm_config_db #(uvm_object_wrapper)::set( null, “uvm_test_top.my_sequencer.main_phase”, “default_sequence”, seq_b::type_id::get());
endfunction

endclass

So, if does the statement “uvm_config_db #(uvm_object_wrapper)::set( null, “uvm_test_top.my_sequencer.main_phase”, “default_sequence”, seq_b::type_id::get());” also runs the body function of seq_b ?

I know that in normal UVM testbench we basically use seq.start(sequencer_name) to start the sequence.

Please also tell how the statement “uvm_config_db #(uvm_object_wrapper)::set( null, “uvm_test_top.my_sequencer.main_phase”, “default_sequence”, seq_b::type_id::get())” starts the sequence and how it is executed ?

Thanks
Shankar

In reply to shankar_logic:

The ‘default_sequence’ method of starting a sequence is a legacy from OVM and is deprecated and highly recommended not to be used.

Every sequencer will do a uvm_config_db::get() for a ‘default_sequence’ and start it at the beginning of the run_phase(). If the get() doesn’t return anything, then the sequencer will do nothing.

In reply to shankar_logic:

uvm_task_phase.svh calls “start_phase_sequence” method of uvm_sequencer_base.svh.

This method:

  • gets default_sequence using uvm_config_db
  • cast the uvm_object_wrapper into uvm_sequence_base
  • start the sequence