Bad handle or reference

We have following code.

master_module.sv

typedef virtual mgc_usb #(XCVR_SELECT_WIDTH) usb_if_t;

mgc_usb #(XCVR_SELECT_WIDTH) usb_if(rec_clk, Reset);

initial begin
ovm_container #( usb_if_t )::set_value_in_global_config( “USB_IF” , usb_if );
mvc_barrier_pool::run_test(“test”);
end

test_fs.v

function void test_fs::build();
m_config = new();

usb_master_agent = mvc_agent::type_id::create(“usb_master_agent”, this);

m_virtual_sequencer = new(“virtual_sequencer” , this );

m_config.usb_master_cfg.m_bfm = ovm_container #(usb_if_t)::get_value_from_config (this, “USB_IF”);

set_config_object(“usb_master_agent*” , mvc_config_base_id , m_config.usb_master_cfg , 0 );

do_usb_master_config();
endfunction

The compilation goes through ok but simulation fails with following error:

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

Time: 0 ps Iteration: 5 Process: /ovm_pkg::ovm_root::run_test/#FORK#1124_2a9a9e411c1 File: /tools/questamvc/v2010.3/QUESTAVER_10.0/questa_mvc_src/sv/ovm_container.sv

Fatal error in Function ovm_container_pkg/ovm_container::get_value_from_config at /tools/questamvc/v2010.3/QUESTAVER_10.0/questa_mvc_src/sv/ovm_container.sv line 99

HDL call sequence:

Stopped at /tools/questamvc/v2010.3/QUESTAVER_10.0/questa_mvc_src/sv/ovm_container.sv 99 Function ovm_container_pkg/ovm_container::get_value_from_config

called from /scratch/mrudula/zaxxon_sandbox/xs1_chip_lvl_verif/TB/Verilog/mentor_usb_mvc/usb_full_speed/usb_full_speed.svh 120 Function test_pkg/test_fs::build

called from /tools/questasim/v10.3/questasim/linux_x86_64/…/verilog_src/ovm-2.1.2/src/base/ovm_root.svh 433 Function ovm_pkg/build_phase::call_func

called from /tools/questasim/v10.3/questasim/linux_x86_64/…/verilog_src/ovm-2.1.2/src/base/ovm_component.sv 663 Function ovm_pkg/ovm_component::do_func_phase

called from /tools/questasim/v10.3/questasim/linux_x86_64/…/verilog_src/ovm-2.1.2/src/base/ovm_root.svh 1686 Function ovm_pkg/ovm_root::m_do_phase

called from /tools/questasim/v10.3/questasim/linux_x86_64/…/verilog_src/ovm-2.1.2/src/base/ovm_root.svh 1712 Function ovm_pkg/ovm_root::m_do_phase

called from /tools/questasim/v10.3/questasim/linux_x86_64/…/verilog_src/ovm-2.1.2/src/base/ovm_root.svh 1562 Task ovm_pkg/ovm_root::run_global_phase

called from /tools/questasim/v10.3/questasim/linux_x86_64/…/verilog_src/ovm-2.1.2/src/base/ovm_root.svh 1124 Task ovm_pkg/ovm_root::run_test

Can anyone please give me some pointers to help with this issue.

Thanks

In reply to jon_ferg:

I suggest you look for any other errors or warning before this fatal that might give you a clue as to what might be going wrong. Also look at line 99 of ovm_container.sv

In reply to dave_59:

Thanks Dave, I have checked the usual and there are no other obvious errors or warnings.

This function in ovm_container.sv gives error.

static function T get_value_from_config( ovm_component c , string config_id );
ovm_object o;
ovm_container #(T) tmp;

assert (c.get_config_object (config_id, o, 0))
  else c.ovm_report_error ( s_no_container_config_id ,
                                $psprintf( "component has no config object associated with %s" , config_id ) );

assert ($cast (tmp, o))
  else c.ovm_report_error ( s_container_config_type_error_id ,
                                $psprintf( "object associated with %s is not of the correct type" , config_id) );

return tmp.t; // line 99 is here
endfunction

In reply to jon_ferg:

You will need to contact your vendor’s support line as this may be a tool issue. For example, do you have assertions disabled?

In reply to dave_59:

Thanks Dave.
I was fighting with same issue.
Assertions were off, and that was the problem. We had an initial that switched off assertions till device was out of reset. VIP seems to need assertions on at zero time. Letting the assertions on all the time, worked.

In reply to vkantamn:

How is this error related?

In reply to dave_59:

Hi Vidya,

Please check if assertions are on. QVIP modules complain if they are not. Try to force them on if possible.

Regards,
Mrudula.

In reply to Mrudula Gore:

Hello Dave, Hi Mrudula,

thank you for your reply. The error says its a “bad handle or reference”. I am posting the lines of error as is for you.

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

Time: 0 ns Iteration: 7 Process: /ovm_pkg::ovm_root::run_test/#FORK#499_f782324 File: ./env/rtr_rtl_env.svh

Fatal error in Function ovm_pkg/ovm_port_base::connect at …/ovm/src/base/ovm_port_base.svh line 395

HDL call sequence:

Stopped at ./env/rtr_rtl_env.svh 31 Function ovm_pkg/ovm_port_base::connect

called from …/ovm/src/base/ovm_root.svh 275 Function ovm_pkg/connect_phase::call_func

called from …/ovm/src/base/ovm_component.sv 546 Function ovm_pkg/ovm_component::do_func_phase

called from …/ovm/src/base/ovm_root.svh 888 Function ovm_pkg/ovm_root::m_do_phase

called from …/ovm/src/base/ovm_root.svh 869 Function ovm_pkg/ovm_root::m_do_phase

called from …/ovm/src/base/ovm_root.svh 869 Function ovm_pkg/ovm_root::m_do_phase

called from …/ovm/src/base/ovm_root.svh 792 Task ovm_pkg/ovm_root::run_global_phase

called from …/ovm/src/base/ovm_root.svh 499 Task ovm_pkg/ovm_root::run_test

@Mrudula, can you please mention, how can I turn them on? I am completely clueless about it. Thank you.

In reply to vkantamn:

Hi Vidya,

This is one method:
In your testbench, top.v file have an initial that does $asserton

initial begin
$asserton;
$display(“TB: assertions on @ %t”,$time);
end // initial begin

Or you can specify it on command line.

HTH
Mrudula.

In reply to Mrudula Gore:

Mrudula,

This looks like a completely different problem, other than both resulted in referencing a null handle. Most likely assertions has nothing to do with it.

Your problem looks like have a bad connection in the file ./env/rtr_rtl_env.svh line 31.

BTW Vidya, You can selectively turn assertions on or off to particular scopes, modules or interfaces. You do not have to globally turn them on.