Hi ,
I was trying to print the spawned process of fork/join_none using process class :: status but not able to achieve it could you please help
code:
module test;
std::process active_p[$];
std::process::state pstate;
initial begin
fork
begin
$display(“[%0t] start for thread 1”,$time);
active_p.push_back (std::process::self());
#1;
$display(“[%0t] end for thread 1”,$time);
endbegin
$display(“[%0t] start for thread 2”,$time);
active_p.push_back (std::process::self());
#2;
$display(“[%0t] end for thread 2”,$time);
endbegin
$display(“[%0t] start for thread 3”,$time);
active_p.push_back (std::process::self());
#3;
$display(“[%0t] end for thread 3”,$time);
endjoin_none
foreach(active_p[i])
$display(“status for process[%0d]:%s”,i,p[i].status.name());wait fork;
end
endmodule:test
link:
Thanks in advance