Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
    • Datatype and Bit Puzzles
    • Fork Join Puzzles
      • join vs join_any vs join_none
      • Loop Variable Capture in Detached Threads
      • wait fork Synchronization Point
      • disable Named Fork Scope
      • join_any Without Cleanup
      • Inner disable fork Does Not Kill Outer Sibling
    • Queue and Array Puzzles
    • String and Casting Puzzles
    • SystemVerilog Language Puzzles: Tricky Q&A
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Fork Join Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. SystemVerilog Language Puzzles
  4. Fork Join Puzzles
  5. join vs join_any vs join_none
On this page

    VLSI DV Interview PuzzlesAll levels

    join vs join_any vs join_none

    Give the timeline of all prints and identify which children survive each block.

    Puzzle

    Difficulty: Easy · Puzzle 1 of 6 · Topic: Fork Join Puzzles

    Give the timeline of all prints and identify which children survive each block.

    Code

    p1.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    `timescale 1ns/1ns
    module p1;
      initial begin
        fork
          begin #5  $display("%0t A", $time); end
          begin #10 $display("%0t B", $time); end
        join
        $display("%0t join_done", $time);
    
        fork
          begin #5  $display("%0t C", $time); end
          begin #10 $display("%0t D", $time); end
        join_any
        $display("%0t join_any_done", $time);
        disable fork;
    
        fork
          begin #5  $display("%0t E", $time); end
          begin #10 $display("%0t F", $time); end
        join_none
        $display("%0t join_none_done", $time);
        #1 disable fork;
      end
    endmodule

    Hint

    Analyze each fork block independently, but remember simulation time accumulates because they execute sequentially in one initial block.

    Step-by-step solution

    Diagram
    1) First block (`join`) waits for both children: A at t=5, B at t=10, then `join_done` at t=10.
    2) Second block starts at t=10: C at t=15, parent resumes at `join_any` and prints `join_any_done` at t=15, then `disable fork` kills D.
    3) Third block starts at t=15: `join_none_done` prints immediately at t=15, then parent waits #1 and kills both detached children at t=16 before E/F can print.

    Answer

    Answer: A@5, B@10, join_done@10, C@15, join_any_done@15, join_none_done@15; D/E/F never print

    How this was checked

    Checked by running the code in Icarus Verilog 13 and Verilator 5; the printed output supports the answer above. Only these six lines print in this order. (Icarus, 4-state) Only these six lines print in this order. (Verilator, 2-state)

    Why candidates get it wrong

    `join_none` returns at once and its children have not even started, so an immediate `disable fork` kills them before they print; and `join_any` leaves D running until you disable it.

    Interviewer follow-up

    What changes if the third block removes `#1` and calls `disable fork;` immediately? Model answer: E and F are killed at t=15 before their delays expire, so they never print either way; the only difference is that the program ends at t=15 instead of t=16 (nothing else prints after join_none_done).

    Say it out loud

    I would walk the three blocks in time order, because each join type resumes the parent at a different moment. The plain join waits for both, so A at 5, B at 10 and join done at 10. The join any resumes when C prints at 15, and disable fork kills D. With join none the parent continues at once and the children have not started, so the disable fork at 16 kills them and E and F never print. The trap is thinking join none children run before the parent moves on, so I would check where each fork needs a disable fork or a wait fork.

    Related topics

    • Threads and Control: Fork, Disable, Wait, Process

    • Back to Fork Join Puzzles

    • SystemVerilog Language Puzzles section

    Previous

    16 / 293

    Next: Four-Week Route: Week 4

    Up next

    Up nextFour-Week Route: Week 4

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Loop Variable Capture in Detached Threads
    • wait fork Synchronization Point
    • disable Named Fork Scope