I recieved this error
Error-[NOA] Null object access
…/apb_adapter.sv, 26
The object at dereference depth 0 is being used before it was
constructed/allocated.
Please make sure that the object is allocated before using it.
26 in error shows the line number 5 of the following code.
function void bus2reg(uvm_sequence_item bus_item, ref uvm_reg_bus_op rw);
apb_transaction pkt;
if(!$cast(pkt,bus_item))
`uvm_fatal("apb_adapter","reg_sequence can't be casted to apb_transaction")
rw.data = pkt.apb_data;
rw.addr = pkt.apb_addr;
rw.kind = pkt.apb_write? UVM_WRITE : UVM_READ;
rw.status = UVM_IS_OK;
`uvm_info(get_type_name(),$sformatf("Bus2Reg %s",pkt.sprint()),UVM_MEDIUM)
endfunction
Can anybody explain why i am having this error?