What's the difference between Verilog and fork-join in SystemVerilog?
This article is mainly about "what's the difference between fork-join in Verilog and SystemVerilog". Interested friends might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what's the difference between fork-join in Verilog and SystemVerilog?"
The main disadvantage of the fork-join structure in Verilog is that the execution of code outside the parallel structure is paused until all processes in the fork-join are completed.
For example, in the following code, the last $display statement is executed only after 10 time units
Although process 1 is completed in 5 time units
Modulefork_join_tests; integer out_val; initial begin fork begin / / First process # 5$ display ("exit first process at t =% 0d", $time); endbegin / / Second process # 10$ display ("exit second process at t =% 0d", $time); end join$display ("exit fork join at t =% 0d", $time); endendmodule / / fork_join_tests
The above code shows the output:
Exit first process at t = 5exit second process at t = 10exit fork join at t = 10
SystemVerilog adds two new keywords for parallel processes: join_any and join_none
When the join in the above code is replaced by join_any, the output is displayed:
Exit first process at t = 5exit second process at t = 10exit fork join at t = 5
Fork-join_any exits after the completion of the first process, that is, five units of time.
When join_none replaces join, the following output is displayed:
Exit first process at t = 5exit second process at t = 10exit fork join at t = 0
Fork-join_none does not wait for any of these processes to complete, that is, to exit at time unit 0.
At this point, I believe you have a deeper understanding of "what's the difference between Verilog and fork-join in SystemVerilog". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!