In reply to Jung Ik Moon:
So LRM already made it clear that it’s allowed.
No, it says that tasks are not allowed.
1800-2017 wrote:
Functions have restrictions that make certain they return without suspending the process that enables them. The following rules shall govern their usage, with exceptions noted in 13.4.4:
A function shall not contain any time-controlled statements. That is, any statements containing #, ##, @, fork-join, fork-join_any, wait, wait_order, or expect.
A function shall not enable tasks regardless of whether those tasks contain time-controlling statements.
Ben systemverilog.us