Interview Question · Concept
The Two-Cycle AHB ERROR
The Question
The interviewer asks
Why does an AHB ERROR response take two cycles when OKAY takes one?
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 bus is pipelined. When a subordinate starts an ERROR, the next transfer's address phase is already on the bus. The first cycle (HRESP high, HREADYOUT low) holds that address phase and warns the manager. In the second cycle (HRESP high, HREADYOUT high), the manager can drive IDLE. That cancels the next transfer before anyone takes it. Wait states before the error carry HRESP low.
xfer is HTRANS[1].A token flies when an address phase is accepted. HRESP lit means ERROR.
- Cycle 1
The store to 0x100 is accepted.
- Cycle 2
0x100 completes with OKAY, and the store to 0x9000 is accepted at the same edge.
- Cycle 3
First ERROR cycle:
HRESPhigh,HREADYlow. The store to 0x104 is already on the wires, but nothing is accepted at this edge. - Cycle 4
The manager has replaced it with IDLE. Second ERROR cycle:
HREADYhigh,HRESPhigh. The 0x9000 store ends failed; the address phase taken here is IDLE. - Cycle 5
The bus is idle and OKAY again. 0x104 was never written: the dump reads 00 there.
The first ERROR cycle is a wait state that exists to give the manager this one decision.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Junior)
A good junior answer gives the two ERROR cycles exactly. It links them to the next address already being on the bus.
What Interviewers Listen For (Mid-Level)
A good mid-level answer knows the manager may cancel or continue the rest of a burst. It may change the address once the ERROR has started, and need not resend a cancelled burst.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
What IfProve ItBreak ItCompare
- The Two-Cycle AHB ERROR
-
What IfCancelling After an ERRORL2 Mid-Level
Beat 2 of an INCR4 write gets ERROR, and the manager drives IDLE in the second error cycle. What happens to beat 3, and must the manager redo the burst later?
text Data phase beat 1 beat 2 beat 2 HRESP OKAY ERROR ERROR HREADY 1 0 1 Address HTRANS SEQ SEQ IDLE What happens to the pipelined beat 3?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
Beat 3's address phase was on the bus during the first error cycle. The manager turns it into IDLE in the second cycle. So no subordinate ever takes it, because it is never accepted as NONSEQ or SEQ with HREADY high. The manager need not rebuild the remaining beats later. During that waited cycle, it may also change the address, which the normal hold rule forbids.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer explains that the cancelled beat is never accepted by any subordinate. It also says the manager need not resend the rest of the burst.
What Interviewers Listen For (Senior)
A good senior answer tests both manager choices, cancel and continue, in the bench. It checks that the subordinate keeps no partial state from the cancelled beat.
-
What IfA Manager That Continues After ERRORL2 Mid-Level
What if the manager does not cancel, and drives beats 3 and 4 after the ERROR? Is that legal, and what should your checker accept?
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
It is legal: cancelling the rest of the burst is allowed, not required. So the checker must accept both IDLE in the second error cycle and a burst that carries on. The subordinate answers the later beats normally. A checker that flags the continued burst reports a false failure on a legal manager.
Self-Check
Tick each key point you covered in your answer.
Spec Misquote
"After an ERROR the manager must abandon the burst."
The spec allows either choice. A checker built on that belief fails legal managers.
Source AMBA AHB Protocol Specification IHI 0033C §3.6.2 Early burst termination
Missed Corner
"An ERROR on a read stops the manager using the data."
The manager may still use it. That is why the spec recommends driving HRDATA to zero on an errored read.
Source AMBA AHB Protocol Specification IHI 0033C §5.1.3 ERROR response
-
Break ItAsserting the Two-Cycle ERRORL2 Mid-Level
A subordinate sometimes gives a one-cycle ERROR. Write assertions that catch it.
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
Check both directions. A first ERROR cycle (HRESP high, HREADYOUT low) must be followed by a second (HRESP high, HREADYOUT high). And a second cycle must be preceded by a first. The one-cycle error passes the first property vacuously: there is no first cycle to trigger it. It fails only the second, so a checker with just one of them misses it.
An ERROR with No Second CycleThe write to 0x8000 gets ERROR in a single cycle. At that same edge the write to 0x600 is accepted, and it completes. All cyclesap is 1 while a NONSEQ sits in the address phase. A token on the address wire is an address phase accepted at that edge.
- Cycle 1
The write to 0x8000 is accepted at this edge: its data phase is the next cycle.
- Cycle 2
The memory ends that data phase with HRESP and HREADY high together. The property
err_firstfails here: an ERROR must start with HREADY low. The same edge accepts the next address phase, the write to 0x600. - Cycle 3
The write to 0x600 completes with 77. A two-cycle ERROR would have given the manager the edge before this one to drive IDLE instead.
Measured on the lesson bench. This ERROR has one cycle only, so the next write is accepted and completes.
RUNVerilator · simulator serviceExpected:t=65 second_needs_first failedt=90 doneSelf-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer writes both implications, first cycle to second and second cycle back to first. It explains why one of them alone misses the one-cycle error.
What Interviewers Listen For (Senior)
A good senior answer also covers the starting conditions, an ERROR with and without wait states before it. Then a pass really means the rule was tested.
- Cycle 1
-
CompareError Responses Across AMBAL2 Mid-LevelL3 Senior
Compare AHB ERROR with APB PSLVERR and AXI SLVERR and DECERR. Where does an AHB decode error come from?
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 response bit, so a decode error is ERROR from the default subordinate for unmapped NONSEQ or SEQ transfers. APB's PSLVERR counts only in the single completion cycle, and needs no second cycle because APB is not pipelined. AXI separates SLVERR (the end point refused) from DECERR (no end point). It reports per read beat and once per write, and never shortens a burst. Bridges map PSLVERR to HRESP or to RRESP/BRESP.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer gets the error signalling of AHB, APB and AXI right. It knows the default subordinate makes the decode error on AHB.
What Interviewers Listen For (Senior)
A good senior answer explains that the cycle counts differ because of pipelining. It says what a bridge loses: AHB's one HRESP bit cannot carry SLVERR versus DECERR without extra status.
-
Prove ItSolve P4.5.1: A One-Cycle ErrorSimulator-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.
Spec Misquote
After an ERROR the manager must abandon the rest of the burst.
Cancelling is allowed, not required. Continuing the remaining beats is also acceptable. If the manager cancels, it drives IDLE during the two-cycle response.
Source AMBA AHB Protocol Specification IHI 0033C §3.6.2 Early burst termination; §5.1.3 ERROR response
Spec Misquote
A one-cycle error is fine as long as HRESP is high when HREADYOUT is high.
HRESP high with HREADYOUT high is only the second cycle. It must follow a first cycle with HREADYOUT low. A one-cycle error gives the manager no chance to cancel the next transfer.
Source AMBA AHB Protocol Specification IHI 0033C §5.1 Subordinate transfer responses (Table 5-2); §5.1.3 ERROR response
Misconception
Read data that comes with ERROR is thrown away, so the subordinate can leave anything on HRDATA.
The manager may still use read data that comes with an ERROR. So a subordinate cannot rely on ERROR to hide a value. Driving HRDATA to zero on a read error is recommended.
Source AMBA AHB Protocol Specification IHI 0033C §5.1.3 ERROR response