I want to use method “find_by_name()” of uvm_factory in my base_test class which is extended from uvm_test.
class base_test extends uvm_test;
`uvm_component_utils(base_test)
....
....
endclass
class basic_test1 extends base_test;
`uvm_component_utils(basic_test1)
function void build_phase(uvm_phase phase);
super.build_phase(phase);
uvm_config_wrapper::set(this,"vsequencer.main_phase","default_sequence", factory.find_by_name("basic_write_seq"));
endfunction
endclass
This code gives the following error :
Hierarchical name component lookup failed at 'factory'
Then i tried following code :
class base_test extends uvm_test;
`uvm_component_utils(base_test)
uvm_factory factory;
....
....
function void build_phase(uvm_phase phase);
super.build_phase(phase);
factory = uvm_factory::get();
endfunction
endclass
class basic_test1 extends base_test;
`uvm_component_utils(basic_test1)
function void build_phase(uvm_phase phase);
super.build_phase(phase);
uvm_config_wrapper::set(this,"vsequencer.main_phase","default_sequence", factory.find_by_name("basic_write_seq"));
endfunction
endclass
This code gives following error : find_by_name is not a class item.
So How can i get handle to uvm_factory??