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 ramankaur09:

Two remarks only:
(1)

function new(string name,uvm_component parent);
      super.new(name,parent);
      monitor_aport = new("monitor_aport", this); // What's this??
      aport = new("aport", this);
    endfunction

(2) Does your monitor has an analysis port named aport? And did you contruct it?