Fork join_none

I have 2 question

  1. What will happen to the child process forked by fork-join_none if parent process does not encounter any blocking statement and exit. Are they killed if the parent process exit without blocking ? For example

module exm();
  task example_task();
    #5 $display("Before fork join");
    fork
      #10 $display("inside fork");
      #15 $display("still inside fork");
    join_none
  endtask

  initial begin
    example_task();
  end
endmodule

  1. What will happen if the time duration for which parent process is blocked is not sufficient to complete forked child process in fork-join_none. For example

module exm();
  task example_task();
    #5 $display("Before fork join");
    fork
      #10 $display("inside fork");
      #15 $display("still inside fork");
    join_none
    #5;   // This time is not sufficient to complete all process forked by fork-join_none
  endtask

  initial begin
    example_task();
  end
endmodule

If you modify your code to print the system time that each $display message gets executed, you will see that the forked child processes do not get killed, they still get executed

e.g.

module exm();
  
  task example_task();
    #5 $display("Before fork join %0t", $time);
    fork
      #10 $display("inside fork %0t", $time);
      #15 $display("still inside fork %0t", $time);
    join_none
  endtask
 
  initial begin
    $timeformat(-9, 2, " ns", 20);
    example_task();
  end
endmodule




results in the following output:

# Before fork join 5.00 ns
# inside fork 15.00 ns
# still inside fork 20.00 ns
# exit

Adding the #5 in the 2nd example has no impact on the $display statements.