NOA null object access error

tell me y it is showing null object access and also tell me why it is not diaplaying the values

// Code your testbench here
// or browse Examples
`include "ocx_pkg.sv"
`include "driver.sv"
interface txintf;
   logic rst_n,clk=0;
   logic valid,error;
   logic [511:0] data;
   logic eop_ptr_6;
    port ocx_out;

endinterface

module ocx_tx_tb;

  txintf tx_if();

  ocx_tx  dut(tx_if.rst_n,tx_if.clk,tx_if.valid,tx_if.error,tx_if.data,tx_if.eop_ptr_6,tx_if.ocx_out);

test ts (tx_if);
always  #10 tx_if.clk=~tx_if.clk;
endmodule
program test(txintf tx_if);
driver drv;
mailbox seq_drv ;

  initial
 begin
   
   //seq_drv=new();
   drv=new(seq_drv,tx_if);
   drv.run();
 $monitor("clk=%d,rst_n=%d,sop=%d,eop=%d,valid=%d,error=%d,data=%d",tx_if.clk,tx_if.rst_n,tx_if.ocx_out.sop,tx_if.ocx_out.eop,tx_if.ocx_out.valid,tx_if.ocx_out.error,tx_if.ocx_out.data);
 #200 $finish;
 end
  
endprogram

class data_item;
rand bit sop,eop;
rand bit valid,error;
rand bit [7:0] data;
rand bit [6:0] length;
rand byte cycles;

constraint normal
	{
	length inside {[2:63]};
	cycles <=128;
	}
endclass

class driver;
virtual interface txintf tx_if;
//virtual txintf tx_if;
mailbox seq_drv;
data_item d_item;

  function new( mailbox seq_drv, virtual interface txintf tx_if);
this.seq_drv	= seq_drv;
this.tx_if  =tx_if;
this.d_item = d_item;
endfunction

task run();
int i;
  forever
begin
	
  while(!tx_if.rst_n)
		begin
          @(posedge tx_if.clk);
		tx_if.ocx_out.sop	= 0;
		tx_if.ocx_out.valid	= 0;
		tx_if.ocx_out.eop	= 0;
		tx_if.ocx_out.error	= 0;
		tx_if.ocx_out.data= 0;
		 seq_drv.get(d_item);
        end
  foreach(tx_if.data[i])
            begin
              @(posedge tx_if.clk);
              if(i==0)
        begin 
        tx_if.ocx_out.sop	= 1;//d_item.sop;
		tx_if.ocx_out.valid	=1; //d_item.valid;
		tx_if.ocx_out.eop	= 0;//d_item.eop;
		tx_if.ocx_out.error	= 0;//d_item.error;
		tx_if.ocx_out.data	= d_item.data;
        //rx_if.ocx_out.data_8= d_item.data_8;
        
end
        end   
        end
  

endtask
endclass

In reply to sai ganesh:

tell me y it is showing null object access and also tell me why it is not diaplaying the values

// Code your testbench here
// or browse Examples
`include "ocx_pkg.sv"
`include "driver.sv"
interface txintf;
logic rst_n,clk=0;
logic valid,error;
logic [511:0] data;
logic eop_ptr_6;
port ocx_out;
endinterface
module ocx_tx_tb;
txintf tx_if();
ocx_tx  dut(tx_if.rst_n,tx_if.clk,tx_if.valid,tx_if.error,tx_if.data,tx_if.eop_ptr_6,tx_if.ocx_out);
test ts (tx_if);
always  #10 tx_if.clk=~tx_if.clk;
endmodule
program test(txintf tx_if);
driver drv;
mailbox seq_drv ;
initial
begin
//seq_drv=new();
drv=new(seq_drv,tx_if);
drv.run();
$monitor("clk=%d,rst_n=%d,sop=%d,eop=%d,valid=%d,error=%d,data=%d",tx_if.clk,tx_if.rst_n,tx_if.ocx_out.sop,tx_if.ocx_out.eop,tx_if.ocx_out.valid,tx_if.ocx_out.error,tx_if.ocx_out.data);
#200 $finish;
end
endprogram

class data_item;
rand bit sop,eop;
rand bit valid,error;
rand bit [7:0] data;
rand bit [6:0] length;
rand byte cycles;
constraint normal
{
length inside {[2:63]};
cycles <=128;
}
endclass
class driver;
virtual interface txintf tx_if;
//virtual txintf tx_if;
mailbox seq_drv;
data_item d_item;
function new( mailbox seq_drv, virtual interface txintf tx_if);
this.seq_drv	= seq_drv;
this.tx_if  =tx_if;
this.d_item = d_item;
endfunction
task run();
int i;
forever
begin
while(!tx_if.rst_n)
begin
@(posedge tx_if.clk);
tx_if.ocx_out.sop	= 0;
tx_if.ocx_out.valid	= 0;
tx_if.ocx_out.eop	= 0;
tx_if.ocx_out.error	= 0;
tx_if.ocx_out.data= 0;
seq_drv.get(d_item);
end
foreach(tx_if.data[i])
begin
@(posedge tx_if.clk);
if(i==0)
begin 
tx_if.ocx_out.sop	= 1;//d_item.sop;
tx_if.ocx_out.valid	=1; //d_item.valid;
tx_if.ocx_out.eop	= 0;//d_item.eop;
tx_if.ocx_out.error	= 0;//d_item.error;
tx_if.ocx_out.data	= d_item.data;
//rx_if.ocx_out.data_8= d_item.data_8;
end
end   
end
endtask
endclass

it is saying driver.sv 51 as NOA error which is //tx_if.ocx_out.data = d_item.data;