The object at dereference depth 1 is being used before it was constructed/allocated. Please make sure that the object is allocated before using it

In reply to chr_sue:
Hello,

ifndef AXI_AGENT_PKG define AXI_AGENT_PKG
import env_pkg::*;
`include “axi_monitor.sv”
class axi_agent extends uvm_agent;

`uvm_component_utils(axi_agent)
axi_sequencer m_seqr ;
axi_driver m_driver;
axi_monitor m_monitor;
//axi_config m_config;
uvm_analysis_port #(stimulus) aport;
uvm_analysis_port #(stimulus) monitor_aport;
virtual axi_intf intf;

function new(string name,uvm_component parent);
super.new(name,parent);
monitor_aport = new(“monitor_aport”, this);
aport = new(“aport”, this);
endfunction

extern virtual function void build_phase(uvm_phase phase);
extern virtual function void connect_phase(uvm_phase phase);

endclass: axi_agent

function void axi_agent::build_phase(uvm_phase phase);
if(!uvm_config_db# (virtual axi_intf)::get(this,“”,“intf”,intf))
`uvm_error(“ERROR AGENT”,“BUILD_PHASE”)

m_seqr = axi_sequencer::type_id::create(“m_seqr”,this);
m_driver = axi_driver::type_id::create(“m_driver”,this);
//m_driver.intf = intf;
m_monitor = axi_monitor::type_id::create(“m_monitor”,this);
`uvm_info(“UMONITOR”,get_type_name(),UVM_LOW);
endfunction

function void axi_agent::connect_phase(uvm_phase phase);
m_driver.seq_item_port.connect(m_seqr.seq_item_export);
line 44-> m_monitor.aport.connect(aport);
endfunction

`endif