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
    • Latency, Throughput and Bandwidth
    • Little's Law
    • Outstanding Transactions
    • Tags and IDs
    • In-Order or Out-of-Order
    • Reorder Buffers
    • Interleaving
    • Split Completions
    • Protocol Efficiency
    • Peak and Sustained Bandwidth
    • Queueing Intuition
    • Tail Latency
    • Buffers That Hide Latency
    • Virtual Output Queues
    • Performance Modelling
    • Protocols Compared: Concurrency and Performance
    • Drills: Concurrency and Performance
  • 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
  • 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 6: Concurrency and Performance
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 6: Concurrency and Performance
  4. Buffers That Hide Latency

Part 6 · Concurrency and Performance · Senior (S)

Buffers That Hide Latency

Posting, write buffers, write combining, prefetching and caches all hide latency by acting before, or instead of, the real target. What each buys, and what each costs in visibility: errors, ordering and side effects.

On this page

    Note

    Level: Senior (S) · Answers: How many requests can be in flight?

    Before this: Posted and Non-Posted Writes, Transaction Attributes

    A driver writes four 32-bit values to consecutive addresses in a frame buffer, and the system turns them into a single 16-byte write, four times faster. The same driver writes four values to a device's command register, one after another, expecting four commands. The device receives one write, with the last value. The buffer that made the frame buffer fast made the device wrong.

    How do buffers hide latency, and what does each one hide that someone might need to see?

    The obvious answer, and why it breaks

    Latency can be hidden only by not waiting for it: answer early, combine work, or fetch before being asked. Each of these is a buffer that acts on the target's behalf. That is pure gain as long as nobody depends on what the buffer hides: when the write really happened, how many writes there were, whether a read had side effects. For memory, nobody does. For devices, almost everybody does.

    The idea: five latency-hiding buffers

    Mechanism

    Hides

    By

    Costs in visibility

    Posting (lesson 5.7)

    Write round trip

    Sending writes with no response

    No status to the requester; no knowledge of when it landed

    Write buffer / early acknowledgement

    Write latency to the target

    Accepting a write and answering before it reaches the target

    "Done" means "accepted", not "arrived"; ordering with other paths (lesson 7.4)

    Write combining

    Per-write overhead

    Merging several writes to nearby addresses into one larger write

    The number, order and size of writes change; fatal for device registers

    Prefetching

    Read latency

    Reading data before it is requested

    Reads that software never issued; wasted bandwidth; side effects on read-sensitive registers

    Caching (Part 13)

    Read and write latency

    Keeping copies close to the requester

    Other agents may see stale data unless coherence keeps copies in step

    The common thread: each buffer replaces "the target did it" with "something on the way did it, or will". Whether that is safe depends on the target, which is why transactions carry attributes saying which of these behaviours are allowed (lesson 5.12).

    Who may use what

    Target

    Posting / early ack

    Combining

    Prefetching

    Caching

    Normal memory

    Yes

    Yes

    Yes

    Yes (with coherence)

    Frame buffer or other write-mostly memory

    Yes

    Yes (write-combining memory)

    Rarely useful

    Usually no

    Device registers

    Only with care (and a read-back to confirm)

    No

    No

    No

    The speed they buy

    • Posting and write buffers turn a write's round trip into a hand-off: write-heavy code runs at the speed of the buffer.

    • Write combining turns many small writes into few large ones, raising protocol efficiency (lesson 6.9).

    • Prefetching turns latency-bound reads into bandwidth-bound ones (lesson 6.1), when access patterns are predictable.

    What breaks

    • Combined device writes: the opening story. The command register's address range was mapped as write-combining memory; four commands became one. Mapping it as device memory (non-bufferable, non-modifiable) fixed it.

    • Prefetched FIFO pops (illustrative): a prefetcher read ahead into a peripheral's receive-data register, popping bytes nobody asked for.

    • Early-acknowledged writes and interrupts: a write acknowledged by a buffer, followed by an interrupt on another path, let software read the target before the write arrived (lessons 5.14 and 7.4).

    Why this matters

    Senior lens. For every latency-hiding buffer on a path, ask what it changes about the number, order, timing and visibility of transactions, and check that every target it can reach tolerates those changes. Device regions should be excluded from combining, prefetching and caching by attribute, end to end; and wherever early acknowledgement is used, document what a write response actually promises.

    Interview

    Asked: "What does write combining break?"

    Weak answer: Nothing, it's just faster.

    Strong answer: Anything that depends on the exact number, order or size of writes. It merges several writes to nearby addresses into one, which is perfect for frame buffers and memory but wrong for device registers: four writes to a command register become one, a FIFO data register gets one wide write instead of four, and write order within the combined block can change. That's why device regions are mapped non-modifiable and only memory regions as write-combining.

    Follow-ups: (1) What does a prefetcher break on a device? (2) What does an early write acknowledgement promise?

    Check yourself Why must a device's receive-data register never be prefetchable?

    Reading it pops data; a prefetch would consume bytes no software read, losing them.

    Check yourself A write was acknowledged by a write buffer. Has it reached the target?

    Not necessarily: the acknowledgement means the buffer accepted it. To know it arrived, use a non-posted access that is ordered behind it, such as a read from the same target.

    Key takeaways

    • Posting, write buffers, combining, prefetching and caching hide latency by acting before or instead of the target.

    • Each changes what can be seen: when a write landed, how many writes there were, which reads happened.

    • Allow them for memory; exclude device registers by attribute, end to end.

    Keep going

    Next: Lesson 6.14, Virtual Output Queues. Fixing head-of-line blocking in a switch: queues per output and a scheduler.

    Related topics

    • Part 6 overview: Concurrency and Performance

    Previous

    99 / 234

    Next: Virtual Output Queues

    Up next

    Up nextVirtual Output Queues

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Latency, Throughput and Bandwidth
    • Little's Law
    • Outstanding Transactions