Tutorials

Protocols

Learn More

APB signals can be understood in groups: clock/reset, requester control, write data, completer response, optional attributes, and optional parity check signals.

apb-signal-groups

Core APB signals

SignalSourceDescription
PCLKClockAPB clock. Protocol signals are sampled on rising edges.
PRESETnResetActive-low reset.
PADDRRequesterAddress bus. It is a byte address and can be up to 32 bits wide.
PSELxRequesterSelect signal for a specific Completer.
PENABLERequesterIndicates Access phase, meaning the second and later cycles of a transfer.
PWRITERequesterHIGH for write transfer, LOW for read transfer.
PWDATARequesterWrite data bus. Width can be 8, 16, or 32 bits.
PRDATACompleterRead data bus. Same width as PWDATA.

Handshake and response signals

SignalSourceDescription
PREADYCompleterExtends or completes the Access phase. A transfer completes when PSELxPENABLE, and PREADY are HIGH.
PSLVERRCompleterOptional error response signal. Valid only in the final Access cycle.

In APB2, PREADY and PSLVERR are not part of the interface. In APB3 and later, they support wait states and transfer error reporting.

Optional APB4 and APB5 signals

SignalRevision/useDescription
PSTRBAPB4+Write strobe. One bit per byte lane of PWDATA.
PPROTAPB4+Protection attributes: normal/privileged, secure/non-secure, data/instruction hint.
PNSEAPB5 RME optionExtension to protection information for Root/Realm address space support.
PWAKEUPAPB5 optionWake-up indication for clock/power control logic.
PAUSERAPB5 user optionUser-defined request attribute.
PWUSERAPB5 user optionUser-defined write data attribute.
PRUSERAPB5 user optionUser-defined read data attribute.
PBUSERAPB5 user optionUser-defined response attribute.

Address and data width

PADDR carries a byte address, not a word index. This means address value 0x04 means byte address 4 in the peripheral address map.

The APB data bus width can be 8, 16, or 32 bits. The write data bus PWDATA and read data bus PRDATA are separate physical signals, but they must have the same width on an APB interface.

For a 32-bit APB data bus, one transfer can carry 4 bytes of data:

Data bus widthBytes per transferNaturally aligned address examples
8 bits1 byte0x000x010x020x03
16 bits2 bytes0x000x020x040x06
32 bits4 bytes0x000x040x080x0C

An address is aligned when it matches the transfer width boundary. For example, on a 32-bit data bus, 0x000x04, and 0x08 are aligned addresses. Address 0x02 is not aligned for a 32-bit access.

The APB specification permits PADDR to be unaligned, but says the result is unpredictable. In practice, a Completer might align the address internally, use the unaligned value, return an error, or document that such access is unsupported. Because of that, RTL and software should normally use aligned addresses unless the peripheral documentation clearly says otherwise.

Even though APB has separate PWDATA and PRDATA buses, it does not perform a read and write at the same time. The transfer direction is selected by PWRITE:

PWRITETransfer typeData bus used
HIGHWriteRequester drives PWDATA
LOWReadCompleter drives PRDATA

Signal validity windows

Signal validity means: when is a signal required to contain meaningful information?

Not every APB signal has to be meaningful in every clock cycle. Some signals must always be valid, some become valid when a peripheral is selected, and some are only valid when a transfer completes. This matters because RTL must sample signals only in the correct window, and assertions should not check a signal before the protocol says it is meaningful.

apb-signal-validity-windows

Think of APB validity in layers:

ConditionMeaningSignals to treat as meaningful
AlwaysBus-level state is known even when no transfer is activePSEL, and PWAKEUP if implemented
PSEL=1A Completer has been selected; Setup or Access is activePADDR, PWRITE, PENABLE, PPROT, PNSE, PSTRB, request user fields, and active write data lanes
PSEL=1 and PENABLE=1Access phase is activePREADY
PSEL=1, PENABLE=1, and PREADY=1Transfer completes in this cyclePRDATA for reads, PSLVERR, PRUSER, and PBUSER

For a read transfer, use PRDATA only in the cycle where the transfer finishes. That finish cycle is when PSELPENABLE, and PREADY are all HIGH.

Similarly, PSLVERR should not be sampled during Setup or during a wait state. It is meaningful only in the final Access cycle.

Simple verification checklist:

  1. PSEL must always be valid.
  2. PWAKEUP, if present, must always be valid.
  3. When PSEL is asserted, request-side address/control attributes must be valid.
  4. PREADY is meaningful when PSEL and PENABLE are asserted.
  5. PRDATA, PSLVERR, PRUSER, and PBUSER are valid only at the completed Access handshake.
  6. Signals that are not currently required to be valid should preferably be driven to zero where practical.