← Protocols Interviews

Interview Question · Design

Designing an AXI-to-APB Bridge

L3 SeniorL4 Staffapbaxibridgearchitecture
  • Likely at Qualcomm
  • Likely at Samsung

The Question

The interviewer asks

Design an AXI4-to-APB bridge. What must it do, which decisions are yours, and how would you verify it?

Reveal the Model Answer

The bridge is the AXI subordinate and the APB requester. It decodes PSELx and makes one APB transfer per AXI beat. Each transfer uses the aligned address, with WSTRB on PSTRB and AxPROT on PPROT. It maps PSLVERR to SLVERR: per beat in RRESP, and merged into the single BRESP. Your decisions are read/write arbitration, DECERR for unmapped addresses, a timeout policy and posted writes. Verify it with checkers on both sides and an end-to-end scoreboard.

A 2-beat AXI Write Through the BridgeMeasured on the bench: cycle 0 is edge 3, where AW is taken; B is sent at edge 10.
AWWBPSELPWDATAPREADYAXI manageraxi_write, 2 beatsBridgeone beat at a timeAPB completerRAM at 0x000

Pills: an AXI beat taken by the bridge, then the same data written on APB.

01234567clkawvalidwvalidwreadypselpenablepreadypwdata01111111122222222bvalid
  1. Cycle 0

    AW is taken: a 2-beat write of words at 0x10.

  2. Cycle 1

    Beat 0 is taken from W. The bridge has room for one beat only.

  3. Cycle 2

    APB setup for 0x10 with 11111111. Beat 1 is already offered on W and must wait: wready is 0.

  4. Cycle 3

    APB access with pready 1: the first word is written.

  5. Cycle 4

    Now the bridge takes beat 1.

  6. Cycle 5

    Setup for 0x14 with 22222222.

  7. Cycle 6

    The second word is written. That was the last beat.

  8. Cycle 7

    B is sent with OKAY: one response for the whole AXI write.

Three edges per beat here: take the W beat, APB setup, APB access. The AXI side could have moved a beat on every edge.

AXI sideAPB sideNote
One burst of N beatsN transfers, each SETUP + ACCESSAPB has no burst signals; the bridge computes each beat's address
Beat address (maybe unaligned)Aligned PADDRAn unaligned PADDR is UNPREDICTABLE; the strobes pick the bytes
WSTRB of the beatPSTRBAll PSTRB low on reads
AxPROTPPROTSame three bit meanings: privileged, non-secure, instruction
RRESP per beat, one BRESPPSLVERR per transferMerging writes is a bridge decision
Address with no completerNo transferAnswer DECERR

What the bridge translates. The table is ours; each row is sourced in review.claims.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Listen For (Senior)

A good senior answer covers one APB transfer per beat, aligned PADDR with strobes, PPROT, the response mapping and merge, and DECERR. It keeps the AXI rules: every read beat comes back, and one BRESP follows the last W beat.

Cross-Questions

Where the interviewer goes next. Open a node to practise that follow-up.

