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
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
    • Event Scheduling Puzzles
    • Race Condition Puzzles
    • Clocking Block Puzzles
      • Why First Sample Sees Old grant
      • Interpreting |=> ##1 in Clocking Domain
      • output #1step Misses Current Edge
      • input #0 vs input #1step Snapshot
      • Raw @posedge Monitor vs @(cb) Monitor
      • Mixing Direct Drive and cb Drive
    • Semaphore & Mailbox Puzzles
    • Concurrency & Timing Puzzles: Tricky Q&A
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Clocking Block Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Concurrency & Timing Puzzles
  4. Clocking Block Puzzles
  5. Mixing Direct Drive and cb Drive

VLSI DV Interview Puzzles · All levels

Mixing Direct Drive and cb Drive

Identify which line introduces race potential and why monitor observations become inconsistent across runs.

On this page

    Puzzle

    Difficulty: Hard · Puzzle 6 of 6 · Topic: Clocking Block Puzzles

    Identify which line introduces race potential and why monitor observations become inconsistent across runs.

    Code

    ifc.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    interface ifc(input bit clk);
      logic req, grant;
      clocking cb @(posedge clk);
        default input #1step output #0;
        input grant;
        output req;
      endclocking
    endinterface
    
    module tb;
      bit clk = 0;
      ifc vif(clk);
      always #5 clk = ~clk;
    
      always @(posedge clk) vif.grant <= vif.req;
    
      initial begin
        @(posedge clk); vif.req = 1;      // direct net drive
        @(vif.cb);     vif.cb.req <= 0;  // clocking block drive
        repeat (2) @(vif.cb);
        $finish;
      end
    endmodule

    Hint

    Direct signal assignment bypasses clocking block skew semantics.

    Step-by-step solution

    Diagram
    1) `vif.req = 1` on raw posedge is region-racy against DUT sampling.
    2) `vif.cb.req <= 0` uses deterministic clocking block drive semantics.
    3) Mixing both introduces inconsistent req capture by DUT across runs/tools.
    4) Keep all interface drives through one clocking block discipline.

    Answer

    Answer: The direct `vif.req = 1` line is race-prone. Mixed driving styles create inconsistent cycle alignment and flaky checks.

    Why candidates get it wrong

    Teams adopt clocking blocks but accidentally bypass them in one helper task, reintroducing races.

    Interviewer follow-up

    How would you enforce cb-only driving at compile time in your interface API?

    Related topics

    • Back to Clocking Block Puzzles

    • Concurrency & Timing Puzzles section

    Previous

    72 / 210

    Next: Semaphore & Mailbox Puzzles

    Up next

    Up nextSemaphore & Mailbox Puzzles

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Why First Sample Sees Old grant
    • Interpreting |=> ##1 in Clocking Domain
    • output #1step Misses Current Edge