Practical use of fork join_none

My question is about the fork...join_none construct in SV.

According to the LRM section 9.3.2 Parallel blocks, Table 9-1—fork-join control options:

The parent process continues to execute concurrently with all the processes spawned by the fork. The spawned processes do not start executing until the parent thread executes a blocking statement.

Using the join_none doesn't wait for any of the forked process to complete and proceeds executing the non-blocking statements. I am trying to think of a scenario where one would use join_none during design/verification.

2 Answers

The most common use of fork/join_none in SystemVerilog is when you want to spawn a dynamic number of parallel threads. In a testbench, each thread could represent a single device on a bus.

initial begin N = $urandom_range(1,10); for( int j = 1; j <= N; ++j ) fork automatic int k = j; // local copy, k, for each value of j start_a_thread(k); join_none end

join_none is widely used in verification methodologies, such as UVM. It is used to spawn off multiple threads in parallel in the testbench. For example, it can be used to start an interrupt monitor in parallel with a data bus driver.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like