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
  • Part 13: Shared State and Coherence9
  • Part 14: Security and Isolation7
  • Part 15: Specifying and Verifying11
  • Part 16: Protocols Dissected17
    • How to Dissect a Protocol
    • UART
    • SPI
    • I2C
    • APB
    • AHB
    • AXI4
    • AXI-Stream
    • PCI Express
    • DDR
    • CHI
    • Ethernet
    • USB
    • UCIe
    • CXL
    • Protocols Compared: Protocols Dissected
    • Drills: Protocols Dissected
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 16: Protocols Dissected
  1. Topics
  2. First Principles of Hardware Protocols
  3. Part 16: Protocols Dissected
  4. APB

Part 16 · Protocols Dissected · Foundation (F)

APB

APB dissected through the twenty questions: a setup phase, an access phase stretched by PREADY, one transfer at a time, and an error bit. The simplest on-chip bus, designed for low-bandwidth peripheral registers where area and power matter more than speed.

On this page

    Note

    Level: Foundation (F) · Answers: How do real protocols answer the fifteen questions?

    Before this: How to Dissect a Protocol, Wait States and Stretching

    A chip has forty peripheral blocks (timers, GPIO, UART controllers), each with a handful of registers that software reads and writes a few times per second. Connecting each to a high-performance bus would waste area and power on bandwidth nobody uses. APB is what remains when you strip a bus down to a register access: address, select, enable, data, ready, error.

    How does APB answer each question, and why is so little needed for register access?

    Constraints first: what APB had to work with

    Constraint

    APB

    C1 Distance and medium

    On-chip wires, usually behind a bridge from a faster bus

    C2 Bandwidth and latency

    Low; at least two cycles per transfer

    C3 Wires

    Parallel address, data and a few control signals; area matters more than wire count

    C4 Topology

    One requester (the bridge) and many completers, selected by PSEL

    C5 Who builds each side

    Many IP vendors; one Arm specification

    SETUP always lasts one cycle (PSEL high, PENABLE low); ACCESS (PENABLE high) repeats until the completer raises PREADY.

    APB's answers to the fifteen questions

    Each answer links to the lesson that explains the idea behind it.

    #

    Question

    Answer

    1

    When is the data valid?

    A common clock (PCLK); signals are sampled on its rising edge (1.1)

    2

    Where does a message start and end?

    Each transfer is a SETUP cycle then an ACCESS phase, marked by PSEL and PENABLE (fact A8) (2.2)

    3

    Is the receiver ready?

    The completer stretches ACCESS by holding PREADY low: a wait state (3.2)

    4

    How much may I send before I hear back?

    Implicit: one transfer at a time, paced by PREADY (4.1)

    5

    What exactly is being asked?

    Single reads and writes; no bursts; APB4 adds byte strobes (PSTRB) and protection (PPROT) (fact A17) (5.1)

    6

    How many requests can be in flight?

    Exactly one transfer outstanding (6.3)

    7

    In what order do results become visible?

    Trivially in order: one at a time (7.1)

    8

    Who gets the wire?

    No arbitration: a single requester selects one completer with PSEL (8.1)

    9

    Why can it hang?

    A completer that never raises PREADY hangs the bus; systems add timeouts in the bridge (9.9)

    10

    What if bits go wrong?

    PSLVERR reports a failed transfer (APB3); no detection or retry of bit errors (10.7)

    11

    How do the two sides agree at start-up?

    None: a fixed address map in the bridge

    12

    How do we save power without losing data?

    Not addressed by the protocol; idle completers see no activity, and clock gating is done by the system

    13

    What if there are several copies of one value?

    Not applicable: registers are not cached coherently

    14

    Who is allowed to ask?

    PPROT carries privilege and secure attributes (APB4) for completers or firewalls to check (14.1)

    15

    How do we know it is correct?

    Arm protocol checks and simple VIP; tests cover wait states, errors and back-to-back transfers (15.3)

    The choices that define APB

    • Two-phase transfer: a one-cycle setup gives decoders and completers time, keeping their logic slow and small.

    • One at a time: no pipelining, no outstanding transfers, no ordering problems.

    • Behind a bridge: high-performance buses carry APB traffic to a bridge, so the many slow peripherals never load the fast bus.

    What breaks

    A peripheral (illustrative) held PREADY low while waiting for a slow internal clock domain to answer, and that domain had been clock-gated. The APB bridge waited for ever, and with it the processor's load instruction. Adding a timeout in the bridge that completed the transfer with PSLVERR turned the hang into a reported error, and the driver now enables the peripheral's clock before touching it.

    Why this matters

    Senior lens. APB is the right answer for a specific constraint set: many small, slow register blocks where area and power dominate. Its only liveness risk is PREADY, so a bridge timeout is cheap insurance. When a peripheral starts needing bandwidth (DMA, FIFOs), move it to a higher-performance bus rather than stretching APB.

    Interview

    Asked: "Why is an APB transfer at least two cycles?"

    Weak answer: Because the bus is slow.

    Strong answer: Because each transfer has a setup phase of exactly one cycle, PSEL high and PENABLE low, which gives the address decode and the completer time to prepare, followed by an access phase with PENABLE high that lasts until the completer raises PREADY. That keeps peripheral logic simple and slow-timing-friendly, at the cost of throughput, which is fine for register access. Only one transfer is ever in flight, so there's no pipelining, bursting or ordering to manage.

    Follow-ups: (1) How does a completer insert wait states? (2) What does PSLVERR do?

    Check yourself What is the minimum number of cycles for an APB transfer?

    Two: one setup cycle and one access cycle with PREADY high.

    Check yourself Why does APB need no ordering rules?

    Only one transfer is ever in flight.

    Key takeaways

    • APB: setup then access, stretched by PREADY, one transfer at a time.

    • It suits many small, slow register blocks where area and power matter more than bandwidth.

    • Its one liveness risk is a completer that never raises PREADY; bridges add timeouts.

    Keep going

    Next: Lesson 16.6, AHB. Pipelining address and data, and why AHB-Lite dropped SPLIT and RETRY.

    Related topics

    • Part 16 overview: Protocols Dissected

    Previous

    211 / 234

    Next: AHB

    Up next

    Up nextAHB

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • How to Dissect a Protocol
    • UART
    • SPI