Bad handle of reference type fatal error in start task please suggest me whatever i am doing wrong

ifndef scoreboard define scoreboard
`include “w_xtn.sv”

class scoreboard;
int number_of_transaction=5;

event DONE;

int data_verified = 0;
int rm_data_count = 0;
int mon_data_count = 0;

w_xtn rm_data;
w_xtn rcvd_data;
w_xtn cov_data;

mailbox#(w_xtn) rm_in_ch;//mailbox from refrence model to scoreboard
mailbox#(w_xtn)mon_in_ch;//mailbox from read monitor to scoreboard

covergroup dd_coverage;
option.per_instance=1;

RST: coverpoint cov_data.rst{

                          bins LOW={0};
                          bins HIGH={1};
                        }

DATA:coverpoint cov_data.data{

                           bins LOW={[0:4]};
                           bins HIGH={[5:7]};
                          }

endgroup

//new construct

function new(mailbox#(w_xtn) rm_in_ch,
mailbox#(w_xtn) mon_in_ch);

//$display(“===========FLDEC FLDEC”);

         this.rm_in_ch=rm_in_ch;
         this.mon_in_ch=mon_in_ch;
          dd_coverage=new();

endfunction

//START task
task start();

fork
while(1)//this while(1) works like forever loop
begin
rm_in_ch.get(rm_data);
rm_data_count++;

    mon_in_ch.get(rcvd_data);

    mon_data_count++;

    check(rcvd_data);
end

join_none
endtask

////CHECK TASK

virtual task check(w_xtn rc_data);

string diff;
if(rc_data.rst==0)
begin
if(rc_data.oYCbCr==0 && rc_data.oDVAL==0)

   $display("SB:Random data not written");

  else if(rc_data.rst==0 && rc_data.oYCbCr!=0 && rc_data.oDVAL!=0)         

    begin
           if(!rm_data.compare(rc_data,diff))
              
               begin
                     rc_data.display("SB:Received data");
                     rm_data.display("SB:data sent ot DUV");
                     $display("%s\n%m\n\n",diff);
                     $finish;
                  end
           else
                      $display("SB:%s\n%m\n\n",diff);
                        
                       cov_data=rm_data;
                      dd_coverage.sample();

end
data_verified++;

            if(data_verified==(number_of_transaction-rc_data.no_of_write_trans))
                begin
                         ->DONE;///event triggered 
                   end

end
endtask

function void report();
$display(“=========================SCOREBOARD REPORT==================================”);
$display(“%0d data generated,%0d data Received, %0d Data Verified\n”,rm_data_count,mon_data_count,data_verified);
$display(“--------------------FLDEC FLDEC FLDEC FLDEC ----------------------------”);
$display(“=========== SHUBHAM VERIFICATION ENGINEER=================”);
endfunction

endclass
`endif

/////////////////////////////////////////ERROR ERROR ERROR ///////////////////////////

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

Time: 0 ps Iteration: 0 Process: /vedio_top_sv_unit::scoreboard::start/fork#57_4f5f7218 File: scoreboard.sv

Fatal error in Task std/mailbox::get at C:/questasim64_10.4e/win64/…/verilog_src/std/std.sv line 52

In reply to hurmath@fldec:

