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 Paths
  • Concept Map
  • How to Read the Diagrams
  • Part 0: What Is a Protocol?10
  • Part 1: Timing and Clocking11
  • Part 2: Encoding and Framing12
  • Part 3: Handshakes13
  • Part 4: Flow Control17
  • Part 5: Transactions19
  • Part 6: Concurrency and Performance17
  • Part 7: Ordering13
  • Part 8: Sharing and Arbitration12
  • Part 9: Deadlock and Liveness13
  • Part 10: Reliability and Recovery20
  • Part 11: Bring-Up and Link Management10
  • Part 12: Power8
    • Idle Detection
    • Link Power States
    • Break-Even Time
    • Low-Power Handshakes
    • Quiescing and Draining
    • Wake Signalling
    • Protocols Compared: Power
    • Drills: Power
  • Part 13: Shared State and Coherence9
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 12: Power
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 12: Power
  4. Break-Even Time

Part 12 · Power · Senior (S)

Break-Even Time

Entering and leaving a low-power state costs energy. Sleep through an idle period shorter than the break-even time and you spend more than you save. The formula, a model of a timeout policy on light and busy links, and how to choose the timeout.

On this page

    Note

    Level: Senior (S) · Answers: How do we save power without losing data?

    Before this: Link Power States

    An engineer enables a deep link power state and measures the board. Power goes up. The link really is idle most of the time, and the deep state really does draw a tenth of the active power. But each entry and exit spends energy relocking and retraining, and the idle periods on this board are short. Sleeping through a short gap costs more than staying awake through it.

    How long must an idle period be before sleeping saves energy?

    The obvious answer, and why it breaks

    The obvious reasoning compares power: the sleep state draws less, so sleeping always saves. That ignores the transition. Entering and leaving takes time, and during it the link draws at least active power, often more (restarting PLLs, retraining). For a short enough idle period, the transition alone costs more than staying on for the whole period.

    The idea: the break-even time

    Let the link draw P_on when active, P_lp asleep, and spend T_tr in transitions at power P_tr. Over an idle period T:

    • Staying on costs P_on × T.

    • Sleeping costs P_tr × T_tr + P_lp × (T − T_tr).

    • They are equal at the break-even time T_be = (P_tr − P_lp) × T_tr / (P_on − P_lp).

    Sleep through idle periods longer than T_be and you save; shorter, and you lose. With P_on = 100 mW, P_lp = 10 mW, P_tr = 150 mW and T_tr = 10 µs, T_be = 140 × 10 / 90 ≈ 15.6 µs. The break-even time is longer than the transition itself, because the transition draws more than active power.

    Build it: break-even and a timeout policy

    The model computes the energy of sleeping against staying on for fixed idle periods, then applies a timeout policy (sleep only after τ idle microseconds) to 20,000 random idle periods on a lightly loaded link (mean idle 40 µs) and a busy one (mean 8 µs).

    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
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    """Break-even time of a link low-power state, and the timeout that decides when to enter it.
    
    Staying on costs P_ON. Entering and leaving low power takes T_TR microseconds at a
    higher transition power P_TR (relocking, retraining); while asleep the link draws P_LP.
    For an idle period of T microseconds:
      stay on:   E_on = P_ON * T
      sleep:     E_lp = P_TR * T_TR + P_LP * max(0, T - T_TR)   (a short idle still pays the full transition)
    Break-even: the idle length at which both cost the same.
    Then a timeout policy (sleep only after TAU idle microseconds) on random idle periods
    (exponentially distributed, mean 40 us for a lightly loaded link, 8 us for a busy one):
    energy saved against always-on, and how many idle periods end with a wake (each wake
    delays the next request by the exit latency).
    """
    import random
    
    P_ON, P_LP, P_TR = 100.0, 10.0, 150.0   # mW
    T_TR = 10.0                              # us to enter and leave
    PERIODS = 20000
    
    
    def e_on(t):
        return P_ON * t
    
    
    def e_sleep(t):
        return P_TR * T_TR + P_LP * max(0.0, t - T_TR)
    
    
    def e_policy(t, tau):
        if t <= tau:
            return P_ON * t
        return P_ON * tau + e_sleep(t - tau)
    
    
    t_be = (P_TR * T_TR - P_LP * T_TR) / (P_ON - P_LP)
    idles = [5, 10, 15, 20, 30, 50, 100, 200, 500]
    print("idle period (us):  " + " ".join(f"{t:6d}" for t in idles))
    print("sleep/on energy:   " + " ".join(f"{e_sleep(t) / e_on(t):6.2f}" for t in idles))
    print(f"break-even time: {t_be:.1f} us")
    
    taus = [0, 5, 10, 16, 30, 60, 120]
    
    
    def run(mean, seed):
        rng = random.Random(seed)
        periods = [rng.expovariate(1 / mean) for _ in range(PERIODS)]
        base = sum(e_on(t) for t in periods)
        saved = [1 - sum(e_policy(t, tau) for t in periods) / base for tau in taus]
        wakes = [sum(1 for t in periods if t > tau) / PERIODS for tau in taus]
        return saved, wakes
    
    
    saved, wakes = run(40.0, 1)
    saved8, wakes8 = run(8.0, 2)
    print("timeout (us):           " + " ".join(f"{t:6d}" for t in taus))
    print("saved, mean idle 40 us: " + " ".join(f"{s:6.2f}" for s in saved))
    print("wakes, mean idle 40 us: " + " ".join(f"{w:6.2f}" for w in wakes))
    print("saved, mean idle 8 us:  " + " ".join(f"{s:6.2f}" for s in saved8))
    
    assert abs(e_sleep(t_be) - e_on(t_be)) < 1e-6
    assert e_sleep(10) > e_on(10) and e_sleep(20) < e_on(20)
    assert all(a >= b for a, b in zip(saved, saved[1:])) and all(a >= b for a, b in zip(wakes, wakes[1:]))
    assert saved8[0] < -0.5 and all(a <= b + 1e-9 for a, b in zip(saved8, saved8[1:]))
    print(f"PASS: sleeping pays only for idle periods longer than {t_be:.1f} us; on a busy link sleeping at once costs energy, and a timeout limits the loss")

    It prints:

    Diagram
    idle period (us):       5     10     15     20     30     50    100    200    500
    sleep/on energy:     3.00   1.50   1.03   0.80   0.57   0.38   0.24   0.17   0.13
    break-even time: 15.6 us
    timeout (us):                0      5     10     16     30     60    120
    saved, mean idle 40 us:   0.55   0.48   0.43   0.37   0.26   0.12   0.03
    wakes, mean idle 40 us:   1.00   0.88   0.78   0.67   0.47   0.22   0.05
    saved, mean idle 8 us:   -0.90  -0.48  -0.26  -0.12  -0.02  -0.00   0.00
    PASS: sleeping pays only for idle periods longer than 15.6 us; on a busy link sleeping at once costs energy, and a timeout limits the loss
    The model's numbers: sleeping at once saves 55% of the energy but wakes after every idle period; a 30 µs timeout saves 26% with wakes after fewer than half.

    Three lessons in the numbers. Idle periods of 5 and 10 µs cost 3× and 1.5× the energy when slept through. On the lightly loaded link, sleeping at once saves the most energy, but every idle period then ends with a wake, and every wake adds exit latency to the next request; the timeout trades some energy for far fewer wakes. On the busy link, sleeping at once costs 90% more energy than never sleeping, and only a long timeout limits the loss.

    Choosing the timeout

    Traffic

    Policy

    Idle periods mostly much longer than T_be

    Short timeout: sleep early, save most

    Idle periods mostly shorter than T_be

    Long timeout or a lighter state: deep sleep loses energy

    Mixed or unknown

    A timeout near T_be: it never spends more than about twice what the best possible choice would have

    Latency-sensitive

    Limit wakes: a longer timeout, or a lighter state with a faster exit

    How real protocols chose

    Protocol

    Break-even in practice

    PCI Express ASPM

    Each state's exit latency is reported; software enables a state only where it is acceptable, and L1 substates add deeper options for long idle periods (fact P34).

    USB 3.x

    U1 and U2 are entered on inactivity timers, U2 with a longer timeout than U1 (fact S19).

    What breaks

    The opening board (illustrative) had idle periods of a few microseconds between DMA bursts. With the deep state enabled after a 1 µs timeout, the link spent most of its time in transitions. Moving the timeout to 20 µs, just above break-even, and using the light state for shorter gaps cut link power by 40% instead of raising it.

    Why this matters

    Senior lens. Compute break-even for each low-power state from measured transition energy, not the datasheet's sleep power alone, and measure the real idle-gap distribution before choosing timeouts. Then budget the wake latency: the energy-optimal policy wakes the link after nearly every idle period, which the traffic may not tolerate.

    Interview

    Asked: "What is break-even time, and how does it affect a power policy?"

    Weak answer: The time to enter low power.

    Strong answer: It's the idle duration at which sleeping and staying awake cost the same energy, because entering and leaving the low-power state costs energy, often at more than active power. It's (P_tr − P_lp) × T_tr / (P_on − P_lp). Sleeping through shorter idle periods wastes energy. So the policy depends on the idle distribution: sleep early if idle periods are long, use a longer timeout or a lighter state if they're short, and a timeout near break-even when you don't know, which is never worse than about twice the best choice. Then check wake latency, since each wake delays the next request.

    Follow-ups: (1) Why can break-even be longer than the transition time? (2) What does a timeout policy trade?

    Check yourself P_on = 200 mW, P_lp = 20 mW, P_tr = 200 mW, T_tr = 9 µs. What is T_be?

    (200 − 20) × 9 / (200 − 20) = 9 µs: with the transition at active power, break-even equals the transition time.

    Check yourself Why did sleeping at once cost 90% more energy on the busy link?

    Its idle periods (mean 8 µs) are mostly shorter than the 15.6 µs break-even time, so most sleeps cost more than they save.

    Key takeaways

    • Transitions cost energy, so sleeping saves only for idle periods longer than the break-even time.

    • T_be = (P_tr − P_lp) × T_tr / (P_on − P_lp); it exceeds the transition time when transitions draw more than active power.

    • Choose the timeout from the idle distribution and the wake latency the traffic tolerates.

    Keep going

    Next: Lesson 12.4, Low-Power Handshakes. Request, accept or deny: the handshake that lets a device refuse to sleep.

    Related topics

    • Part 12 overview: Power

    Previous

    174 / 234

    Next: Low-Power Handshakes

    Up next

    Up nextLow-Power Handshakes

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Idle Detection
    • Quiescing and Draining
    • Wake Signalling