Interviews
APB Interview Questions
Practise the question, then the follow-ups an interviewer asks next.
Start with a Question TreeAI Mock Interview
- 5
- Question trees
- 49
- Follow-ups
- 25
- Wrong answers explained
- 3
- Runnable on a simulator
Flagship Questions · With follow-ups
Question Trees
Each question opens into the follow-ups an interviewer asks next, the wrong answers people give, and what a fresher's and a senior's answer sound like.
-
The APB Setup and Access Phases
Draw an APB write with no wait states, then one with a wait state. What happens in each cycle, and what is the shortest an APB transfer can be? 18 follow-ups · 9 pitfalls · 1 runnable- Asked at NVIDIA
- Likely at Broadcom
- Likely at Intel
-
Stale APB Read Data
A register read-back test fails only on the peripheral that adds wait states. Every read returns zero or the previous value. The writes look right on the waveform. Where do you look first? 10 follow-ups · 4 pitfalls · 1 runnable -
PSLVERR and What It Promises
When is PSLVERR valid? And if a write gets PSLVERR, was the register written or not? 5 follow-ups · 4 pitfalls · 1 runnable -
Why Registers Live on APB
Your SoC already has an AXI interconnect. Why put the UART, timer and GPIO registers behind an APB bridge, instead of giving each one an AXI port? 10 follow-ups · 5 pitfalls -
Designing an AXI-to-APB Bridge
Design an AXI4-to-APB bridge. What must it do, which decisions are yours, and how would you verify it? 6 follow-ups · 3 pitfalls- Likely at Qualcomm
- Likely at Samsung
No question matches these filters.
Quick revision · One flat list
Question Bank
All 19 APB questions, main and follow-up. Open a track, then a topic. Answer out loud first, then open the short answer.
Jump to a Track
19 questions · 3 topicsAPB
The APB Setup and Access Phases14
Draw an APB write with no wait states, then one with a wait state. What happens in each cycle, and what is the shortest an APB transfer can be? L0L1
Every APB transfer starts with one SETUP cycle. In it PSEL is high, PENABLE is low, and the address, direction and write data are valid. One or more ACCESS cycles follow, with PENABLE high. The transfer completes at the edge where PSEL, PENABLE and PREADY are all high. So the minimum is two cycles, and each cycle of PREADY low adds one. Afterwards the bus returns to IDLE, or goes straight to SETUP for the next transfer, with PENABLE low again.
QuestionPractise The APB Setup and Access Phases →Why does APB spend a whole cycle on SETUP? Why not finish a register access in one cycle? L1
SETUP gives the completer a full cycle with a stable address and select. Then PENABLE marks the cycle that counts. The completer can decode in SETUP and act on a single edge with very little logic. APB trades speed for that simplicity. It is not pipelined and every transfer costs at least two cycles, which is fine for occasional register traffic.
Follow-upPractise Why APB Has a Setup Cycle →The completer holds PREADY low for three cycles. What is the requester allowed to change during those cycles? L1L2
Nothing it set in SETUP: PADDR, PWRITE, PSEL, PENABLE and PPROT stay unchanged. So do PWDATA and PSTRB for a write, and any user request signals. The hold lasts from the SETUP-to-ACCESS transition until PREADY is high. The only free signal in that window is the completer's own PREADY. Any number of wait states is legal, from zero upwards.
Follow-upPractise What Holds During APB Wait States →A completer holds PREADY low forever. Is that an APB protocol violation? How does your bench catch it? L2L3
It is not a protocol violation, because APB allows any number of wait states. "Too long" is a system property, so a protocol checker cannot call it wrong. The bench uses a watchdog instead, with a limit taken from the peripheral's documented maximum. The watchdog reports a hang when the wait reaches that limit. In formal, the same requirement is a bounded response property, or a liveness property with fairness assumptions on the completer's inputs.
Follow-upPractise A Completer That Never Answers →A completer hangs with PREADY low. Should the bridge time out? What does it return, and what is the risk? L3L4
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.
Follow-upPractise Timeouts in an APB Bridge →Your APB protocol checker passes on every test. Which completer bugs can still be in the design? L2L3
Every bug that keeps the wires legal can remain, because a wire checker only proves the protocol. A completer that acts in every selected cycle still obeys the handshake. So does one that returns read data one transfer late, ignores PSTRB, acts without its PSEL, or raises PSLVERR a cycle early. A register model or scoreboard that predicts data and responses catches the rest. But it needs traffic with wait states, back-to-back transfers, sparse strobes and errors.
Follow-upPractise What an APB Checker Cannot See →Your SoC already has an AXI interconnect. Why put the UART, timer and GPIO registers behind an APB bridge, instead of giving each one an AXI port? L0L1
Register traffic is rare, small and tolerant of latency, so APB's simplicity wins. It runs one transfer at a time, with no bursts and no IDs. Each peripheral needs only a tiny state machine, and there are few wires to route. One bridge pays the AXI cost once for many peripherals. The price is throughput: at least two cycles per transfer, and one slow completer stalls the whole APB segment. So blocks that move real data stay on AXI or AHB.
QuestionPractise Why Registers Live on APB →What did APB3, APB4 and APB5 each add? L1
APB3 added wait states and errors, through PREADY and PSLVERR. APB4 added protection and sparse writes, through PPROT and PSTRB. APB5 added wake-up signalling, user signals and parity protection. The current issue also adds Realm Management Extension support as an option. An APB2 completer has neither PREADY nor PSLVERR, so a bridge ties them off for it.
Follow-upPractise From APB2 to APB5 →One peripheral on your APB segment takes 50 wait states for some registers. What happens to the other peripherals, and what would you do about it? L2L3
Every access behind that bridge waits, because APB carries one transfer at a time and nothing starts until the waiting one completes. One fix is to give the slow peripheral its own APB segment or bridge. Another is to make it answer at once with a busy bit that software polls. A third is posted writes: the bridge answers before APB finishes, so it loses PSLVERR for those writes. Pick by the latency budget of the time-critical peripherals.
Follow-upPractise One Slow Peripheral on the APB Segment →Design an AXI4-to-APB bridge. What must it do, which decisions are yours, and how would you verify it? L3L4
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.
QuestionPractise Designing an AXI-to-APB Bridge →What should the bridge answer for an address that no APB completer owns? Why not just start the APB transfer anyway? L2L3
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.
Follow-upPractise Unmapped Addresses Behind an APB Bridge →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? L2L3
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.
Follow-upPractise PSLVERR Through an AXI Bridge →Walk me through your verification bench for an AXI-to-APB bridge, and tell me how you know you are done. L3L4
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.
Follow-upPractise How You Know the Bridge Is Done →What would you check and cover before you sign off error handling on an APB peripheral? L2L3
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.
Follow-upPractise Signing off APB Error Handling →Stale APB Read Data2
A register read-back test fails only on the peripheral that adds wait states. Every read returns zero or the previous value. The writes look right on the waveform. Where do you look first? L1L2
At the edge where the read data is taken. PRDATA needs to be valid only at the completion edge, where PSEL, PENABLE and PREADY are all high. So a sampler at the first ACCESS edge reads data that is not ready yet. Zero-wait peripherals hide the bug, because their first ACCESS edge is the completion edge. Capture only when PREADY is high too, and run every regression with wait states.
QuestionPractise Stale APB Read Data →Design the monitor of an APB agent. When does it publish a transfer, and what goes in the item? L2L3
It publishes once per transfer, at the edge where PSEL, PENABLE and PREADY are all high. Only then are PRDATA and PSLVERR valid. The item carries the address, direction, PPROT, PWDATA and PSTRB, all stable since SETUP. It also carries PRDATA or the error at completion, and the wait count: the ACCESS cycles with PREADY low. Sampling through a clocking block keeps the monitor free of races with the DUT.
Follow-upPractise Designing the APB Monitor →PSLVERR and What It Promises3
When is PSLVERR valid? And if a write gets PSLVERR, was the register written or not? L1L2
PSLVERR counts only in the last cycle of the transfer, where PSEL, PENABLE and PREADY are all high. Elsewhere it is ignored, and driving it low there is only a recommendation. It says the transfer failed, not what happened inside. A failed write may or may not have changed the register. A failed read may return data that the requester still uses. PSLVERR is optional; without it the requester's input is tied low.
QuestionPractise PSLVERR and What It Promises →Why doesn't the APB specification guarantee that an errored write left the register alone? L2
Completers differ, and the specification keeps them cheap. Some decide the error only after part of the access has taken effect; others refuse cleanly. Forcing "no side effect on error" would add buffering to every peripheral. So the error reports failure only. The register's behaviour on error belongs in the peripheral's documentation and its register model.
Follow-upPractise Why an APB Error Promises so Little →What if your register model still predicts the write after PSLVERR comes back? L2
Then the mirror holds a value the register may not have. The next read check fails on a correct design, or passes on a wrong one. The adapter should return UVM_NOT_OK, so the model skips predicting that access. Then read the register back to learn what the peripheral really did.
Your Review Queue
Saved review reminders are coming soon.