← Protocols Interviews

Interview Question · Concept

Write Data Before the Write Address

L1 JuniorL2 Mid-Levelaxihandshakedependencies

The Question

The interviewer asks

Can write data arrive at a subordinate before its write address? And when may the subordinate raise BVALID?

Reveal the Model Answer

Yes. The protocol sets no order between AW and W, so data may come before, with or after its address. The subordinate may wait for either or both VALIDs before raising either READY. But the manager must never wait for a READY before raising AWVALID or WVALID. BVALID may rise only after both the address and the last data beat (WLAST) have been accepted. It must not wait for BREADY.

Two Polite Blocks and an Address That Never MovesThe engine has a request and the port has room. Neither wire ever rises.
AWVALIDAWREADYDMA enginemanager, holds an addressInterconnect porthas room for a request

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

01234clkhas_requestroomawvalidawready
  1. Cycle 0

    The engine has an address to send. It will raise AWVALID as soon as it sees AWREADY.

  2. Cycle 1

    The port has four free request slots. It will raise AWREADY as soon as it sees AWVALID.

  3. Cycle 4

    Four edges later nothing has changed, and nothing ever will. The protocol settles who moves first; the engine broke that rule.

Neither wire ever rises. A subordinate may wait for VALID, so the manager broke the rule by waiting for READY.

  1. Manager

    Raises AWVALID and WVALID without waiting for AWREADY or WREADY, for every beat.

  2. Subordinate READYs

    May wait for AWVALID, WVALID or both before AWREADY or WREADY, or raise them early.

  3. Subordinate B

    Raises BVALID only after the AW handshake and the W handshake of the beat with WLAST, and never waits for BREADY.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Listen For (Junior)

A good junior answer states the three rules between AW, W and B. It says W data may arrive before its AW address.

Cross-Questions

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

WhyWhat IfProve ItBreak ItScale It

  1. Write Data Before the Write Address
  2. WhyWhy VALID Must Not Wait for READYL1 Junior

    Why is it the sender that is forbidden to wait, and not the receiver?

    Reveal the Model Answer

    Someone has to move first, or two polite blocks wait forever. The spec picks the sender: VALID may never wait for READY. READY may wait for VALID, or be high early. So every handshake makes progress as long as the sender has something to send. Receivers can also save power or logic by raising READY only on demand.

    Self-Check

    Tick each key point you covered in your answer.

  3. Break ItCatching a VALID That WaitsL2 Mid-LevelL3 Senior

    Your protocol checker binds every AXI rule as an assertion. Will it catch a manager whose WVALID waits for AWREADY?

    Reveal the Model Answer

    Not by itself. On the wires, the illegal manager looks legal against a subordinate that raises AWREADY early. Against a subordinate that waits for WVALID, nothing moves, and no safety property fails on a bus where nothing moves. You need a watchdog or liveness check (a VALID is eventually accepted). You also need stimulus that includes a subordinate holding AWREADY until it sees WVALID.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Mid-Level)

    A good mid-level answer says a timeout or an s_eventually liveness property is needed, because no safety check fails when nothing moves.

  4. Scale ItVerifying an AXI InterconnectL3 SeniorL4 Staff

    Walk me through how you would verify an AXI interconnect. What checks, what coverage, and which bugs are you most worried about escaping?

    Reveal the Model Answer

    Put a protocol checker on every manager and subordinate port. A fabric re-registers what it forwards, so it hides a subordinate's fault from the manager side. Add an end-to-end scoreboard keyed by manager and ID that checks routing, data, ID restore and same-ID order across subordinates. Test every region edge and hole for full-length DECERR. Stress with random back-pressure (READY held low), W before AW, maximum outstanding and racing exclusives, with watchdogs for deadlock.

    Bug that escapesWhat catches it
    Equal-length same-ID responses swappedscoreboard keyed by ID and address
    VALID waiting for READY (deadlock)watchdog or liveness property, plus a subordinate that waits for VALID
    Data in the wrong lanes with legal strobesbyte-level data check
    Subordinate stability bug behind a register slicechecker bound at the subordinate port
    Same-ID requests to two subordinates reorderedend-to-end per-ID order check with unequal latencies

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Senior)

    A good senior answer puts a checker on every port, plus an end-to-end scoreboard keyed by manager and ID, and decode tests.

  5. What IfEarly Write Data at an InterconnectL2 Mid-Level

    Write data reaches an interconnect two cycles before its address. What must the interconnect do with it?

    Reveal the Model Answer

    Hold it. The interconnect cannot know which subordinate the data belongs to until it decodes the address. So it must realign data with request, and present WVALID only to the destination. That means buffering W, or holding WREADY low, until the matching AW is decoded, in AW order. AXI4 write data carries no ID, so it follows the address order.

    Self-Check

    Tick each key point you covered in your answer.

  6. Prove ItSolve P2.3.1: The Write DependenciesSimulator-graded

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

    Open Problem P2.3.1

