How to disable sequencer using uvm_config_db?

I want to disable my sequencer from test. So I used uvm-config_db to SET “count” to zero. But the sequencer is not disabled. How to disable it?

class test2_dis_sub extends base_test;
...
function void build_phase(uvm_phase phase);		
	super.build_phase(phase);
        uvm_config_db#(int)::set(this, “env.eth_agent.sqr”, “count”, 0); // using this I want to disable the sqr
endfunction 

task run_phase(uvm_phase phase);
         eth_pkt_seq e_seq = eth_pkt_seq::type_id::create ("e_seq");
         super.run_phase(phase);
         phase.raise_objection (this);
         ... // there are other sequences run by other sequencers, which i am not showing here 
         e_seq.start (env.eth_agent.sqr); // sqr is the sqr handle, expecting this sqr to be disabled, but not happening, how to disable ?
         phase.drop_objection (this); 	
endtask
endclass
class eth_sqr extends uvm_sequencer#(eth_pkt); // sequencer code
	int count;
	
	`uvm_component_utils_begin(eth_sqr)	
	   `uvm_field_int(count, UVM_ALL_ON);
	`uvm_component_utils_end

	function new (string name="eth_sqr", uvm_component parent=null);
	
		super.new(name,parent);		

	endfunction

endclass

In reply to rakesh2learn:

The OVM method of using ‘count’ to control a sequencer was deprecated by UVM and can not be used. The correct method is to not call start on your sequence.

The run_phase() is usually unique for each test and will start only the sequences required for that test.

In reply to cgales:

Thanks for your reply. As you suggested I don’t use ‘start’. I do as shown below.

	function void build_phase(uvm_phase phase);		
		super.build_phase(phase);

	uvm_config_db#(int)::set(this, "env.eth_agent.sqr", "count", 0);
        uvm_config_db#(uvm_object_wrapper)::set(this,"env.eth_agent.sqr.main_phase", "default_sequence", eth_pkt_seq::type_id::get());
endfunction

The sequencer is still active and I get output from this sequencer, but it is supposed to get disabled. But it is not happening, why ?

In reply to rakesh2learn:

As cgales said, using count to switch-off is a deprecated construct in UVM.
It might not be supported in future versions of UVM.
In your case I’d set the default sequence to the run_phase of your sequencer and not on the to the main_phase.

In reply to rakesh2learn:

You are still ‘starting’ the eth_pkt_seq on the sequencer. You moved the starting of the sequence from:

e_seq.start (env.eth_agent.sqr);

to:

uvm_config_db#(uvm_object_wrapper)::set(this,"env.eth_agent.sqr.main_phase", "default_sequence", eth_pkt_seq::type_id::get());

Both of the above options will ‘start’ the sequence on the sequencer. Do not include the lines above and the sequencer will not run the eth_pkt_seq sequence.

In reply to chr_sue:

In reply to rakesh2learn:
As cgales said, using count to switch-off is a deprecated construct in UVM.
It might not be supported in future versions of UVM.
In your case I’d set the default sequence to the run_phase of your sequencer and not on the to the main_phase.

So what is the alternative to ‘count’ so I can disable sequencer in UVM ?

In reply to dhserfer:

Obviously if I don’t include those sequence , it won’t run. But, the idea behind my question is to disable the sequencer even though the sequence is started. Like how ‘count’ is used to work in OVM.

In reply to rakesh2learn:

One option is to use the start/finish mechanism and make it dependet on a control object.