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. Quiescing and Draining

Part 12 · Power · Senior (S)

Quiescing and Draining

Before a block loses power or is reset, every transaction touching it must finish: no new requests in, every outstanding one completed, every buffer empty, every credit returned. The order of the steps, and why each one matters.

On this page

    Note

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

    Before this: Low-Power Handshakes, Reset Semantics

    A network accelerator is being powered down to save energy. Software stops sending it work, waits a millisecond to be safe, and switches it off. Most of the time that works. Occasionally, the accelerator had a write still sitting in its output buffer, or a read still waiting for data from memory, and the switch-off loses it: a corrupted packet in one case, a hung read in the other. Waiting "long enough" is not a protocol.

    How is an interface brought to a clean stop before its power is removed or it is reset?

    The obvious answer, and why it breaks

    The obvious answer is to stop sending new work and wait a while. There is no time that is always long enough: a request can be stuck behind congestion or a slow target for an unbounded time. And stopping new work is only one direction; responses still owed, writes still buffered and credits still held all need to finish too. Quiescing must be driven by evidence, not by a timer.

    The idea: stop, drain, confirm, then cut

    Flowchart: stop accepting new requests or answer them with errors; wait until every outstanding request has completed; flush write buffers and posted writes; return all credits so nothing is owed; confirm idle and accept the power-down or reset; isolate outputs, then remove clock or power.
    Quiescing is a sequence: stop new work, wait for every outstanding request to complete, flush buffers, settle credits, confirm, and only then isolate and cut power.

    Step

    Why it matters

    Stop new requests

    Otherwise the drain never ends; new requests should be held upstream or answered with errors, not dropped

    Complete outstanding requests

    Responses arriving after power-down are lost; requests left at the target hang their requesters

    Flush buffers

    Posted writes in a buffer look complete to the sender but have not reached their target

    Settle credits

    Credits held by the departing side must be accounted for, or the partner's count is wrong after the block returns

    Isolate, then cut

    Outputs of a powering-down block float; isolation cells clamp them to safe values first

    Knowing when it is drained

    • Count outstanding requests: increment on issue, decrement on completion; zero means drained in that direction.

    • Use the protocol's completion signals: write responses, completions, acknowledgements; a write is done when its response returns, not when it leaves.

    • Fence or barrier: issue a barrier and wait for it to complete; ordering rules then guarantee everything before it is done (lesson 7.5).

    • Bound it: a request that never completes must still end, by a timeout that escalates to an error or a reset (lesson 9.9).

    How real protocols chose

    Protocol

    Quiescing

    PCI Express

    The Transactions Pending bit in Device Status shows non-posted requests still awaiting completions; software waits for it to clear (with a timeout) before a Function Level Reset or power-down (fact P36).

    AMBA Q-Channel

    The device accepts a quiescence request only when it is idle, and QACTIVE shows whether it still has activity (fact A22).

    DCLink

    The device accepts slp_req only with nothing outstanding (step 11).

    What breaks

    The opening accelerator (illustrative) was fixed by replacing the millisecond wait with a drain sequence: block new work, poll an outstanding-request counter until zero, issue a write barrier and wait for its response, then accept the power-down. The rare corrupted packets and hung reads disappeared, and power-down got faster, since most drains completed in microseconds.

    Why this matters

    Senior lens. Every block that can be powered down or reset independently needs a quiesce sequence: stop, drain both directions, flush, settle credits, confirm, isolate. Make each step observable (counters, status bits), bound the whole sequence with a timeout that escalates, and test it under heavy traffic and slow targets, because that is when drains take long and shortcuts fail.

    Interview

    Asked: "How do you safely power down a block that has transactions in flight?"

    Weak answer: Stop sending it traffic and wait a bit.

    Strong answer: Quiesce it with evidence, not a timer. First stop new requests reaching it, holding them upstream or answering with errors. Then wait for every outstanding request to complete, using an outstanding counter or the protocol's completions, and flush posted writes, for example with a barrier whose completion proves everything earlier is done. Settle credits so nothing is owed. Only then does the block accept the power-down; outputs are isolated and the clock or power removed. Bound the drain with a timeout that escalates. PCIe exposes Transactions Pending for exactly this before a function-level reset.

    Follow-ups: (1) Why is a fixed wait not enough? (2) What is the danger with posted writes?

    Check yourself Why must posted writes be flushed separately from waiting for outstanding reads?

    A posted write gets no response, so it looks finished to the sender while it may still sit in a buffer on the way to its target.

    Check yourself What should happen to a request that arrives for a block being quiesced?

    It should be held upstream until the block returns, or answered with an error; never silently dropped.

    Key takeaways

    • Quiescing is driven by evidence: stop new work, complete every outstanding request, flush, settle credits.

    • Only after confirming idle may the block accept power-down; outputs are isolated before power goes.

    • Bound the drain with a timeout that escalates, and make each step observable.

    Keep going

    Next: Lesson 12.6, Wake Signalling. Who wakes whom, by which wire, and how fast.

    Related topics

    • Part 12 overview: Power

    Previous

    176 / 234

    Next: Wake Signalling

    Up next

    Up nextWake Signalling

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Idle Detection
    • Link Power States
    • Break-Even Time