Interview Question · Design
AHB Decoder, Multiplexor and Default Subordinate
- Likely at Infineon
The Question
The interviewer asks
Build the interconnect for one AHB manager and three subordinates. What does the decoder do, what drives the read multiplexor's select, and why do you need a default subordinate?
You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The decoder turns HADDR into one HSELx during the address phase. The multiplexor returns HRDATA, HRESP and HREADYOUT from the subordinate whose data phase is in progress. So its select is the decoder output, registered at every edge where HREADY is high. The live decoder output already names the next transfer. A default subordinate fills the holes in the map, so nothing hangs. It gives a zero-wait OKAY for IDLE and BUSY, and a two-cycle ERROR for NONSEQ and SEQ.
HSELx lights in the address phase; data_sel names the subordinate the multiplexor listens to.
- Cycle 0
The read of 0x0100 enters its address phase; HSEL0 is 1. data_sel still names m1, which answered the last write; no read is ending.
- Cycle 1
HREADY was 1 at the last edge, so data_sel now names m0. Its data phase ends with 0a0a0a0a while HSEL1 already selects the next read.
- Cycle 2
data_sel moves to m1 and its data, 1b1b1b1b, comes back. The decoder now points at 0x3000, a hole: HSELD.
- Cycle 3
The default subordinate answers a NONSEQ with ERROR: HRESP 1, HREADY 0, the first cycle. The manager withdraws the read of 0x0100 that is already on the wires.
- Cycle 4
The second ERROR cycle: HREADY 1, HRESP still 1. HTRANS is IDLE, the cancelled read is gone.
- Cycle 5
The manager issues the read of 0x0100 again.
- Cycle 6
It ends with 0a0a0a0a from m0.
Measured: rd = 0a0a0a0a 1b1b1b1b 00000000 0a0a0a0a, with ERROR for the hole and no rule broken.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer registers the multiplexor select at edges where HREADY is high. It knows the 1 KB region rule and adds a default subordinate with the right answers.
What Interviewers Listen For (Senior)
A good senior answer explains the HREADY loop, where the bus HREADY goes back to every subordinate. It keeps decode simple for timing, and plans back-to-back traffic across subordinates with waits to verify it.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfProve ItBreak ItCompareScale It
- AHB Decoder, Multiplexor and Default Subordinate
-
WhyAHB Bursts and the 1 KB RuleL1 JuniorL2 Mid-Level
List the AHB burst types. Where does a WRAP4 of words starting at 0x34 go, and what rule must an incrementing burst respect?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
HBURST gives SINGLE, undefined-length INCR, and fixed INCR4/8/16 and WRAP4/8/16. The number counts beats, not bytes. A wrapping burst wraps inside a window of beats times size. So a WRAP4 of words from 0x34 visits 0x34, 0x38, 0x3C, 0x30. An incrementing burst must not cross a 1 KB boundary, because subordinate regions are at least 1 KB and 1 KB aligned. Every beat is aligned to its size.
A WRAP8 Burst from 0x34 Lands in MemoryMeasured: cycle 0 is edge 4, where the first address phase is accepted. beat_addris the address of the beat in its data phase;dphaseis 1 while a write beat is in its data phase.All cyclesEach cell is one byte; lane 0 is the lowest address of its row. The pill carries the data of the beat.
- Cycle 0
NONSEQ at 0x34 starts the burst. Eight beats of 4 bytes make a 32-byte window, 0x34 rounded down to 32 is 0x20: the burst stays inside 0x20 to 0x3f.
- Cycle 1
Beat 0's data lands at 0x34 while beat 1's address, 0x38, is already on the bus: the pipeline of P4.2, one beat at a time.
- Cycle 3
After 0x3c the next address would be 0x40, the end of the window, so the manager drives 0x20. The data moving now is beat 2, for 0x3c.
- Cycle 4
Beat 3 lands at 0x20, the first row of the window.
- Cycle 8
Beat 7 lands at 0x30 and the bus goes IDLE. All eight rows are written: from 0x20 the dump reads a3 a4 a5 a6 a7 a0 a1 a2.
Measured: a WRAP8 of words from 0x34. After 0x3c it wraps to 0x20, inside its 32-byte window.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer lists the HBURST types and works out the wrap addresses. It states the 1 KB rule and the reason for it.
What Interviewers Listen For (Mid-Level)
A good mid-level answer knows the rules for ending a burst after BUSY. It knows an INCR of one beat is a legal single. It knows a burst can end early after an ERROR or in a multi-layer interconnect.
Misconception
INCR4 moves four bytes.
The number is beats. The bytes are beats times the HSIZE transfer size: 16 bytes for an INCR4 of words.
Source AMBA AHB Protocol Specification IHI 0033C §3.6 Burst operation (Note)
Spec Misquote
An AHB burst can start at an unaligned address, like AXI.
Every transfer of an AHB burst must be aligned to its size: words on word boundaries, halfwords on halfword boundaries. Unaligned data becomes smaller aligned transfers.
Source AMBA AHB Protocol Specification IHI 0033C §3.6 Burst operation
Spec Misquote
A fixed-length burst may end with BUSY when the manager runs out of data.
INCR4/8/16 and WRAP4/8/16 must end with a SEQ beat. Only an undefined-length INCR may end after BUSY.
Source AMBA AHB Protocol Specification IHI 0033C §3.6.1 Burst termination after a BUSY transfer
- Cycle 0
-
WhyWhy the 1 KB BoundaryL1 JuniorL2 Mid-Level
Why must an AHB incrementing burst not cross a 1 KB boundary? And how does that compare with AXI?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Subordinate regions are at least 1 KB, and they start and end on 1 KB boundaries. So a burst that stays inside one 1 KB block never changes subordinate mid-burst. Subordinates can then treat SEQ beats as a continuation without decoding again. AXI applies the same idea with a 4 KB boundary. A wrapping burst stays inside its own aligned window, which on usual bus widths is far smaller than 1 KB.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer links the rule to the smallest subordinate region and its 1 KB boundaries.
What Interviewers Listen For (Mid-Level)
A good mid-level answer writes the check: the first and last beat addresses must match above bit 9. It compares this with the 4 KB rule of AXI.
-
Break ItAn INCR Burst Across a 1 KB BoundaryL1 JuniorL2 Mid-Level
Break it: an INCR4 burst of words starts at 0x3F8. What goes wrong at the boundary, and what should the manager do?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The beats are 0x3F8, 0x3FC, 0x400 and 0x404. The third beat starts the next 1 KB block, which may belong to another subordinate. That subordinate sees a SEQ beat with no NONSEQ before it. The manager must split the request: two beats, then a new NONSEQ at 0x400.
Self-Check
Tick each key point you covered in your answer.
Misconception
"The decoder looks at every beat, so it handles the crossing."
It does select the new subordinate. But that subordinate gets a SEQ beat it never saw start, and SEQ means continue your burst.
Source AMBA AHB Protocol Specification IHI 0033C §4.2 Address decoding
-
Prove ItNext Address in a Wrapping BurstL1 JuniorL2 Mid-Level
Write the next-address function for AHB bursts, wrapping and incrementing, and show it on the spec's examples.
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The window is beats times size, aligned to its own size. Add the size to the address. For a wrapping burst, if that reaches the end of the window, go back to the window's base. The run reproduces the specification's WRAP4, INCR4, WRAP8 and halfword INCR8 examples. The classic bug is a window sized for the old burst length, which turns WRAP8 back at 16 bytes.
RUNIcarus Verilog · in your browserExpected:WRAP4 words from 0x34: 34 38 3c 30INCR4 words from 0x38: 38 3c 40 44WRAP8 words from 0x34: 34 38 3c 20 24 28 2c 30INCR8 halfwords from 0x34: 34 36 38 3a 3c 3e 40 42Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer works out the wrap window from the beat count and size, and aligns it.
What Interviewers Listen For (Mid-Level)
A good mid-level answer tests at the first and last beat of the window. It spots the wrong-window bug from the address trace.
-
What IfBursts That End EarlyL2 Mid-LevelL3 Senior
Can an AHB burst end before its last beat? Who may end it, and what must a subordinate tolerate?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
A manager may not end a fixed-length burst on its own, but two things can end it. After an ERROR, the manager may cancel the remaining beats. A multi-layer interconnect may also cut a burst to serve another manager. An INCR burst also ends whenever BUSY is followed by IDLE or NONSEQ. Subordinates must work correctly when a burst never completes, for example by dropping prefetched data.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer names both causes of an early end, an ERROR and a multi-layer interconnect, plus the INCR case.
What Interviewers Listen For (Senior)
A good senior answer makes cut-short bursts a coverage goal for each subordinate, ending at every beat position. It checks that no state leaks into the next access.
-
CompareAHB Pipelining Against AXI Outstanding TransactionsL1 JuniorL2 Mid-Level
Compare AHB's pipelining with AXI's outstanding transactions. When would you still pick AHB?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
AHB has one address and control path, with at most one transfer in address and one in data. Transfers complete in order, and a wait state stalls whatever is behind it. AXI has independent channels and IDs, so a manager can issue many requests without waiting. Responses with different IDs may return out of order. AHB wins on area and simplicity for a single manager with modest latency, such as a microcontroller memory bus.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer contrasts the two buses. AHB is two transfers deep and in order, while AXI allows many requests in flight, ordered by ID.
What Interviewers Listen For (Mid-Level)
A good mid-level answer links it to hiding latency. With memory latency L, AHB stalls for L cycles while AXI keeps L requests in flight. It picks AHB where latency is short and area matters.
-
Prove ItSolve P4.6.2: WRAP8Simulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
-
Scale ItFrom One AHB Manager to SeveralL3 SeniorL4 Staff
Now a DMA engine joins the CPU on the same subordinates. What changes in the AHB system, and what does the verification plan add?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
An interconnect adds arbitration and routing, because the AHB interface itself stays single-manager. It stalls a waiting manager by holding its HREADY low. A multi-layer interconnect may cut a burst short to serve another manager, so subordinates must cope with unfinished bursts. Locked sequences need HMASTLOCK, and exclusives need HMASTER to tell managers apart. The plan adds per-port checkers, routing scoreboards, fairness coverage and terminated-burst coverage.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Senior)
A good senior answer knows several AHB managers need an interconnect. It says the interconnect stalls a manager through HREADY and may end a burst early.
What Interviewers Listen For (Staff)
A good staff answer picks a single-layer or multi-layer interconnect from bandwidth needs and handles locked and exclusive traffic. It defines sign-off: concurrency coverage, starvation limits and address-map sweeps for each manager.
-
Break ItInterconnect Bugs That Pass Block TestsL2 Mid-LevelL3 Senior
Every subordinate passes its own block-level tests, yet the SoC sometimes reads wrong data. Which interconnect bugs slip past block tests, and what traffic exposes them?
log Illustrative integration-test excerpt Subordinate A unit tests: pass Subordinate B unit tests: pass SoC read A, then read B with wait states: read B returned data expected from A; response OKAY2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
These bugs need two subordinates at once. A mux select on the wrong phase shows only on back-to-back accesses to different subordinates. A HREADY fan-in that forwards the wrong HREADYOUT shows only when one subordinate waits while another is addressed. A region off-by-one shows only at a 1 KB edge, and a one-cycle default-subordinate error only on unmapped accesses. Expose them with back-to-back cross-subordinate traffic, random waits and address sweeps at every region boundary.
Each Read Returns the Read Before ItFour reads, m0, m1, m0, m1, with the multiplexor keyed by the address-phase select. Watch HRDATA arrive one transfer late. All cyclesdata_sel is the subordinate in the data phase: the one the multiplexor should listen to.
- Cycle 0
The read of 0x0100 is in its address phase. The decoder selects m0.
- Cycle 1
Its data phase ends here, and m0 is answering. But the address phase now names 0x1100, so the broken multiplexor passes m1's HRDATA: 00000000.
- Cycle 2
The read of 0x1100 ends. The address phase names m0 again, and the multiplexor hands over m0's word, 0a0a0a0a.
- Cycle 3
The second read of 0x0100 gets m1's 1b1b1b1b. Every read so far has the data of the one before it.
- Cycle 4
Only the last read comes back right, because no new address phase follows it.
Measured. A multiplexor keyed by the address-phase select returns each read the data of the read before it. No wire rule fires.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer names the cases that need two subordinates at once. It names the traffic that reaches them.
What Interviewers Listen For (Senior)
A good senior answer writes coverage for them: previous subordinate crossed with current subordinate and wait state, plus bins at region edges. This proves random traffic really hits them.
- Cycle 0
-
Prove ItSolve P4.12.3: The Read That Returned Its Neighbour's DataSimulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
-
Prove ItSolve P4.8.2: Decoder and Default SubordinateSimulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
What People Get Wrong
Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.
Misconception
Drive the read multiplexor straight from the decoder's HSEL.
During a data phase the decoder already sees the next address. Back-to-back reads to two subordinates then return the neighbour's data. The live-select mux below does this for both reads.
Run It
FAIL live-select mux: read 0x00000010 returned bbbb0000 PASS registered-select mux: read 0x00000010 returned aaaa0010 FAIL live-select mux: read 0x00000404 returned aaaa0010 PASS registered-select mux: read 0x00000404 returned bbbb0404Spec Misquote
A small peripheral can get a 256-byte region.
The minimum region for one subordinate is 1 KB, starting and ending on a 1 KB boundary. That is what keeps an incrementing burst inside one subordinate.
Source AMBA AHB Protocol Specification IHI 0033C §4.2 Address decoding
Missed Corner
Without a default subordinate an unmapped access just reads zero.
With no HSELx active, nobody owns the data phase. Then HREADY and HRESP come from nowhere, and the bus can hang. A map with holes needs a default subordinate.
Source AMBA AHB Protocol Specification IHI 0033C §4.2.1 Default Subordinate