dear chr_sue sir,
this is agent top module may be set/get problem please tell me what is wrong
///////////////////////////////////////////////////////////////////////////////////////////
ifndef w_agent_top
define w_agent_top
import uvm_pkg::*;
include"uvm_macros.svh"
include"w_agent.sv"
include"w_config.sv"
include"env_config.sv"
class w_agent_top extends w_agent;
`uvm_component_utils(w_agent_top)
w_agent wagt;
env_config ecfg;
w_config wcfg;
extern function new(string name=“w_agent_top”, uvm_component parent);
extern function void build_phase(uvm_phase phase);
endclass
//New construct
function w_agent_top::new(string name=“w_agent_top”,uvm_component parent);
super.new(name,parent);
endfunction
//Build Phase
function void w_agent_top::build_phase(uvm_phase phase);
super.build_phase(phase);
if(!uvm_config_db#(env_config)::get(this,“”,“env_config”,ecfg))
`uvm_fatal(“TB_CONFIG”,“can not get() ecfg from uvm_config”)
if(ecfg.has_wagent)
begin
wagt=new[ecfg.no_wr_agent];
foreach(wagt[i])
begin
wagt[i]=w_agent::type_id::create($sformatf(“wagt[%0d]”,i),this);
// Set the w_config class
uvm_config_db#(w_config)::set(this,$sformatf(“wagt[%0d]*”,i),“w_config”,ecfg.wcfg[i]);
end
end
endfunction
`endif