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 Course
  • Reading Path
  • CDC/RDC Glossary
  • CDC/RDC Metrics Reference
  • CDC/RDC Interview Prep
  • CDC/RDC Signoff Cheatsheet
  • Clock Domains and Failure Modes8
  • Metastability and Synchronizers16
  • CDC Protocols and Handshakes16
  • Reconvergence and Gray Coding16
  • Reset Domain Crossing16
  • Architecture and Design Rules16
  • CDC Signoff Methodology24
  • RDC Signoff16
  • Debug and Case Studies11
  • CDC and RDC Interview Prep30
    • CDC/RDC Whiteboard Framework
    • CDC/RDC Framework Drills
    • Scenario: Metastability Bug
      • The Scenario
      • Investigation Steps
      • Root Cause and Fix
      • How to Narrate It
    • Scenario: Metastability Escape in Silicon Bring-up
    • Scenario: Async FIFO Pointer Mismatch
    • Scenario: Waiver Debate
    • Scenario: RDC Waiver Under Tapeout Pressure
    • CDC/RDC Interview Q&A Bank
    • CDC/RDC Interview Q&A Bank (Expanded)
  • Capstone: Sign Off a Multi-clock Peripheral4
Loading lesson

‹Scenario: Metastability Bug
  1. Topics
  2. CDC & RDC
  3. CDC and RDC Interview Prep
  4. Scenario: Metastability Bug
  5. Root Cause and Fix

Part 10 · Interview Prep · All levels

Root Cause and Fix

Unsynchronised fanout into the FSM: the cause, the legal synchroniser fix, and the closing evidence.

On this page

    Root cause: the interrupt crosses into the FSM clock with no synchroniser and fans out to two destinations, the next-state logic and a status register. When the interrupt changes inside the capture window, the two loads resolve differently often enough over weeks of operation that the FSM eventually sees a next-state input inconsistent with its current state and jumps somewhere illegal. The bench never sees it because the alignment is rare, and simulation never sees it because ideal clocks have no setup-hold window.

    The fix

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    // snippet: legal single-bit level synchroniser before the fanout
    // The interrupt must be a level held stable across the crossing;
    // pulses need a toggle or handshake scheme instead.
    always @(posedge clk_slow) begin
      sync1 <= irq_fast;   // first capture flop: may go metastable
      sync2 <= sync1;      // second flop: samples a settled value
    end
    // All FSM and status fanout is driven from sync2 ONLY.

    Two rules make the fix real. First, every load of the interrupt comes from the synchroniser output; the raw crossing drives nothing. Second, the interrupt must be a level held stable, not a pulse: if the source only pulses, the fix is a toggle synchroniser or handshake instead, per Why Pulses Need Help. A fix that synchronises a pulse with two flops trades the illegal state for a lost event.

    The closing evidence

    A re-run structural analysis showing the crossing synchronised with no logic between flops, a metastability-aware simulation proving the FSM tolerates either resolution, and a review note recording the fanout rule so the next engineer cannot tap the raw crossing again. Simulation is supporting evidence here, not proof: say so out loud.

    Common pitfall

    Fixing the symptom with an illegal-state recovery FSM while leaving the crossing raw. Recovery logic is good defence in depth, but the interviewer scores the synchroniser fix first: recovery without containment just makes the next escape quieter.

    Check yourself Why must all fanout come from the synchroniser output, not just the FSM input?

    Because any second load of the raw crossing is a second independent resolution: fixing the FSM input while the status register still samples the raw signal leaves the divergence mechanism intact.

    Related topics

    • Next: How to Narrate It

    • RTL: Metastability and Synchronisation

    Previous

    155 / 179

    Next: How to Narrate It

    Up next

    Up nextHow to Narrate It

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • The Scenario