`protectclassuvm_fgp_thread_object_base;staticuvm_fgp_thread_object_baseregisteredObjs[$];staticfunctionvoidinitObjs();foreach(registeredObjs[i])beginregisteredObjs[i].initDynamicArray();endendfunctionvirtualfunctionvoidinitDynamicArray();endfunctionendclassclassuvm_fgp_thread_object#(typeT=uvm_object)extendsuvm_fgp_thread_object_base;`define MAX_FIXED_FGP_UVM_T_SIZE 16TfaObjs[`MAX_FIXED_FGP_UVM_T_SIZE];TdaObjs[];functionnew();for(inti=0;i<`MAX_FIXED_FGP_UVM_T_SIZE;i++)beginfaObjs[i]=null;enduvm_fgp_thread_object_base::registeredObjs.push_back(this);endfunctionfunctionintunsignedget_thread_index();return0;endfunctionfunctionintunsignedget_max_thread();return0;endfunction// this function is only be available after fgp initialization phase virtualfunctionvoidinitDynamicArray();intunsignedsize=get_max_thread();if(size<=`MAX_FIXED_FGP_UVM_T_SIZE)beginreturn;endsize=size-`MAX_FIXED_FGP_UVM_T_SIZE;daObjs=new[size];for(inti=0;i<size;i++)begindaObjs[i]=null;endendfunctionfunctionTget_wrapper();Tobj=null;intunsignedindex=get_thread_index();if(index<`MAX_FIXED_FGP_UVM_T_SIZE)beginif(faObjs[index]==null)beginfaObjs[index]=new;endobj=faObjs[index];endelsebeginindex=index-`MAX_FIXED_FGP_UVM_T_SIZE;if(daObjs[index]==null)begindaObjs[index]=new;endobj=daObjs[index];endreturnobj;endfunctionendclassclassuvm_fgpinit_phaseextendsuvm_topdown_phase;localstaticuvm_fgpinit_phasem_inst;intflag;staticconststringtype_name="uvm_fgpinit_phase";staticfunctionuvm_fgpinit_phaseget();if(m_inst==null)beginm_inst=new;m_inst.flag=0;endreturnm_inst;endfunctionprotectedfunctionnew(stringname="vcs_fgp_init");super.new(name);endfunctionvirtualfunctionstringget_type_name();returntype_name;endfunctionfunctionvoidfgp_uvm_component_info(uvm_componentc1,uvm_componentc2,stringname,intflag);endfunctionvirtualfunctionvoidexecute(uvm_componentcomp,uvm_phasephase);uvm_agentisAgent;uvm_envisEnv;uvm_componentempty;stringname;inttype_flag;if(!flag)beginflag=1;if($test$plusargs("VCS_UVM_FGP_DIAG"))begin$display("FGP before running phase");endtraverse_all_component(comp);fgp_uvm_component_info(empty,empty,name,type_flag);uvm_fgp_thread_object_base::initObjs();endendfunctionfunctionvoidtraverse_all_component(uvm_componentcomp);stringname;inttype_flag;uvm_agentisAgent;uvm_envisEnv;uvm_monitorisMon;uvm_driverisDrv;uvm_testisTest;uvm_sequencerisSeqr;uvm_componentparent;beginname=comp.get_name();parent=comp.get_parent();type_flag=0;if($cast(isAgent,comp))begintype_flag=1;endelseif($cast(isDrv,comp))begintype_flag=2;endelseif($cast(isMon,comp))begintype_flag=3;endelseif($cast(isSeqr,comp))begintype_flag=4;endelseif($cast(isEnv,comp)||$cast(isTest,comp))begintype_flag=5;endfgp_uvm_component_info(parent,comp,name,type_flag);if($test$plusargs("VCS_UVM_FGP_DIAG"))begin$display("fgpUvmComponentInfo: %s, %d ",comp.get_full_name(),type_flag);endif(comp.get_first_child(name))begindothis.traverse_all_component(comp.get_child(name));while(comp.get_next_child(name));endendendfunctionendclassclassuvm_fgpinit_obj;functionnew();uvm_domaindm=uvm_domain::get_common_domain();uvm_phaserun=dm.find(uvm_run_phase::get());dm.add(uvm_fgpinit_phase::get(),null,null,run);endfunctionendclass`endprotect