function void build();
ovm_factory f;
f=ovm_factory::get();
f.set_type_override_by_name("sequence_1","sequence_2");
endfunction //coded in Test Build function
I have tried overriding the above sequence1 by sequence2. But once the test runs it not happening. Still my sequence1 is being used by the subsequences. please give me a solution. I am new to writing test cases
-------------------------------------------------------------------------------
// sequence_1 is coded in a separate package,eg ., apb_seq_pkg as follows,
class sequence_1 extends apb_seq_pkg::apb_base_seq;
`ovm_sequence_utils(sequence_1, ovm_sequencer)
function new();
super.new();
endfunction
task body();
write_reg(data,status,reg_name,dev_name);
endtask
function void print_cfg();
endfunction
endclass
-----------------------------------------------------------------------------
// sequence_2 is coded below the test itself,
function void build(); //part of test build function alone
ovm_factory f;
f=ovm_factory::get();
f.set_type_override_by_name("sequence_1","sequence_2");
endfunction
class sequence_2 extends apb_seq_pkg::sequence_1;
`ovm_sequence_utils(sequence_2, ovm_sequencer)
function new();
super.new();
endfunction
task body();
// write_reg(data,status,reg_name,dev_name); //basically i need to disable this write so i am trying to do sequence override. The apb_seq_pkg(sequence_1) is a softlink so i need to do overrride from test only to disable the write. The sequence is called in subsequence through the test.
endtask
function void print_cfg();
endfunction
endclass
------------------------------------------------------------------------
This is not working for me. The register write is happening anyway. please help me on this. I am new to ovm.