In the base_sequence,which is common for all the agents, I have an object,read_q_manager, extended from uvm_object.I want to override the read_q_manager definition for only agent_A.
I defined another class extending read_q_manager:
class my_read_q_manager extends read_q_manger;
.....
endclass
In my test build phase, I’m trying to override read_q_manager with my_read_q_manager:
class my_test extends my_base_test;
slave_sequence seq_A;
slave_sequence seq_B;
slave_sequence seq_C;
.....
function void build_phase(uvm_phase phase);
super.build_phase(phase);
//read_q_manager::type_id::set_type_override(my_read_q_manager::get_type);
read_q_manager::type_id::set_inst_override(my_read_q_manager::get_type,"seq_A");
endfunction
endclass
When I use set_type_override, it overrides for all the agents ie., in seq_A,seq_B and seq_C.
But,I want only for seq_A.
set_inst_override doesnt override at all.Probably because its a uvm_object and cannot be referenced through hierarchical path.
How can I override this object? I cannot modify the creation of read_q_manager object in slave_sequence as it is an external VIP
Hi,
The set_inst_override method is set_inst_override(string relative_inst_path
string orignal_type_name,
string override_type_name);
so you can try it again!
I don’t think that the uvm override method can override the uvm_object, I just know it can override the uvm_component type or instance,
and I think the get_full_name() just apply to uvm_component, because only the uvm_componnet has the hierarchical name, if you use uvm_object.get_full_name just
get the name you give when you create.
I think it’s a good way by using uvm_callback taking the place of overided uvm_object!
I have overridden uvm_objects by instanceby using the path of the component instantiating the object and a wildcard as a path (not sure if the wildcard is really required).
There is a way to override a particular instance of the uvm_object given that you update the creation of that object by having some dummy path and using the same dummy path while doing set_inst_override. But you said, you can’t update the external VIP.
Did you try any of the following methods suggested by “haitao73” & “tudor.timi” above?
So how did you solve this? Just curious to know the solution for this.