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

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.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest