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 Course
  • The NanoSoC Tour
  • Reading Path
  • SoC Glossary10
  • SoC Metrics Reference
  • SoC Cheatsheet
  • What SoC Integration Is12
  • Architecture and Budgets21
  • Memory Maps and Address Decode26
  • Interconnect and Bus Fabrics26
  • Clock and Reset Architecture24
    • Clock Sources and PLLs
    • Dividers, Muxes and Glitch-Free Switching
      • Integer Dividers and Clock Muxes
      • Glitch-Free Switching Sequence
      • Switching Failure Modes
    • Clock Gating Architecture
    • Clock Domain Planning
    • Top-Level Crossings
    • Always-On Domain, Wake Policy and a Timer Extension
    • Reset Sources and Reset Tree
    • Reset Sequencing and Release
  • Power Architecture21
  • Interrupts, DMA and Peripherals15
  • Memories, Boot and Security21
  • IP Integration and Handoff21
  • Top-Level Verification and Bring-up21
  • Package, Pads and I/O18
  • Chip Signoff and Tapeout18
  • SoC Interview Prep16
  • Capstone: Integrate NanoSoC14
Loading lesson

←Dividers, Muxes and Glitch-Free Switching
  1. Topics
  2. SoC Design
  3. Clock and Reset Architecture
  4. Dividers, Muxes and Glitch-Free Switching
  5. Switching Failure Modes
On this page

    Part 5 of 14, lesson 6 of 24Part 5 of 14/Clock and Reset Architecture/Lesson 6 of 24All levels

    Switching Failure Modes

    Three ways a switch still fails: the dead clock, the wrong timing exception, and the ratio sweep that DVFS would need.

    Why it matters

    The safe sequence works when both clocks run and the analysis knows about the mux. Real chips violate both assumptions: a source dies, a constraint tells the tools the mux output is one clock when it is the other, or firmware raises the frequency before the voltage arrives. Each failure has the same shape, an assumption the sequence needed that nobody checked. This lesson lists the three with their checks. Its one job is the failure set; the correct sequence belongs to the previous lesson.

    The core idea

    First, the dead clock. The handshake waits for an edge on each source, so either clock being dead hangs it. A dead old source leaves its enable stuck on, because the drop can never be synchronised. A dead new source leaves both enables off after the old one dropped, and no clock at all. The abort path is a timeout that forces the enable flops, through their asynchronous reset, to the known-good source, and accepts that one truncated pulse is possible at that moment: the clock is declared failed, so downstream logic is held in reset while it happens. NanoSoC keeps the crystal path alive for exactly this reason: the always-on domains never need a switch to a clock that can be dead.

    Second, the wrong timing exception. The mux output carries two clocks in different modes, and the analysis must constrain each mode to its own clock. A false path drawn across the mux to quiet a report, or a case analysis that pins the test select while the chip runs functional, signs off timing that was never analysed. Every exception on a clock mux needs evidence attached: which select value it covers and which modes it applies to.

    Third, the ratio sweep. When voltage and frequency change together the order is fixed: raise voltage first, then frequency; lower frequency first, then voltage. Reversing it runs fast logic on a low rail. As documented in the NanoSoC specification, NanoSoC runs at one operating point, so its crossing assumptions never change; the power architecture section adds DVFS as a chip-level extension with illustrative lower gears and reuses this lesson's rule: every crossing is re-verified at every ratio.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    # Synchroniser latency across ratios, in source cycles: k * (f_src / f_dst).
    # A 2-flop sync out of the fast domain costs more fast cycles than out of
    # the slow one; a DVFS extension would move every number in this table per operating point.
    RATIOS = {"cpu": 192e6, "sys": 96e6, "per": 24e6}
    K = 2
    
    def sync_cost_in_src(src, dst):
        return K * (RATIOS[src] / RATIOS[dst])
    
    table = {(s, d): sync_cost_in_src(s, d) for s in RATIOS for d in RATIOS if s != d}
    assert table[("cpu", "sys")] == 4.0
    assert table[("sys", "cpu")] == 1.0
    assert table[("sys", "per")] == 8.0
    assert table[("per", "sys")] == 0.5
    print("PASS: 2-flop latency cpu->sys 4 cpu cycles, sys->per 8 sys cycles")

    What the review looks for

    • The dead-clock path is drawn beside the happy path with its timeout or bypass, and both are verified.

    • Every timing exception touching a clock mux names its select value and its modes, with evidence, not blanket waivers.

    • If frequencies can change, every crossing is verified at every ratio; on NanoSoC the single operating point is stated as the reason this collapses to one check.

    Verify and debug

    Kill each source in simulation, old and new in turn, and attempt the switch: the controller must land somewhere safe, never with both enables high and never hung. Audit the exception list for any line that mentions a mux output without a mode guard. A failure that appears only at one operating point, or only with the test select forced, points at this lesson before it points at the logic.

    Wrong timing exception covering a real path, and the DVFS transition error. Both pass signoff and fail in silicon at speed. The fixes are review of every exception with evidence, and the voltage-then-frequency order with CDC verified at all ratios.

    If asked what can go wrong with a correct mux, answer with the three assumptions: both clocks alive, analysis knows the select, voltage leads frequency. Then say which one NanoSoC sidesteps by running one operating point.

    Check yourself Why is a single-operating-point chip easier to sign off than a DVFS chip for the same mux?

    The synchroniser latencies, the pulse widths and the crossing margins are single numbers. With DVFS each becomes a table over operating points, and every entry needs its own verification.

    Related topics

    • Glitch-Free Switching Sequence

    • STA: Generated Clocks and Dividers

    • STA: Corner and Mode Matrix Design

    Previous

    93 / 289

    Next: Bandwidth and Latency Verification

    Up next

    Up nextBandwidth and Latency Verification

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Integer Dividers and Clock Muxes