Virtual sequencer

Hi All,

Two different agents are merged into single environment.
My doubt is regarding virtual sequencer.
In test,
Inside phase raise and drop objection, virtual_sequence.start(top_env.virtual_sequencer) is given but the error is that “virtual_sequencer is missing in top_env”.Please help me with the hierarchy of the same.
In top_env,two agents are declared. Where do I need to declare sequencers/virtual sequencer.

In reply to ajp:

You should instantiate your virtual sequencer in top_env and you should connect your actual sequencers to the sequencers in virtual sequencer.

In reply to kranthi445:

Thank you so much

In reply to ajp:

You do not Need a virtual sequencer at all.

In reply to chr_sue:

How to start the sequences of master and slave without virtual sequencer.
I am facing the error as “sequencer has been not supplied to start the sequence”.

Thanks in advance.

In reply to ajp:
You need only the handles to your agent sequencers in the virtual sequence.
Then you can start the virtual sequence like this:

vseq.start(null);


to chr_sue:

Okay…
Its working without virtual sequencer but I am not able to drive the sequence of both the agents.
May I know the corrective step to proceed with the sequences.

In reply to ajp:

Could you please explain what does it mean: it is working?

See a virtual sequence example below:

//-----------------------------------------------------------------------------
class example_top_base_seq extends uvm_sequence #(uvm_sequence_item);
//-----------------------------------------------------------------------------

  `uvm_object_utils(example_top_base_seq)

  example_top_config  cfg;
  apb_sequencer	apb_sequencer_i;
  spi_sequencer	spi_sequencer_i;

  extern function new(string name = "example_top_base_seq");

  extern task body();
  //---------------------------------------------------------------------------
  // constraints
  //---------------------------------------------------------------------------

endclass : example_top_base_seq

//-----------------------------------------------------------------------------
// example_top_base_seq implementation
//-----------------------------------------------------------------------------

function example_top_base_seq::new(string name = "example_top_base_seq");
   super.new(name);
endfunction : new
task example_top_base_seq::body();
  if (!uvm_config_db #(apb_sequencer)::get(null, get_full_name(), "apb_sequencer", apb_sequencer_i))
    `uvm_error(get_type_name(), "Config Error uvm_config_db #(apb_sequencer)::get cannot find sequencer")
  if (!uvm_config_db #(spi_sequencer)::get(null, get_full_name(), "spi_sequencer", spi_sequencer_i))
    `uvm_error(get_type_name(), "Config Error uvm_config_db #(spi_sequencer)::get cannot find sequencer")
endtask: body

//=============================================================================
// Sequence    : example_top_default_seq
// Author      : <author>    Tel: <phone>   Email: <email>
// Using       : <list of sub-sequences used by this sequences>
// Description : Sequence generating 1 item;
//=============================================================================
class example_top_default_seq extends example_top_base_seq;


  `uvm_object_utils(example_top_default_seq)

  // UVC sequences
  apb_default_seq	apb_seq;
  spi_default_seq	spi_seq;

  extern function new(string name = "example_top_default_seq");
  extern task body();

endclass : example_top_default_seq

//-----------------------------------------------------------------------------
// example_top_default_seq implementation
//-----------------------------------------------------------------------------

function example_top_default_seq::new(string name = "example_top_default_seq");
   super.new(name);
endfunction : new

task example_top_default_seq::body();
  super.body();

  apb_seq = apb_default_seq::type_id::create("apb_seq");
  spi_seq = spi_default_seq::type_id::create("spi_seq");

  `uvm_info(get_type_name(),"default sequence starting", UVM_MEDIUM)

  repeat(10) begin
  `uvm_info(get_type_name(),"apb sequence starting", UVM_MEDIUM)

    void'(apb_seq.randomize());
    apb_seq.start(apb_sequencer_i);
    `uvm_info(get_type_name(),"spi sequence starting", UVM_MEDIUM)

    void'(spi_seq.randomize());
    spi_seq.start(spi_sequencer_i);
  end
    `uvm_info(get_type_name(),"default sequence completed",UVM_MEDIUM)
endtask : body

In reply to chr_sue:

Hi…
Thank you for your response.
I tried with above mentioned solution and the error which I am facing is as "neither the item’s sequencer nor dedicated sequencer has been supplied to start the item in master_sequence/slave_sequence "