all about vlsi DV
Fork–Join in SystemVerilog — Interview Questions (Easy → Hard)
This article is designed to test your understanding of fork–join, not teach it.
Attempt questions without running code unless explicitly stated.
🟢 EASY LEVEL — Concept & Recall
Q1.
What is the primary purpose of fork–join in System Verilog?
Q2.
What does the following statement mean?
fork
taskA();
taskB();
join
Q3.
Which fork–join construct waits for all parallel blocks to finish?
-
a) join
-
b) join_any
c) join_none
Q4.
True or False:
fork–join is synthesizable and can be used in RTL design.
Q5.
Fill in the blank:
join_any returns control when __________ parallel block finishes.
Q6.
In simple words, what is the difference between join and join_none?
🟡 MEDIUM LEVEL — Code Understanding & Behavior
Q7.
Consider the code below. At what simulation time will "Done" be printed?
initial begin
fork
#10 $display("A");
#20 $display("B");
join
$display("Done");
end
Q8.
What changes if join is replaced by join_any in the above code?
Q9.
Look at this code:
initial begin
fork
#30 $display("Task A");
#10 $display("Task B");
join_any
$display("After fork");
end
Which statements are guaranteed to execute before "After fork"?
Q10.
True or False:
In fork–join_any, unfinished parallel blocks are automatically terminated.
Q11.
Alice starts a timeout counter and sends a request.
She wants to proceed as soon as either a response arrives or timeout expires.
Which construct should she use?
Q12.
What happens if a fork–join_none is used and the parent block finishes execution?
🔵 HARD LEVEL — Scenarios, Traps & Interview Twists
Q13. (Scenario-Based)
Alice launches three parallel tasks:
-
Task A: Sends stimulus
-
Task B: Collects coverage
-
Task C: Logs transactions
She must not finish the test until all three complete.
Which fork–join should she use, and why?
Q14. (Scenario-Based)
Alice launches:
-
A packet send
-
A timeout watcher
If timeout occurs first, test should fail immediately.
If packet response arrives first, timeout should be ignored.
Which fork–join fits best?
Q15.
Consider this code:
fork
begin
#10 $display("A");
end
begin
#20 $display("B");
end
join_any
$display("C");
Is it guaranteed that "A" prints before "C"?
Explain your reasoning.
Q16.
Alice uses fork–join_none to start a background monitor.
Later, she sees unexpected log messages after the test ends.
What mistake did Alice likely make?
Q17.
Why is fork–join considered dangerous if used carelessly in verification?
Q18. (Trick Question)
True or False:
fork–join_any is always faster than fork–join.
Q19.
Can fork–join introduce race conditions?
If yes, in what kind of situation?
Q20. (Interview Favorite)
Explain fork–join, fork–join_any, and fork–join_none using one real-world example each.
(Do not use definitions.)
🔴 VERY HARD — Deep Understanding
Q21.
Alice writes this code:
fork
begin
#10 result = 1;
end
begin
#10 result = 2;
end
join
Is this safe?
What problem might arise?
Q22.
Why is fork–join typically avoided inside synthesizable always_ff blocks?
Q23.
What is the difference between parallel execution and concurrent scheduling in the context of fork–join?
Q24.
How would you redesign a fork–join_any block if you need to terminate the remaining threads once one finishes?
(No code required — concept only.)
Q25.
In an interview, you are told:
“I used join_any for timeout logic.”
What follow-up question should you ask to check correctness?
✅ How to Use This Article Properly
-
Attempt all Easy questions without notes
-
Attempt Medium questions by reasoning about time
-
Attempt Hard questions verbally (interview style)
-
If you struggle with Q15, Q19, Q21, revisit fork–join fundamentals