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
  • Power Architecture21
    • Power Domains and States
    • Isolation and Retention Integration
    • PMU and Power Sequencer
    • Cold-Start Power-Up Sequence
    • Supply Sequencing and PMIC
    • Thermal and Power Envelope
      • From Milliwatts to Degrees
      • Throttling Policy and Sensors
      • Power-Gating Saving and Break-Even
    • DVFS Integration
  • 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

←Thermal and Power Envelope
  1. Topics
  2. SoC Design
  3. Power Architecture
  4. Thermal and Power Envelope
  5. Power-Gating Saving and Break-Even
On this page

    Part 6 of 14, lesson 18 of 21Part 6 of 14/Power Architecture/Lesson 18 of 21All levels

    Power-Gating Saving and Break-Even

    When SLEEP pays: the energy of a sleep interval, the cost of the transitions, and the shortest nap worth taking.

    Why it matters

    SLEEP at 1.40 mW beats IDLE at 16.89 mW by 15.49 mW every second it lasts, but each round trip pays the 14.073 µs wake plus the 2.917 µs entry at elevated power. Naps shorter than the pay-back lose energy instead of saving it, and a driver that sleeps on every idle poll can burn more than one that never sleeps. This lesson finds the shortest nap worth taking.

    The core idea

    Break-even is the nap length where the sleep saving equals the transition cost. Saving accrues at the IDLE-minus-SLEEP rate; the cost is the entry-plus-wake energy, plus an illustrative switch-and-restore overhead of 50 nJ per round trip for the inrush and state handling the NanoSoC tables do not price. The script below works the NanoSoC numbers: the saving rate is 15.49 mW, the transition cost is about 1.26 µJ, and break-even lands at about 82 µs (about 80 µs if the 17 µs of the transition is credited at SLEEP power). The wake is charged at the 82.74 mW RUN power, a conservative upper bound, because the CPU is in reset for most of the 14 µs. Any predicted idle longer than a few hundred microseconds should sleep; anything shorter should stay in IDLE. The margin is comfortable because the wake is short and the saving rate is large.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    # Sleep break-even: IDLE power vs SLEEP plus round-trip cost.
    # Powers NanoSoC teaching values; 50 nJ overhead illustrative.
    P_IDLE_MW, P_SLEEP_MW = 16.89, 1.40
    T_ENTRY_US, T_WAKE_US = 2.917, 14.073
    OVERHEAD_NJ = 50.0  # illustrative switch + restore energy per round trip
    save_mw = P_IDLE_MW - P_SLEEP_MW
    assert abs(save_mw - 15.49) < 0.005
    # Transition energy: entry burns near IDLE, wake near RUN (1 mW * 1 us = 1 nJ).
    E_entry_nj = P_IDLE_MW * T_ENTRY_US
    E_wake_nj = 82.74 * T_WAKE_US
    E_total_nj = E_entry_nj + E_wake_nj + OVERHEAD_NJ
    assert abs(E_entry_nj - 49.27) < 0.05, E_entry_nj
    assert abs(E_wake_nj - 1164.4) < 1.0, E_wake_nj
    breakeven_us = E_total_nj / save_mw  # nJ / mW = us
    assert abs(E_total_nj - 1263.7) < 1.0, E_total_nj
    assert 81.0 < breakeven_us < 82.0, breakeven_us
    # Credit the 17 us of the transition at SLEEP power (IDLE would have burned
    # 16.89 mW over it, the sleeping chip burns 1.40 mW): the more careful figure.
    t_trans = T_ENTRY_US + T_WAKE_US
    careful_us = (E_total_nj - P_SLEEP_MW * t_trans) / save_mw
    assert 79.5 < careful_us < 80.5, careful_us
    # A nap of 70 us loses energy, one of 100 us wins.
    def saved_nj(nap_us):
        return save_mw * nap_us - E_total_nj
    assert saved_nj(70.0) < 0.0 < saved_nj(100.0)
    print("PASS: saving 15.49 mW; round trip ~1.26 uJ; break-even %.1f us (%.1f us credited)" % (breakeven_us, careful_us))

    What the review looks for

    • The break-even nap is computed from the project power numbers with the overhead stated and sourced, not assumed zero.

    • The driver policy references the number: sleep only on predicted idles above several break-even intervals.

    • The worst-case wake latency, 14.073 µs plus interrupt synchronisation, is checked against the product's real-time deadlines before any saving is claimed.

    Verify and debug

    Measure a sleep round trip on the bench with a GPIO wake from the bench fixture: energy per trip should match the script within the overhead margin. If short naps lose energy, the overhead is larger than modelled, usually the PLL relock at full RUN power or firmware that polls before sleeping; lengthen the policy threshold rather than doubting the arithmetic. If wake latency misses a deadline, the answer is IDLE for that path, not a faster SLEEP.

    Power gating that costs more than it saves: transitions on every micro-idle with the overhead unpriced. The NanoSoC number is forgiving at about 80 µs, but the driver still needs a predicted-idle threshold, because interrupt storms can always produce naps shorter than any break-even.

    If asked when to power-gate, answer with the equation first, break-even equals transition energy over saving rate, then the NanoSoC instance: about 80 µs, so sleep above a few hundred microseconds and stay in IDLE below. Then name the deadline check that can overrule the energy answer.

    Check yourself An interrupt storm wakes the chip every 50 µs. Should the driver sleep between wakes?

    No: 50 µs is below the 80 µs break-even, so each round trip loses energy. Stay in IDLE until the storm passes, then sleep. The policy needs a storm detector or a minimum-sleep timer, not just an idle detector.

    Related topics

    • Throttling Policy and Sensors

    • Next: DVFS Integration

    • Protocol First Principles: Quiescing and Draining

    Previous

    132 / 289

    Next: Interrupt Controller Integration

    Up next

    Up nextInterrupt Controller Integration

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • From Milliwatts to Degrees