← Protocols Interviews

Interview Question · Debug

The Link That Never Moved

L0 FresherL1 Juniorhandshakedeadlockdebug

The Question

The interviewer asks

A DMA engine and a memory controller each pass their unit tests. Connected, nothing moves: the wave shows valid and ready low forever while both have work. What happened and whose bug is it?

log
Illustrative clock samples
edge  source_has_data  sink_has_room  valid  ready
1     1                1              0      0
2     1                1              0      0
3     1                1              0      0
Reveal the Model Answer

It is a circular wait. The engine raises valid only after seeing ready, and the controller raises ready only after seeing valid. The controller is legal, because a sink may wait for valid. The engine broke the rule that valid must not wait for ready. Its unit test passed because that bench kept ready high in advance. The run shows the same source moving 18 beats with one legal sink and 0 with another.

Two Polite Blocks and a Bus That Never MovesThe source has a beat and the sink has room, yet each waits for the other's first move.
validreadyDMA enginesource, holds a1Memory ctrlsink, 4 free slots

Both blocks wait. Neither wire ever lights, so no beat ever moves.

01234clkhas_beatroomvalidready
  1. Cycle 0

    The engine holds beat a1. It will raise valid as soon as it sees ready.

  2. Cycle 1

    The controller has four free slots. It will raise ready as soon as it sees valid.

  3. Cycle 4

    Four edges later nothing has changed, and nothing ever will. A rule about who moves first is the only cure.

Each block waits for the other to move first, so neither ever moves. The source broke the rule.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: bad source, waiting sink: 0 beats in 20 cycles bad source, ready-first sink: 18 beats in 20 cycles good source, waiting sink: 18 beats in 20 cycles

Self-Check

Tick each key point you covered in your answer.

What Interviewers Listen For (Fresher)

A good fresher answer sees that each block waits for the other, so neither moves. It names the rule the source broke: valid must not wait for ready.

Cross-Questions

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

WhyWhat IfProve ItBreak ItCompareScale It

  1. The Link That Never Moved
  2. WhyWhy the Rule Is LopsidedL1 JuniorL2 Mid-Level

    Why is the sink allowed to wait for valid, but the source is not allowed to wait for ready?

    Reveal the Model Answer

    Someone has to move first, and the source is the side that knows a beat exists. Letting the sink wait is useful. An interconnect can decode the address carried with valid before it decides which target grants it. A sink can also keep ready low to save power. If either side could wait, two compliant blocks could deadlock, so the spec fixes the order.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Junior)

    A good junior answer says one side has to move first, or two waiting blocks can stop each other.

  3. CompareReady as a Function of ValidL2 Mid-LevelL3 Senior

    If the sink may wait for valid, may it compute ready combinationally from valid in the same cycle?

    Reveal the Model Answer

    Inside one block, a same-cycle ready = f(valid) works logically. But on an AXI interface, the spec forbids combinational paths from inputs to outputs. So the wait goes through a register, and ready rises the cycle after valid is seen. The rule stops timing paths from chaining across blocks. A combinational ready path would grow with every stage.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Mid-Level)

    A good mid-level answer knows that AXI bans a combinational path from an input to an output on an interface.

    Spec Misquote

    "Waiting for valid means ready can be assign ready = valid && !full; at the port."

    That is an input-to-output combinational path at the interface, which AXI forbids. Register it, or decouple it with a slice.

    Source AMBA AXI Protocol Specification IHI 0022L §A2.1.1 Clock

  4. Prove ItSolve R4.4.1: A Skid BufferSimulator-graded

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

    Open Problem R4.4.1

  5. Break ItTwo Blocks That Close a Combinational LoopL2 Mid-LevelL3 Senior

    Break it: one block makes valid from ready, and its neighbour makes ready from valid, both in the same cycle. What happens?

    Reveal the Model Answer

    The two paths close a combinational loop through both blocks. Simulation can oscillate or hang in zero time, and timing tools cut the loop at a random point. AXI rules both halves out. A transmitter must not wait for READY before it asserts VALID, and no input may reach an output combinationally.

    Self-Check

    Tick each key point you covered in your answer.

    Missed Corner

    "Each block is fine on its own, so the pair is fine."

    The loop exists only when they connect. Check each interface rule at the block, or the loop appears at integration.

    Source AMBA AXI Protocol Specification IHI 0022L §A2.1.1 Clock

  6. What IfReady as a Function of ValidL2 Mid-LevelL3 Senior

    If the sink may wait for valid, may it compute ready combinationally from valid in the same cycle?

    Reveal the Model Answer

    Inside one block, a same-cycle ready = f(valid) works logically. But on an AXI interface, the spec forbids combinational paths from inputs to outputs. So the wait goes through a register, and ready rises the cycle after valid is seen. The rule stops timing paths from chaining across blocks. A combinational ready path would grow with every stage.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Mid-Level)

    A good mid-level answer knows that AXI bans a combinational path from an input to an output on an interface.

    Spec Misquote

    "Waiting for valid means ready can be assign ready = valid && !full; at the port."

    That is an input-to-output combinational path at the interface, which AXI forbids. Register it, or decouple it with a slice.

    Source AMBA AXI Protocol Specification IHI 0022L §A2.1.1 Clock

  7. Prove ItSolve R4.4.1: A Skid BufferSimulator-graded

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

    Open Problem R4.4.1

  8. Break ItTwo Blocks That Close a Combinational LoopL2 Mid-LevelL3 Senior

    Break it: one block makes valid from ready, and its neighbour makes ready from valid, both in the same cycle. What happens?

    Reveal the Model Answer

    The two paths close a combinational loop through both blocks. Simulation can oscillate or hang in zero time, and timing tools cut the loop at a random point. AXI rules both halves out. A transmitter must not wait for READY before it asserts VALID, and no input may reach an output combinationally.

    Self-Check

    Tick each key point you covered in your answer.

    Missed Corner

    "Each block is fine on its own, so the pair is fine."

    The loop exists only when they connect. Check each interface rule at the block, or the loop appears at integration.

    Source AMBA AXI Protocol Specification IHI 0022L §A2.1.1 Clock

  9. Scale ItCatching Circular Waits Before IntegrationL3 Senior

    How would your methodology have caught that deadlock at block level, before the two blocks met?

    Reveal the Model Answer

    Test each source against an adversarial sink, one that keeps ready low until it sees valid. Assert that pending work produces valid within a bound while ready stays low. In every agent, randomise ready per cycle, including long low stretches. In formal, assume ready stays low until valid and prove that valid rises. A cover that never hits points at the circular wait.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Senior)

    A good senior answer puts a hostile sink, one that keeps ready low until it sees valid, into the reusable agent. It adds a property that valid comes within a bound, not just a global timeout.

  10. Prove ItSolve P1.3.2: Catch the Broken SourcesSimulator-graded

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

    Open Problem P1.3.2

What People Get Wrong

Common wrong answers and why they fail.

Half-Truth

"Fix the controller so it raises ready first."

That hides the bug for this pairing only. The run shows the same source deadlocking with any legal sink that waits for valid. One example is an interconnect that decodes the address first.

Wrong Altitude

"Add a watchdog that pulses ready when the link is idle too long."

A watchdog turns a protocol violation into a performance bug that comes and goes. The rule exists so that no timer is needed.

Misconception

"Both blocks are at fault; they need to agree who goes first."

The spec already decides: the receiver may wait, and the transmitter may not. Only the source breaks the spec.

Source AMBA AXI Protocol Specification IHI 0022L §A2.3 Valid-Ready transport

Learn It, Then Prove It