Hi All,
please find the code snippet below:
class tx_agent_cfg extends uvm_object;
bit active;
virtual intf intf_h;
endclass
class ext_tx_agent_cfg extends tx_agent_cfg;
bit[2:0] x;
endclass
class tx_agent extends uvm_agent;
tx_agent_cfg tx_cfg;
//monitor handle
//driver handle
//sequencer handle
endclass
class ext_tx_agent extends uvm_agent;
ext_tx_agent_cfg tx_cfg;
//monitor handle
//driver handle
//sequencer handle
function void build_phase(uvm_phase phase);
if(!$cast(tx_cfg,super.tx_cfg)
`uvm_fatal("EXT_AGENT","Casting failed for tx_cfg")
endfunction
endclass
class base_test extends uvm_test;
//env handle
//setting of interface to agents
endclass
class ext_base_test extends base_test;
function void build_phase(uvm_phase phase);
factory.set_type_override_by_name("tx_agent_cfg","ext_tx_agent_cfg",1);
endfunction
endclass
So in test level overriding the class tx_agent_cfg with ext_tx_agent_cfg in build phase.
But here when I try to use ‘x’ in the ext_base_test it is giving compilation errors saying that x is not found in env_h.tx_agent.tx_cfg.
please help me in this situation