How to trigger virtual sequence

Can any body help
In my env , I have master sequencer and slave sequencer with their respective sequence libraries . Here i have implemented virtual sequencer and virtual sequence library which will control the master and slave sequencers. I did it according to the user guide, But i have a problem in executing this virtual sequence. In test case i used this part of code
to configure the virtual sequencer

 set_config_string("axi_demo_tb0.axi0.virtual_seqr",
                "default_sequence","axi_virtual_sequence_001");

Is this the correct way to configure the virtual sequencer ?

Initially I got output random sequence and exhaustive sequences executing continuously …
later I included this part of code to stop the sub sequences in test environment

task run;
#0
axi0.masters[0].sequencer.stop_sequences();
axi0.slaves[0].sequencer.stop_sequences();
endtask : run

After including this code all my random sequences got stopped but , its not executing desired sequence which i configured in the test case, Instead its executing one sequence picking randomly from virtual sequence library…

  1. so where i need to control it.
  2. Is it compulsory to use get_config_, if i have used set_cofig_ in hierarchy. I have warnings saying
    " No get_config_string() call ever matched the following set_config_string() call from component… "
  1. Is it compulsory to use get_config_, if i have used set_cofig_ in hierarchy. I have warnings saying

Yes we have to use a “get_config” otherwise you might end up in error or warning.
and I would leave it to experts to answer your other queries.

Answering your questions:

  1. I would recommend starting your sequences explicity rather than relying on the sequencer library implemented using the sequencer_utils macros, otherwise it is difficult to understand what is going on. In other words, inside your virtual sequence you explicitly start your sub-sequences, and your virtual sequence is started within the run method of your test.

class v_seq extends ovm_sequence #(ovm_sequence_item);

a_sqr target_a_sequencer;
b_sqr target_b_sequencer;

task body;
target_a_seq seq_a = target_a_seq::type_id::create(“seq_a”);
target_b_seq seq_b = target_b_seq::type_id::create(“seq_b”);

fork
seq_a.start(target_a_sequencer);
seq_b.start(target_b_sequencer);
join
endtask: body
endclass: v_seq

And then in the test something like:

task run;
v_seq v_test_seq = v_seq::type_id::create(“v_test_seq”);
v_test_seq.start(null);
endtask: dun

For more on how to do this see the following pages in the on-line cookbook:

http://verificationacademy.com/uvm-ovm/Sequences/Overview
http://verificationacademy.com/uvm-ovm/Sequences/API
http://verificationacademy.com/uvm-ovm/Sequences/Virtual

  1. You don’t have to use get_config, but there’s little point in using set_config if you’re not going to use the config objects. OVM warns you about the unused config items, this is to give you a clue if something is not working correctly and to let you know that there’s something you could clean up in your testbench.

By the way, I’ll also point out that the `ovm_sequence_utils macro and all other parts of the OVM sequence library have been deprecated in UVM. If you have plans eventually to move to UVM, it’s not a good idea to start using the OVM sequence library.

In reply to Ramid:

Hi,

This is what I have done in order to use virtual sequence in my Verification Environment.

I have written below code in my build function of the test. I have total two sequencers just like your environment. Then I have virtual sequencer, which does synchronization between these two sequencers. As given in user guide, you have to first shut off the sequencers by setting their “count” to 0. Then set your virtual sequencer’s default sequence to your virtual sequence.

function void build();


set_config_int(“my_env.data_sequencer”, “count”,0);
set_config_int(“my_env.address_sequencer”, “count”,0);
set_config_string(“my_env.v_sequencer”, “default_sequence”,“my_virtual_sequence”);



endfunction : build

2.) You are getting this get_config warning message may be because you are not using factory registration of your sequences/sequencers/driver.

Please let me know whether this helps you or not.

In reply to Pratik Shah:

I dont think this has anything to do with the factory. The set_config* call sets something in component table and get_config* gets it. so there has to be a get_config followed by a set_config*.

Usually, set_config* calls are made in build phase which is top down. Hence if any variable is inside the configuration macros, they will get updated automatically later than the set_config* call from the component above.

Without using the configuration macros, you should call the set_config* manually after set_config calls.