1800'2017 9.3.2 Parallel blocks: Why Within a fork-join_any it shall be illegal to refer to formal arguments passed by reference

In reply to ben@SystemVerilog.us:

Hi Ben,

The problem here is when you have a fork/join_none/join_any, you need to know the lifetime of the variables declared outside referenced from inside. SystemVerilog has to extend the lifetime of the variable to include the lifetime of the forked processes to make sure they are still valid at any point while process is still active. When you pass a variable by reference to a task or function, you lose that information because all you know is that you have a handle to an int type. The implementation of the task/function is written to be intenpendent of what gets passed to it.

In mot cases you can easily workaround this limitation as pass by references is rarely needed. In your example, you can replace ref with inout and still get the same functionality.