In reply to ABD_91:
You have recursive Consumer object construction. Use the factory to create the Consumer_child
class Consumer extends uvm_component ;
`uvm_component_utils(Consumer)
uvm_blocking_put_imp #(trans,Consumer ) put_imp ;
`COMP_NEW
function void build_phase ( uvm_phase phase ) ;
put_imp = new("put_imp",this);
endfunction
virtual task put ( trans t );
endtask
endclass
class env extends uvm_component ;
`uvm_component_utils(env)
`COMP_NEW
Consumer cons ;
Producer prod ;
function void build_phase ( uvm_phase phase ) ;
cons = Consumer::type_id::create("cons",this);
prod = new("prod",this);
endfunction
function void connect_phase ( uvm_phase phase ) ;
prod.put_port.connect(cons.put_imp) ;
endfunction
endclass
initial begin
Consumer::type_id::set_type_override(Consumer_child::type_id::get());
run_test("env") ;
end
endmodule