What People Get Wrong

Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.

Misconception

"The manager should send the address first and the data after AWREADY; that is the natural order."

A subordinate is allowed to wait for WVALID before raising AWREADY. Against such a subordinate this manager deadlocks: each side waits for the other. The twin shows no B after 20 cycles, and B after 3 when both VALIDs go up together.

Run It

The subordinate waits for both VALIDs, which is legal. The manager that holds its data until AWREADY never gets a response. The fixed manager raises both VALIDs together.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: FAIL manager waits for AWREADY before WVALID: no B after 20 cycles (AWVALID=1 AWREADY=0 WVALID=0)
See the Fix
module tb;
  localparam bit BUGGY = 0;   // 1: the manager holds WVALID until it sees AWREADY
  logic clk = 0, rst_n = 0;
  always #5 clk = ~clk;
  logic awvalid = 0, awready = 0, wvalid = 0, wready = 0, bvalid = 0, bready = 1;

  // Subordinate (legal): it may wait for AWVALID and WVALID before raising either READY (A2.3.2).
  // It accepts address and data together one cycle after it has seen both, then answers on B.
  always @(posedge clk) begin
    if (!rst_n) begin awready <= 0; wready <= 0; bvalid <= 0; end
    else begin
      awready <= awvalid && wvalid && !awready;
      wready  <= awvalid && wvalid && !wready;
      if (awvalid && awready) bvalid <= 1;          // one-beat write: address and data move together here
      else if (bvalid && bready) bvalid <= 0;
    end
  end

  // The manager issues one single-beat write and gives up after 20 cycles without a response.
  task automatic write(bit data_waits_for_awready, string name);
    int n = 0;
    bit got_b = 0;
    rst_n = 0; awvalid = 0; wvalid = 0;
    repeat (2) @(posedge clk); #1 rst_n = 1;
    awvalid = 1;
    if (!data_waits_for_awready) wvalid = 1;   // legal: no VALID waits for a READY
    while (!got_b && n < 20) begin
      @(posedge clk); n++;
      if (bvalid && bready) got_b = 1;
      if (awvalid && awready) begin            // address taken (with the data, for the legal manager)
        #1 awvalid = 0;
        wvalid = data_waits_for_awready;       // the illegal manager would offer its data only now
      end
    end
    if (got_b) $display("PASS %s: B received after %0d cycles", name, n);
    else $display("FAIL %s: no B after 20 cycles (AWVALID=%b AWREADY=%b WVALID=%b)", name, awvalid, awready, wvalid);
    #1 awvalid = 0; wvalid = 0;
  endtask

  initial begin
    if (BUGGY) write(1, "manager waits for AWREADY before WVALID");
    else       write(0, "manager drives AWVALID and WVALID together");
    $finish;
  end
endmodule

Prints: PASS manager drives AWVALID and WVALID together: B received after 3 cycles

Spec Misquote

"B can be sent once the last data beat is in, even if the address has not been taken yet."

That was AXI3. From AXI4 the subordinate must also have accepted the address before BVALID.

Source AMBA AXI Protocol Specification IHI 0022L §A2.3.2 Dependencies between channel handshake signals; AMBA AXI and ACE Protocol Specification IHI 0022H.c §A3.3.1

Learn It, Then Prove It