In reply to dave_59:
In reply to UVM_LOVE:
When you call
my_state1 = state::type_id::create("my_state1", null);
state is the original requested type. The create() method returns an object with the override type. Normally, the call to set_type_override_by_type() is in the top-level test, and the call to create() is in another class at a lower level.
I’ve got one more question.
set_type_override_by_type looks like 2 kind type usage way.
function new(string name, uvm_component parent = null);
super.new(name, parent);
'uvm_info(get_type_name(), “new…”, UVM_FULL)
factory.set_type_override_by_type(cdnUvmSequencer::get_type(), cdnUvmuserSequencer::get_type());
endfunction
virtual fuction build_phase(uvm_phase phase);
set_type_override_by_type(uvm_reg_map::get_type(), uvm_reg_user_map::get_type());
super.build_phase(phase);
…
endfunction
As you see that there are 2 types way to use set_type_override_by_type()
one is factory.set_type_override_by_type~~, and one is just start set_type_override_by_type without a factory syntax. Would you please let me know the difference betwwen them?