ifndef scoreboard define scoreboard
include "w_xtn.sv" class scoreboard; int number_of_transaction=5; event DONE; int data_verified = 0; int rm_data_count = 0; int mon_data_count = 0; w_xtn rm_data; w_xtn rcvd_data; w_xtn cov_data; mailbox#(w_xtn) rm_in_ch;//mailbox from refrence model to scoreboard mailbox#(w_xtn)mon_in_ch;//mailbox from read monitor to scoreboard covergroup dd_coverage; option.per_instance=1; RST: coverpoint cov_data.rst{ bins LOW={0}; bins HIGH={1}; } DATA:coverpoint cov_data.data{ bins LOW={[0:4]}; bins HIGH={[5:7]}; } endgroup //new construct function new(mailbox#(w_xtn) rm_in_ch, mailbox#(w_xtn) mon_in_ch); //$display("===========FLDEC FLDEC"); this.rm_in_ch=rm_in_ch; this.mon_in_ch=mon_in_ch; dd_coverage=new(); endfunction //START task task start(); fork while(1)//this while(1) works like forever loop begin rm_in_ch.get(rm_data); rm_data_count++; mon_in_ch.get(rcvd_data); mon_data_count++; check(rcvd_data); end join_none endtask ////CHECK TASK virtual task check(w_xtn rc_data); string diff; if(rc_data.rst==0) begin if(rc_data.oYCbCr==0 && rc_data.oDVAL==0) $display("SB:Random data not written"); else if(rc_data.rst==0 && rc_data.oYCbCr!=0 && rc_data.oDVAL!=0) begin if(!rm_data.compare(rc_data,diff)) begin rc_data.display("SB:Received data"); rm_data.display("SB:data sent ot DUV"); $display("%s\n%m\n\n",diff); $finish; end else $display("SB:%s\n%m\n\n",diff); cov_data=rm_data; dd_coverage.sample(); end data_verified++; if(data_verified==(number_of_transaction-rc_data.no_of_write_trans)) begin ->DONE;///event triggered end end endtask function void report(); $display("=========================SCOREBOARD REPORT=================================="); $display("%0d data generated,%0d data Received, %0d Data Verified\n",rm_data_count,mon_data_count,data_verified); $display("--------------------FLDEC FLDEC FLDEC FLDEC ----------------------------"); $display("=========== SHUBHAM VERIFICATION ENGINEER================="); endfunction endclass endif
/////////////////////////////////////////ERROR ERROR ERROR ///////////////////////////
** Fatal: (SIGSEGV) Bad handle or reference.

Time: 0 ps Iteration: 0 Process: /vedio_top_sv_unit::scoreboard::start/fork#57_4f5f7218 File: scoreboard.sv

Fatal error in Task std/mailbox::get at C:/questasim64_10.4e/win64/…/verilog_src/std/std.sv line 52

As the error says the problem lies with the mailboxes, they are assumed to be passed in the new function of the scoreboard, but it seems they are now allocated (‘newed’) check the mailboxes you are passing to the new method of the scoreboard when creating it are allocated, also use code tags.

HTH,

-R

sorry sir ,
i didnt get please explane properly meaning of this line:
“check the mailboxes you are passing to the new method of the scoreboard when creating it are needed”

In reply to hurmath@fldec:

In your environment the scoreboard is being created, something like

Scoreboard my_scoreboard;
Then you call the new method.

my_scoreboard = new(mailbox_from_ref_model, mailbox_from_monitor);
These two mailboxes need to be created somewhere if they are not you’ll get a bad handle since they are null.
Somewhere you need have mailbox mailbox_from_ref_model = new(); and the same for the other. Can you show how are instantiating the scoreboard in your environment?

-R

In reply to hurmath@fldec:

sorry sir ,
i didnt get please explane properly meaning of this line:
“check the mailboxes you are passing to the new method of the scoreboard when creating it are needed”

I believe your problem is here in the constructor of your scoreboard:

function new(mailbox#(w_xtn) rm_in_ch, mailbox#(w_xtn) mon_in_ch);
//$display("===========FLDEC FLDEC");
  this.rm_in_ch=rm_in_ch;
  this.mon_in_ch=mon_in_ch;
  dd_coverage=new();
endfunction

Yopu have to construct each mailbox for a certain size. If you do not so a nailbox object is not existing. Your code should be like this:

function new();
  rm_in_ch = new();   // creates a mailbox of unbounded size
  mon_in_ch = new();
  dd_coverage=new();
endfunction

What I’d like to understand is what kind you code you are writing, because this definitely no UVM code, right?

this is system verilog code sir .

function new();
rm_in_ch = new(); // creates a mailbox of unbounded size
mon_in_ch = new();
dd_coverage=new();
endfunction

///// Sir i did this change but no impact same fatal error comming.

In reply to hurmath@fldec:

You should check if data are in your scoreboard. You do not check for this.

i got bug sir thanks for support.