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

AboutContactPrivacyTerms
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
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Fork Join Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. SystemVerilog Language Puzzles
  4. Fork Join Puzzles
  5. disable Named Fork Scope

VLSI DV Interview Puzzles · All levels

disable Named Fork Scope

Which lines print, and why does one statement after `disable` never execute?

On this page

    Puzzle

    Difficulty: Hard · Puzzle 4 of 6 · Topic: Fork Join Puzzles

    Which lines print, and why does one statement after `disable` never execute?

    Code

    p4.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    module p4;
      initial begin
        fork : outer
          begin
            #5 $display("%0t W1", $time);
            #5 $display("%0t W2", $time);
          end
          begin
            #6 disable outer;
            $display("%0t K", $time);
          end
        join
        $display("%0t DONE", $time);
      end
    endmodule

    Hint

    `disable outer` terminates the named block and all processes inside it, including the caller process itself.

    Step-by-step solution

    Diagram
    1) Worker prints W1 at t=5.
    2) At t=6, second branch executes `disable outer`, which terminates the entire named fork block.
    3) Because caller is terminated by disable, statement `K` is never reached.
    4) `join` returns immediately after block termination, so DONE prints at t=6.
    5) W2 at t=10 never occurs.

    Answer

    Answer: W1@5 and DONE@6 only; W2 and K do not print

    Why candidates get it wrong

    Many engineers think `disable` kills siblings but lets caller continue to next statement.

    Interviewer follow-up

    How would behavior differ if you used `disable fork;` instead of `disable outer;` here?

    Related topics

    • Back to Fork Join Puzzles

    • SystemVerilog Language Puzzles section

    Previous

    14 / 210

    Next: join_any Without Cleanup

    Up next

    Up nextjoin_any Without Cleanup

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • join vs join_any vs join_none
    • Loop Variable Capture in Detached Threads
    • Inner disable fork Does Not Kill Outer Sibling