Sequence library selection mode UVM_SEQ_LIB_USER

Hi,

I am working on sequence library approach of UVM. In which, I found that there are four multiple ways for sequence execution.
[*] selection_mode: Sequence selection algorithm
UVM_SEQ_LIB_RAND: Selects the sequence randomly
UVM_SEQ_LIB_RANDC: Selects the sequence in random cyclic order
UVM_SEQ_LIB_ITEM: Generates sequence item only, sequence won’t be executed
UVM_SEQ_LIB_USER: Selects the sequence based on the algorithm defined by user inside function “select_sequence”

For the first three selection modes, It makes sense that how to use those approaches and how it work.

But I am not able figure out the way “How to use UVM_SEQ_LIB_USER mode ?”. I did not find any API/Method in uvm_sequence_library source code that we need to override or we need to implement our own algorithm and how will it be placed into execution?

Thanks in advance.

Regards,
Dhaval

In reply to Dhaval P:

You can set the selection mode at the beginnining of the run_phase like this:

task run_phase(uvm_phase phase);
  my_seq_lib lib = my_seq_lib::type_id::create("lib");
  lib.selection_mode = UVM_SEQ_LIB_RAND;

  // .......
endtask

In reply to chr_sue:

Dear chr_sue,

Thanks for the reply. But I am more interested in UVM_SEQ_LIB_USER mode.
How can we implement our own algorithm ?

But after overriding select_sequence method which is there in source code of uvm_sequence_library, I am able to control the flow of sequence.

Already got the solution for my question.

Once again thanks !!

Regards,
Dhaval