How to call one customized sequence from another customized seq?

I created a sequence and here is the code.



class my_reset_vseq extends my_base_vseq;
    
    hard_reset_sequence m_hard_rst_seq;
    soft_reset_sequence m_soft_rst_seq;
    ...
    virtual task body();
        super.body();
        fork
            // trigger hard reset
            begin
               m_hard_rst_seq = hard_reset_sequence::type_id::create("m_hard_rst_seq");
               m_hard_rst_seq.randomize() with {tr_delay == RESET_DELAY; resetb == 1'b0;};
               m_hard_rst_seq.start(my_hard_rst_sqr);
               ......
            end
            // trigger soft reset
            begin
               m_soft_rst_seq = soft_reset_sequence::type_id::create("m_soft_rst_seq");
               m_soft_rst_seq.randomize() with {tr_delay == RESET_DELAY; resetb == 1'b0;};
               m_soft_rst_seq.start(my_soft_rst_sqr);
               ......
            end
        join
    endtask
endclass


And now I am creating another sequence and I would like to know what’s the best way to call the above (my_reset_vseq) sequence in my current body() task ?



class my_init_vseq extends my_base_vseq;
    
    my_reset_vseq m_reset_seq;
    ......

    virtual task body();
        super.body();
        // how to add the code here ??
    endtask
endclass


In reply to zz8318:

You start a virtual sequence the same way as a regular sequence, except that you use a null sequencer. Make sure that you pass all of the sequencer handles to the virtual sequence(s) as required.


class my_init_vseq extends my_base_vseq;
 
    my_reset_vseq m_reset_seq;
    ......
 
    virtual task body();
        super.body();
        m_reset_seq = my_reset_vseq::type_id::create("m_reset_seq");
        // Assign all sequencer handles to virtual sequence as required
        m_reset_seq.my_hard_rst_sqr = env.agent.seqr;
        m_reset_seq.start(null);
    endtask
endclass