WhyWhat IfProve ItBreak ItCompareScale It

  1. Designing an AXI-to-APB Bridge
  2. WhyUnmapped Addresses Behind an APB BridgeL2 Mid-LevelL3 Senior

    What should the bridge answer for an address that no APB completer owns? Why not just start the APB transfer anyway?

    Reveal the Model Answer

    Decode first, and answer DECERR without starting any APB transfer, because APB itself defines no decode error. With no PSELx asserted, nobody drives PREADY. So a transfer started to a hole never completes, unless a default responder answers it. DECERR also tells software that the address was wrong. SLVERR would instead suggest that a peripheral refused it.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Mid-Level)

    A good mid-level answer decodes the address before starting any APB transfer, and returns DECERR for a hole.

  3. What IfTimeouts in an APB BridgeL3 SeniorL4 Staff

    A completer hangs with PREADY low. Should the bridge time out? What does it return, and what is the risk?

    Reveal the Model Answer

    A timeout is system policy, not protocol. After a programmed limit, the bridge returns SLVERR so the CPU is not stuck forever. The risk is on the APB side: the requester must hold the transfer until PREADY, so the bridge cannot legally abandon it. It either keeps that segment blocked and fails every later access, or resets the completer. Specify which, raise an interrupt, and verify that recovery path.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Senior)

    A good senior answer separates the AXI response from the stuck APB transfer. It knows the bridge cannot simply drop an APB access that has started.

  4. ComparePSLVERR Through an AXI BridgeL2 Mid-LevelL3 Senior

    How does PSLVERR reach an AXI manager through a bridge? A 4-beat AXI write becomes four APB transfers and the second gets PSLVERR. What does the manager see?

    Reveal the Model Answer

    The bridge maps PSLVERR to SLVERR, in the RRESP of the failing beat for a read and in BRESP for a write. A write has one completion response for the whole transaction. So the bridge must merge four APB results into one BRESP. Reporting SLVERR if any beat failed is the usual choice. The remaining beats still run: AXI never shortens a burst, and every read beat is returned whatever its response.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Mid-Level)

    A good mid-level answer knows AXI reads report a response per beat but writes report once. So the bridge must merge the four APB results into one.

  5. Scale ItHow You Know the Bridge Is DoneL3 SeniorL4 Staff

    Walk me through your verification bench for an AXI-to-APB bridge, and tell me how you know you are done.

    Reveal the Model Answer

    Protocol checkers on both ports catch rule breaks. An end-to-end scoreboard predicts the APB transfers (one per beat, with address, PSTRB and PPROT) and the AXI responses. Done means every check passes and the coverage model is closed. That model crosses burst type, length and size with unaligned and narrow beats and wait states. It also covers PSLVERR on the first, middle and last beat, unmapped addresses, and reads racing writes.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Senior)

    A good senior answer names protocol checkers on both sides plus a scoreboard that predicts results. It gives a concrete coverage cross.

  6. Break ItSigning off APB Error HandlingL2 Mid-LevelL3 Senior

    What would you check and cover before you sign off error handling on an APB peripheral?

    Reveal the Model Answer

    Check that each refused access errors: a write to read-only, an unmapped offset, or a wrong size or protection. Check that PSLVERR is read only at completion, and that register state after a failed write matches the documented policy. Cover read and write, crossed with error or not, crossed with zero, one and many wait states. Also cover an error followed straight by a good transfer to the same completer. Then check the error reaches software through the bridge.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Mid-Level)

    A good mid-level answer lists the causes of an error. It crosses read or write, error or not, and the number of wait states in coverage.

  7. Prove ItSolve P3.7.1: The Bridge's APB SideSimulator-graded

    Show it, don't just say it: this Silicon Lab problem is graded by the simulator.

    Open Problem P3.7.1

What People Get Wrong

Common wrong answers and why they fail.

Misconception

Pass the burst start address to APB and let the peripheral increment it.

APB has no length or burst signal, so every transfer stands alone. The bridge must compute each beat's address from the AXI burst rules. It then issues one APB transfer per beat.

Source AMBA APB Protocol Specification IHI 0024E §2.1 AMBA APB signals (Table 2-1 has no burst or length signal); lesson P3.7 (a 4-beat burst becomes four APB transfers)

Spec Misquote

On PSLVERR in the middle of a read burst, stop and return the error at once.

AXI requires every read data transfer of the burst to be returned, whatever the response. A write gets exactly one completion response. Stopping early breaks the AXI side.

Source AMBA AXI Protocol Specification IHI 0022L §A3.3.2 Read response; §A3.3.1 Write response

Missed Corner

Send the unaligned AXI byte address straight to PADDR.

An unaligned PADDR is permitted, but its result is UNPREDICTABLE: the completer may use it, align it or error. Send the aligned word address, and select the bytes with PSTRB.

Source AMBA APB Protocol Specification IHI 0024E §2.1.1 Address bus

Learn It, Then Prove It