"NULL pointer dereference" Error!

Hi, all
I met an issue as following, can anyone help me?

OVM_INFO @ 0.00 ns: ovm_test_top [ovm_test_top] Starting loop 0, equidistant traffic on LL and BE ports, sweep traffic on GT ports
SDI/Verilog Transaction Recording Facility Version 09.20-s011

Error! NULL pointer dereference
File: …/ovc/mtl/ip_fusion_2055_2034_mtl_monitor_class.sv, line = 56, pos = 43
Scope: ip_fusion_2055_2034lib.$unit_0x36acc8fa::ip_fusion_2055_2034_mtl_monitor_c#(128,10,32,16,7,8)@15665_3.run
Time: 0 FS + 20

…/ovc/mtl/ip_fusion_2055_2034_mtl_monitor_class.sv:56 @(posedge bus_if_wrap.bus_if.clk);
ncsim> if { $env(abv) == “ABV_ON” } {

assertion -summary -directive assert -redirect assertion.log
assertion -summary -directive assert

}
ncsim> exit
TOOL: irun 09.20-s011: Exiting on Nov 22, 2010 at 16:08:19 CST (total: 00:00:50)

Parts of monitor class code is as following, and lines with red color is line 56:

virtual class ip_fusion_2055_2034_mtl_monitor_c #(int d_w = 32,
int id_w = 8,
int addr_w= 32,
int str_w = 8,
int bs_w = 8,
int lns_w = 8) extends ip_fusion_2055_2034_base_monitor_c;
// local variables
local int d_w_log;
int wdc;
int rdc;
int account, account_peak;
int bw;
bit peak_en;
int pend;
real clk_per;
ip_fusion_2055_2034_mtl_if_wrap_c #(.d_w ( d_w ),
.id_w ( id_w ),
.addr_w( addr_w),
.str_w ( str_w ),
.bs_w ( bs_w ),
.lns_w ( lns_w )) bus_if_wrap;

`ovm_component_param_utils_begin(ip_fusion_2055_2034_mtl_monitor_c #(d_w,id_w,addr_w,str_w,bs_w,lns_w))
  `ovm_field_int   (account,      OVM_ALL_ON)
  `ovm_field_int   (account_peak, OVM_ALL_ON)
  `ovm_field_int   (pend,         OVM_ALL_ON)
  `ovm_field_int   (bw,           OVM_ALL_ON)
  `ovm_field_int   (peak_en,      OVM_ALL_ON)
  `ovm_field_object(bus_if_wrap,  OVM_ALL_ON)
`ovm_component_utils_end
// Constructor
function new(string name, ovm_component parent);
    int j = d_w / 8;
    super.new(name, parent);
    wdc = 0;
    rdc = 0;
    d_w_log = 0;
    bw = 0;
    peak_en = 1'b0;
    while (j > 1) begin
        d_w_log++;
        j >>= 1;
    end
endfunction : new
// run function
virtual task run();
    pend = 0;
    account = 0;
    account_peak = 0;
    fork
        begin

@(posedge bus_if_wrap.bus_if.clk); clk_per = $realtime;
@(posedge bus_if_wrap.bus_if.clk);
clk_per = $realtime - clk_per;
end
forever begin
@(posedge bus_if_wrap.bus_if.clk);
if (bus_if_wrap.bus_if.cmd_valid && bus_if_wrap.bus_if.cmd_accept) begin
if (pend == 0) begin
void’(get_config_int(“bw”, bw));
void’(get_config_int(“peak_en”, peak_en));
end
pend += (bus_if_wrap.bus_if.cmd_block_size + 1) * (bus_if_wrap.bus_if.cmd_lines + 1);
end
if (bus_if_wrap.bus_if.rd_valid) begin
pend–;
account = (account > 100) ? account - 100 : 0;
end
if (bus_if_wrap.bus_if.wr_accept) begin
pend–;
account = (account > 100) ? account - 100 : 0;
end
if (pend > 0 && !account[31])
account += bw;
else if (pend == 0)
account = 0;
account_peak = peak_en && (account > account_peak) ? account : account_peak;
end
super.run();
join
endtask : run

Hi,

Can you please make sure that you are passing “bus_if_wrap” class instance using set_config_object(“*”,“bus_if_wrap”, bus_if_wrap, 0); from testbench file.

Here “0” will pass the handle.

Hope this will resolve the issue.

Thanks,
Vaibhav

Hi, Vaibhav Tekale,

Thanks for you reply. But I have done this in testbench like this:


initial begin

  // connect virtual interface to IF Agent(s)
  set_config_object("*.if_agent0" , "bus_if_wrap", if_interface0_wrapper, 0);
  set_config_object("*.if_agent1" , "bus_if_wrap", if_interface1_wrapper, 0);
  set_config_object("*.if_agent2" , "bus_if_wrap", if_interface2_wrapper, 0);
  set_config_object("*.if_agent3" , "bus_if_wrap", if_interface3_wrapper, 0);
  set_config_object("*.if_agent4" , "bus_if_wrap", if_interface4_wrapper, 0);
  set_config_object("*.if_agent5" , "bus_if_wrap", if_interface5_wrapper, 0);
  set_config_object("*.if_agent6" , "bus_if_wrap", if_interface6_wrapper, 0);
 
  // connect virtual interface to QU Agent(s)
  set_config_object("*.qu_agent0_0"  , "bus_if_wrap", qu_interface0_0_wrapper, 0);
  set_config_object("*.qu_agent1_0"  , "bus_if_wrap", qu_interface1_0_wrapper, 0);
  set_config_object("*.qu_agent2_0"  , "bus_if_wrap", qu_interface2_0_wrapper, 0);
  set_config_object("*.qu_agent3_0"  , "bus_if_wrap", qu_interface3_0_wrapper, 0);
  set_config_object("*.qu_agent4_0"  , "bus_if_wrap", qu_interface4_0_wrapper, 0);
  set_config_object("*.qu_agent5_0"  , "bus_if_wrap", qu_interface5_0_wrapper, 0);
  set_config_object("*.qu_agent6_0"  , "bus_if_wrap", qu_interface6_0_wrapper, 0);

  // Start the test... 
  run_test();

end


The issue is still exist :(

Hi,
Can you please make sure that you are passing “bus_if_wrap” class instance using set_config_object(“*”,“bus_if_wrap”, bus_if_wrap, 0); from testbench file.
Here “0” will pass the handle.
Hope this will resolve the issue.
Thanks,
Vaibhav

Can you please try using get_config_object method in the respective agents.

Also, can you please make sure that you are calling the super.build() method in agent, and also you have done the factory registration for all components.

Regards,
Vaibhav

Also Make sure that you connect to the interface handle that you’re getting from the get_config, So that there will be connection between the interface that you’re using in your agent and the physical interface which you connect @ tb_top.

Hope this helps.

-Venky

Can you please try using get_config_object method in the respective agents.
Also, can you please make sure that you are calling the super.build() method in agent, and also you have done the factory registration for all components.
Regards,
Vaibhav