How to execute a recursive factory override?

Hi,

I’m trying to execute a simple UVM factory example.
When I try a recursive override, I got the error message

UVM_ERROR @ 0: reporter [OVRDLOOP] Recursive loop detected while finding override.

If I want to execute a factory overriding in recursive factory override. What am I supposed to do?


 virtual function void build_phase(uvm_phase phase);
   ...
   ...
   set_type_override_by_type(base_agent::get_type(), child_agent::get_type());
   ...   
   set_type_override_by_type(child_agent::get_type(), base_agent::get_type());
   ...   
 endfunction

In reply to UVM_LOVE:
Not sure I understand what you are trying to accomplish. Are you trying to undo the factory override and revert back to the base_agent?

In reply to UVM_LOVE:

If I want to execute a factory overriding in recursive factory override

Don’t register the 1st override in that case ( based on configuration / run-time switch )
You won’t need to override a previous override that way.