Fatal error

Hi,

I’m getting this error:

** Fatal: (SIGSEGV) Bad handle or reference.

Time: 200 ns Iteration: 0 Process: /uvm_pkg::uvm_task_phase::execute/#FORK#137(#ublk#215181159#137)_f7050af File: …//tb/unittb_reg_model_wrapper.svh

Fatal error in Function unittb_pkg/reg_model_wrapper::reg_write_field_by_name at …//tb/unittb_reg_model_wrapper.svh line 121

Here’s the code snippet:

function void reg_model_wrapper::reg_write_field_by_name(string regname, string fieldname, uvm_reg_data_t v);

uvm_reg sr_h;

sr_h = m_reg_map_h.get_reg_by_name(regname);

sr_h.get_field_by_name(fieldname).predict(v);

endfunction

Could anyone please help ?
I have checked the register model. It’s fine and compiles well. The register I’m trying to access exists. I don’t understand the error therefore.

In reply to manudziner:
Have you checked that the following are not null?

  • m_reg_map_h
  • sr_h
  • sr_h.get_field_by_name(fieldname)

In reply to dave_59:

Thanks Dave.

It was a null handle. Hard to debug in a code written by someone else. It wasn’t even created and there was no error message to report a failed retrieval.

Thanks again for the pointer.