Driver with two sequence item

In reply to Dhruvesh.b:

From your question, I understood that you need to drive two different types of transactions. If it is the case, as you said driver and sequencer should be parametrized with one type of transaction only. To drive two different types of transactions you should have two agents with two different drivers and each driver parameterized with different transactions as explained with the below example.



interface intf1(bit clock);

...

endinterface

interface intf2(bit clk);

....

endinterface

class seqence_item_one extends uvm_sequence_item;

....
endclass


class seqence_item_two extends uvm_sequence_item;

....
endclass

class sequence_one extends uvm_sequence#(squence_item_one);

...
endclass

class sequence_two extends uvm_sequence#(squence_item_two);

...
endclass

class driver_one extends uvm_driver#(sequence_item_one);

   virtual intf1 vif;

....
endclass

class sequencer_one extends uvm_sequencer#(sequence_item_one);

 

....
endclass

class diver_two extends uvm_driver#(sequence_item_two);

   virtual intf2 vif;

...

endclass

class sequencer_two extends uvm_sequencer#(sequence_item_two);

 

....
endclass

// agent1 should enclose drver_one & sequencer_one
// agent2 should enclose driver_two & sequencer_two
 
class test extends uvm_test;

  sequence_one seq1;
  sequence_two seq2;
...

  task run_phase(uvm_phase phase);
    seq1 = sequence_one::type_id::create("seq1");
    seq2 = sequence_two::type_id::create("seq2");

    phase.raise_objection(this);
    seq1.start(env.agt1.seqr1);// starting seq1 on agent1 seuencer
    seq2.start(env.agt2.seqr2);// starting seq2 on agent2 sequencer
    phase.drop_objection(this);
  endtask
endclass


If the sequence_item_one has to be driven first & sequence_item_two should be driven later we can start the seq1 & seq2 sequentially from the test. If both sequence_item_one & sequence_item_two are to be driven at the same time we can start seq1 & seq2 within fork-join.

I hope it’s clear.

Regards,
Shanthi