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
    • Clock Gating Architecture
      • ICG Cells and Enable Timing
      • Hierarchical Gating and Enable Ownership
      • Failure: DMA Gated During an APB Access
    • 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

←Clock Gating Architecture
  1. Topics
  2. SoC Design
  3. Clock and Reset Architecture
  4. Clock Gating Architecture
  5. Hierarchical Gating and Enable Ownership
On this page

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

    Hierarchical Gating and Enable Ownership

    Three levels of gates, one owner per enable, and the wake path that must never be gated with its block.

    Why it matters

    The most dangerous gate is not the one that glitches but the one that never opens. A block whose wake-up condition is computed inside its own gated domain sleeps forever, and the symptom is a dead peripheral that passes every functional test because the tests never gate its clock. Ownership prevents this: every enable has exactly one driver, and every wake path comes from logic that is awake. This lesson assigns all three NanoSoC gates. Its one job is the hierarchy and its owners; the failure where ownership is ignored is next.

    The core idea

    NanoSoC gates in three places. At the root, the PLL wrapper gates the fast clocks on the synchronised lock, owned by the nano_rstpwr controller in hardware. At the domain level, the CPU clock gate cell lives in nano_rstpwr and is requested by the core's wait-for-interrupt instruction, with wake on irq_cpu. At the block level, the DMA and stream-bridge clocks gate on RSTPWR CLK_EN bits 0 and 1, owned by software writing a secure-only register, both reset to enabled so no driver must opt in to a working chip. All gates are enabled by nano_rstpwr, and the CLK_EN enables are written in clk_per, so each is two-flop synchronised into clk_sys before it reaches its ICG, one branch of crossing X7.

    The wake rule decides each owner. The CPU wakes on an interrupt computed outside its gated domain: the interrupt controller runs on clk_per, always on, and the wake signal crosses a synchroniser rather than depending on the sleeping clock. The DMA and bridge wake only by software setting CLK_EN again; while their clocks are stopped their registers do not answer, which is exactly the hazard the next lesson's failure makes concrete. Test mode overrides every gate through test_en, owned by the DFT integration, so scan shift never meets a gated clock.

    Gate

    Clock gated

    Owner of the enable

    Enable synchronised in

    Wake source

    Root gate

    clk_cpu, clk_sys

    nano_rstpwr hardware (lock)

    Already in nano_rstpwr

    Lock re-qualifies

    CPU gate

    clk_cpu

    nano_rstpwr cell; request from CPU wfi

    Gate logic in nano_rstpwr

    irq_cpu

    DMA gate

    clk_dma

    Software via CLK_EN[0], secure-only

    clk_sys via X7 two flops

    Software sets the bit; registers do not answer while stopped

    SBR gate

    clk_sbr

    Software via CLK_EN[1], secure-only

    clk_sys via X7 two flops

    Software sets the bit; registers do not answer while stopped

    The wake latency sets how sleepy the CPU gate may be. An enabled interrupt reaches the gate logic through the two synchronisers in 135.4 ns at best, 26 CPU cycles at 192 MHz, after irq_dma rises; the clock then restarts after the ICG enable resync, an illustrative 2 CPU cycles. Deep-sleep policy therefore keeps only latency-insensitive work behind the CPU gate, and the DMA interrupt, which is the throughput-critical one, is exactly the path this latency bounds.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    T_CPU_NS = 1e9 / 192e6  # 5.2083 ns
    SYNC_IRQ_NS = 135.4  # NanoSoC specification: irq chain best case, 26 cpu cycles
    assert abs(26 * T_CPU_NS - 135.4167) < 0.01
    # ICG enable resync is illustrative (not in the NanoSoC specification): 2 cpu cycles.
    wake_ns = SYNC_IRQ_NS + 2 * T_CPU_NS
    assert abs(wake_ns - (135.4167 + 10.4167)) < 0.02, wake_ns
    # The wake path must beat a 208.33 ns budget (one APB bridge round trip).
    assert wake_ns < 208.33, wake_ns
    print("PASS: irq to clock-restart about 145.8 ns (135.4 NanoSoC specification + 2 cycles illustrative)")

    What the review looks for

    • Every gate has one named owner in the table above; no enable is driven from two places or from nowhere.

    • Every wake path is traced to logic outside the gated domain, on paper, before simulation.

    • The reset values leave every gate open except the lock gate, so the chip boots with clocks running.

    Verify and debug

    Simulate each sleep-to-wake path end to end: execute wfi and confirm the CPU clock stops and restarts on the interrupt, clear each CLK_EN bit and confirm the block idles and revives. Then gate every clock and confirm the wake sources still toggle; a wake line frozen by its own gate is the bug this lesson exists to prevent. Crossings with gated clocks need their own treatment, covered under CDC and RDC: Clock Gating and Muxing.

    Clock gate wakes late: the enable is computed in the gated domain itself, so the block is permanently asleep. Caught by simulating the wake paths and by formal reachability. Fixed with a wake path from an always-on enable, the rule this lesson enforces.

    If asked who can gate the DMA clock, answer with the register, its security and its reset: secure software through CLK_EN bit 0, reset to enabled. Then add the condition the next lesson makes precise: only when idle and quiet.

    Check yourself Secure firmware delegates DMA control to non-secure software but keeps reset control secure. Can the non-secure driver gate the DMA clock?

    No: CLK_EN lives in the secure-only RSTPWR block, so a non-secure write is refused. Power policy stays with the secure world even when data movement does not.

    Related topics

    • ICG Cells and Enable Timing

    • Next: Failure: DMA Gated During an APB Access

    • RTL: Clock Gating Done Right

    Previous

    98 / 289

    Next: Failure: DMA Gated During an APB Access

    Up next

    Up nextFailure: DMA Gated During an APB Access

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error