Hi,
I have a below code(simplified version of actual code).
Main Thread 1 - meant to drive ready on all the 8 inbound agents. The corresponding seq runs forever. It looks fine.
Main Thread 2 - meant to run multiple sequences on a random outbound agents parallel to above and the parent thread should exit once these grandchild sequences are completed. But I see that all the grandchild sequences(=no_of_seq) are spawn but they seem to run continuously. Test doesn’t fail with timeout since a RTL assertions is reported. Debug messages indicate that the grand sequences spawn in “Main Thread 2” seem to run for more than expected time without setting ‘end’ signal. I may have to debug it further, but the issue seem to be in the way threads are spawn(it works fine with jsut 1 grandchild sequence). So wanted to check.
How can I fix this to run as intended? TIA
fork : rdy_and_other
begin //---------Main Thread 1----------------
for (int k=0; k<NUM_AGENTS;k++) begin
fork
int i = k;
rdy_seq[i].randomize();
rdy_seq[i].start(p_sequencer.ib_agent_sequencer[i]);
join_none
end // for
end //----------Main Thread1-----------------
begin //------------------Main Thread2----------------------
fork begin : isolating_fork
for (int p=0; p<no_of_seq; p++) begin
fork :ib_ob_agents
begin
a = ....;
b = ....;
ob_agent_num = $urandom_range(0,7);
ob_seq[ob_agent_num].randomize;
ob_seq[ob_agent_num].start(p_sequencer.ob_agent_sequencer[ob_agent_num]);
end //fork
join_none : ib_ob_agents
end // for
wait fork;
end : isolating_fork
join // isolating fork
end // //------------------Main Thread 2----------------------
join_any : rdy_and_other