In simple terms it's a UVM sequencer that contain handles to other sequencers. Why do we need this ? Because we plan to use virtual sequences and want to have control over all sequencers from a central place. A request type is not required here because this sequencer is generic and not limited to handle only one particular data type.

Click to refresh the concept of a virtual sequence.

virtual sequencer

The environment shown above has an APB agent, Wishbone agent, PCIE environment and a register layer environment. Each of these components have their own sequences and the respective sequencers on which they are launched. A virtual sequencer called m_virt_seqr is instantiated to hold references to each individual sequencer. Hence a virtual sequence executing on this virtual sequencer will have access to all the sequencers in the testbench.

Example

  
  
	class my_virtual_sequencer extends uvm_sequencer;
		`uvm_component_utils (my_virtual_sequencer)
		
		function new (string name = "my_virtual_sequencer", uvm_component parent);
			super.new (name, parent);
		endfunction
		
		// Declare handles to other sequencers here
		apb_sequencer       m_apb_seqr;
		reg_sequencer       m_reg_seqr;
		wb_sequencer        m_wb_seqr;
		pcie_sequencer      m_pcie_seqr;
	endclass

  

In our top environment, we'll create an instance of the virtual sequencer and connect real sequencers with their respective handles in the virtual sequencer.

  
  
	class top_env extends uvm_env;
		...
		
		my_virtual_sequencer 	m_virt_seqr;
		
		virtual function void build_phase (uvm_phase phase);
			...
			m_virt_seqr = my_virtual_sequencer::type_id::create ("m_virt_seqr", this);
			...
		endfunction
		
		// Connect virtual sequencer handles to actual sequencers
		virtual function void connect_phase (uvm_phase phase);
			...
			m_virt_seqr.m_apb_seqr   = m_apb_agent.m_apb_seqr;
			m_virt_seqr.m_reg_seqr   = m_reg_env.m_reg_seqr;
			m_virt_seqr.m_pcie_seqr  = m_pcie_env.m_pcie_agent.m_pcie_seqr;
			...
		endfunction
	endclass

  

A virtual sequencer operates best when used with a virtual sequence. Read more on Virtual Sequence.

Go to the Downloads page for example code under tag "virtual-sequencer".

Simulation Log

----------------------------------------------------------------
CDNS-UVM-1.1d 
(C) 2007-2013 Mentor Graphics Corporation
(C) 2007-2013 Cadence Design Systems, Inc.
(C) 2006-2013 Synopsys, Inc.
(C) 2011-2013 Cypress Semiconductor Corp.
----------------------------------------------------------------
UVM_INFO @ 0: reporter [RNTST] Running test base_test...
UVM_INFO @ 0: reporter [UVMTOP] UVM testbench topology:
--------------------------------------------------------------
Name                       Type                    Size  Value
--------------------------------------------------------------
uvm_test_top               base_test               -     @2667
  m_top_env                top_env                 -     @2733
    m_apb_agent            apb_agent               -     @2780
      m_apb_drv            apb_driver              -     @4089
        rsp_port           uvm_analysis_port       -     @4237
        seq_item_port      uvm_seq_item_pull_port  -     @4188
      m_apb_mon            apb_monitor             -     @4217
      m_apb_seqr           uvm_sequencer           -     @3512
        rsp_export         uvm_analysis_export     -     @3569
        seq_item_export    uvm_seq_item_pull_imp   -     @4109
        arbitration_queue  array                   0     -    
        lock_queue         array                   0     -    
        num_last_reqs      integral                32    'd1  
        num_last_rsps      integral                32    'd1  
    m_spi_agent            spi_agent               -     @2840
      m_spi_drv            spi_driver              -     @4897
        rsp_port           uvm_analysis_port       -     @5043
        seq_item_port      uvm_seq_item_pull_port  -     @4995
      m_spi_mon            spi_monitor             -     @5024
      m_spi_seqr           uvm_sequencer           -     @4321
        rsp_export         uvm_analysis_export     -     @4377
        seq_item_export    uvm_seq_item_pull_imp   -     @4917
        arbitration_queue  array                   0     -    
        lock_queue         array                   0     -    
        num_last_reqs      integral                32    'd1  
        num_last_rsps      integral                32    'd1  
    m_virt_seq             virtual_sequencer       -     @2870
      rsp_export           uvm_analysis_export     -     @2928
      seq_item_export      uvm_seq_item_pull_imp   -     @3478
      arbitration_queue    array                   0     -    
      lock_queue           array                   0     -    
      num_last_reqs        integral                32    'd1  
      num_last_rsps        integral                32    'd1  
    m_wb_agent             wb_agent                -     @2810
      m_wb_drv             wb_driver               -     @5712
        rsp_port           uvm_analysis_port       -     @5858
        seq_item_port      uvm_seq_item_pull_port  -     @5810
      m_wb_mon             wb_monitor              -     @5839
      m_wb_seqr            uvm_sequencer           -     @5136
        rsp_export         uvm_analysis_export     -     @5192
        seq_item_export    uvm_seq_item_pull_imp   -     @5732
        arbitration_queue  array                   0     -    
        lock_queue         array                   0     -    
        num_last_reqs      integral                32    'd1  
        num_last_rsps      integral                32    'd1  
--------------------------------------------------------------

UVM_INFO ./tb/my_pkg.sv(68) @ 0: uvm_test_top.m_top_env.m_virt_seq@@m_virt_seq [VSEQ] Start of virtual sequence
UVM_INFO ./tb/wb_agent.sv(63) @ 0: uvm_test_top.m_top_env.m_wb_agent.m_wb_seqr@@m_wb_reset_seq [RESET_SEQ] Starting wb_reset_seq
UVM_INFO ./tb/apb_agent.sv(52) @ 20000: uvm_test_top.m_top_env.m_apb_agent.m_apb_seqr@@m_apb_rw_seq [RW_SEQ] Starting apb_rw_seq
UVM_INFO ./tb/spi_agent.sv(74) @ 30000: uvm_test_top.m_top_env.m_spi_agent.m_spi_seqr@@m_spi_tx_seq [tx_SEQ] Starting spi_tx_seq
UVM_INFO ./tb/my_pkg.sv(75) @ 30000: uvm_test_top.m_top_env.m_virt_seq@@m_virt_seq [VSEQ] End of virtual sequence
UVM_INFO ./tb/my_pkg.sv(108) @ 30000: uvm_test_top [SHUT] Shutting down test ...

--- UVM Report catcher Summary ---