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