In reply to dave_59:
task data_read(fifo_trans trans);
fifo_trans mon_tran_r;
mon_tran_r=fifo_trans::type_id::create("mon_tran_r");
while ((vif.tb_mon_re.cb_mon_re.re===1'b1) && (vif.tb_mon_re.cb_mon_re.empty === 1'b0)) begin
@(vif.tb_mon_re.cb_mon_re);
`uvm_info(get_name() ,"READ task of monitor", UVM_LOW)
data_que.push_back(vif.tb_mon_re.cb_mon_re.dout);
@(vif.tb_mon_re.cb_mon_re);
end
`uvm_info(get_name() ,"END OF READ task of monitor ", UVM_LOW)
for ( int index=0 ; index < trans.data.size() ; index++) // gives fatal for bad handle of refenrece
mon_tran_r.data[index] = data_que[index];
mon_tran_r.flag_empty = vif.tb_mon_re.cb_mon_re.empty ;
`uvm_info(get_name() ,$psprintf("monitor values READ : %s",mon_tran_r.sprint()), UVM_LOW)
ana_port.write(mon_tran_r);
endtask
now in this example trans is the randomized transaction that i get from my transaction , and inside trans , there is data { which is dynamic array } which is
getting randomized . now i want to transfer all the elements of data_que to data {which is other transaction } but the size to be remained as that of randomized
data . i tried what you said but i am getting en fatal error
this task if of monitor4 only which is giving fatal
** Fatal: (SIGSEGV) Bad handle or reference.