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
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.
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.
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 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 ?
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.