function void func_a();
sample_dut_signal(0);
endfunction
function void func_b();
sample_dut_signal(1);
endfunction
function void sample_dut_signal(bit sel);
fork
begin
if(sel)
parent.sample_signal_aa();
else
parent.sample_signal_bb();
end
join_none
endfunction
Parent class is as follows:
task sample_signal_aa();
#(5000ns);
$display("Done with wait");
//....code to sample
endtask
The issue is that most of the times the code works but certain times I will never see the display and tells me that the thread spawned off by the child has abruptly ended. I am not sure what is exactly going on. Can someone throw some light?
There is no disable fork anywhere in the child or parent.
The functions ‘func_a’ and ‘func b’ in the child class are called by events in the class. the events are well separated in time so there seems to be no contention. I did add a print before the $display and it prints as expected but dont see the print after the delay.
Funny thing is for events that happen after this failure of the fork, it again seems to work fine.
No problem. I found the issue. it was a ‘disable fork’ like you said that caused it. funny thing is that this disable-fork was in a monitor component that was sending a transaction to one of my uvm_components that was spawning the above thread.