Tutorials

Protocols

Learn More

APB5 can include parity check signals for detecting single-bit errors on the interface between components. This is mainly useful in safety-critical SoCs where wire errors and transient faults must be detected.

apb-parity-protection-overview

The image shows one example of where parity protection can be used.

  1. The Source generates parity for the outgoing AMBA interface signals.
  2. At the Interconnect input, parity is checked. The Interconnect can then generate its internal EDC code for long-distance wiring and routing logic.
  3. At the Interconnect output, the EDC is checked and parity is generated again for the outgoing AMBA interface.
  4. The Destination receives the AMBA signals and parity signals, then checks parity at its input.

The key idea is that parity protects the interface between components, while an internal EDC scheme can protect logic and longer wiring inside a component such as an interconnect.

Check_Type configuration

The EDC scheme of the APB interface is defined by the Check_Type property.

Check_Type valueMeaning
FalseThere are no checking signals on the interface.
Odd_Parity_Byte_AllOdd parity checking is included for all signals. Each bit of the parity signal covers up to 8 bits.

If Check_Type is not declared, it is considered to be False. Check signaling can be added to APB5 interfaces only.

Odd parity rule

Odd parity means there is always an odd number of asserted bits across the interface signal and its check signal. Check signals are associated with each interface signal.

Common rules for byte parity interface protection:

  1. Each check bit covers no more than 8 payload bits.
  2. For a check signal wider than 1 bit, check bit n corresponds to payload bits [(8n+7):8n].
  3. If the payload is not an integer number of bytes, the most significant check bit covers fewer than 8 bits in the most significant portion of the payload.
  4. Parity signals that cover critical control signals are defined with a single parity bit. The single odd parity bit is the inversion of the original critical control signal.
  5. Check signals must be driven correctly in every cycle where the Check Enable term is true.
  6. Parity signals must be driven for all bits in the associated payload, whether or not those bits are actively used in the transfer.
  7. If some signals covered by a check signal are not present, the missing signals are assumed to be LOW.
  8. If none of the signals covered by a check signal are present, the check signal is omitted from the interface.

Error detection behavior

The APB specification defines the parity signaling, but it does not prescribe exactly how a component or system must react after detecting a parity error. The effect of a flipped bit depends on the system and affected signals.

When an error is detected, the Completer can:

  1. Terminate or propagate the transfer.
  2. Correct the parity check signal or propagate the error.
  3. Update its memory or leave it untouched.
  4. Signal an error response through other means, for example with an interrupt.

Parity check signals

Check signals are synchronous to PCLK and must be driven correctly every cycle in which the Check Enable term is true.

Check signalSignals coveredWidthCheck Enable
PADDRCHKPADDRceil(ADDR_WIDTH/8)PSEL
PCTRLCHKPPROTPWRITEPNSE1PSEL
PSELxCHKPSELx1PRESETn
PENABLECHKPENABLE1PSEL
PWDATACHKPWDATADATA_WIDTH/8PSEL && PWRITE
PSTRBCHKPSTRB1PSEL && PWRITE
PREADYCHKPREADY1PSEL && PENABLE
PRDATACHKPRDATADATA_WIDTH/8PSEL && PENABLE && PREADY && !PWRITE
PSLVERRCHKPSLVERR1PSEL && PENABLE && PREADY
PWAKEUPCHKPWAKEUP1PRESETn
PAUSERCHKPAUSERceil(USER_REQ_WIDTH/8)PSEL
PWUSERCHKPWUSERceil(USER_DATA_WIDTH/8)PSEL && PWRITE
PRUSERCHKPRUSERceil(USER_DATA_WIDTH/8)PSEL && PENABLE && PREADY && !PWRITE
PBUSERCHKPBUSERceil(USER_RESP_WIDTH/8)PSEL && PENABLE && PREADY