In reply to Michael54:
https://verificationacademy.com/forums/uvm/problem-parameterized-defines#reply-56243
You can use the UVM factory’s create_object_by_name() if you have the registered name of the sequence. If you have parameterized sequences, there is no registered string name, but you can create one with an associative array. It wasn’t clear if each sequence had a dedicated sequencer to run on or if the sequence here was selected when the task was called. I’m going to assume it’s passed to the task, but you could make another associative array to store the sequencers you want to select from.
uvm_object_wrapper seq_array[string];
seq_array["first_seq"] = first_seq::get_type();
seq_array["second_seq"] = second_seq::get_type();
seq_array["third_seq#(1,2)"] = third_seq#(1,2)::get_type();
seq_array["third_seq#(3,4)"] = third_seq#(3,4)::get_type();
task runseq(string name, uvm_sequencer_base sqr);
uvm_sequence#(your_item_type) seq;
if ($cast(seq,seq_array[my_name].create_object("")) && seq != null)
seq.start(sqr);
else
// something bad happened
endtask