← Protocols Interviews

Interview Question · Concept

Byte Lanes and WSTRB for Narrow Transfers

L1 JuniorL2 Mid-Levelaxistrobesnarrow

The Question

The interviewer asks

On a 32-bit bus a manager does an INCR burst of four 1-byte beats from 0x1001, and a 4-byte burst from 0x3002. Which lanes and which WSTRB does each beat use?

Reveal the Model Answer

The lanes come from the address: lane = address mod bus width. The 1-byte beats walk lanes 1, 2, 3, 0 with strobes 0010, 0100, 1000, 0001. The unaligned 4-byte burst uses lanes 2 to 3 on beat 0 (strobe 1100) and all four lanes after that. WSTRB may clear any lane inside the beat's lanes, but must be low outside them.

A Narrow Burst Walks the LanesFive 1-byte beats from 0x2001. Watch the byte move one lane to the left each beat and wrap to lane 0 at the next word.
AWVALIDWVALIDWDATAWREADYManagerone byte per beatMemory (32-bit bus)lane01230x20000x2004

Lane 0 is the lowest address of each row.

0123456clkawvalidwvalidwreadybeat_addrx20012002200320042005xwstrb000000100100100000010010xwdata00000b00000b10000b2000000000000b30000b400xwlast
  1. Cycle 0

    The request: five transfers of one byte from 0x2001.

  2. Cycle 1

    Beat 0 is for 0x2001, lane 1 of the word at 0x2000: the byte b0 travels in bits 8 to 15 and only strobe 1 is set.

  3. Cycle 2

    Beat 1 moves to lane 2, beat 2 to lane 3. The data shifts with the lane.

  4. Cycle 4

    Beat 3 is for 0x2004, the next word: lane 0 again, bits 0 to 7.

  5. Cycle 5

    Beat 4 ends the burst in lane 1 of the second row. Five bytes, five lanes, one strobe each.

Measured: the memory reads 00 b0 b1 b2 b3 b4 afterwards. A FIXED burst at 0x2001 would light lane 1 five times.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: INCR 4 x 1-byte beats from 00001001: beat 0 addr 00001001 lanes 1-1 WSTRB 0010 beat 1 addr 00001002 lanes 2-2 WSTRB 0100 beat 2 addr 00001003 lanes 3-3 WSTRB 1000 beat 3 addr 00001004 lanes 0-0 WSTRB 0001 INCR 3 x 2-byte beats from 00002002: beat 0 addr 00002002 lanes 2-3 WSTRB 1100 beat 1 addr 00002004 lanes 0-1 WSTRB 0011 beat 2 addr 00002006 lanes 2-3 WSTRB 1100 INCR 3 x 4-byte beats from 00003002: beat 0 addr 00003002 lanes 2-3 WSTRB 1100 beat 1 addr 00003004 lanes 0-3 WSTRB 1111 beat 2 addr 00003008 lanes 0-3 WSTRB 1111

Self-Check

Tick each key point you covered in your answer.

What Interviewers Listen For (Junior)

A good junior answer works out each byte lane from the address. It gets the walking strobes right.

Cross-Questions

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

WhyWhat IfProve ItBreak ItScale It

  1. Byte Lanes and WSTRB for Narrow Transfers
  2. WhyByte Invariance and EndiannessL2 Mid-Level

    A big-endian core and a little-endian core share an AXI memory. Does AXI swap bytes for one of them?

    Reveal the Model Answer

    No. AXI is byte invariant: the byte at address word+n always travels on lane n, whichever core sent it. Endianness only decides which byte of a multi-byte value goes to which address, inside each core. So the bus never swaps lanes. A core that wants the other's view of a 32-bit value reverses the bytes in software or in its own interface.

    Self-Check

    Tick each key point you covered in your answer.

  3. What IfA Bridge That Swaps Byte LanesL2 Mid-LevelL3 Senior

    What if a bridge designer swaps byte lanes on one path to fix endianness for the big-endian core?

    Reveal the Model Answer

    Then byte invariance breaks on that path. A single byte written to word+1 now lands at word+2. Byte-wide software breaks, and the other core reads scrambled data. Endianness belongs inside each core, never on the bus.

    Self-Check

    Tick each key point you covered in your answer.

    Misconception

    "Swapping lanes in the interconnect turns big-endian into little-endian."

    It swaps every access, including single bytes, which have no endianness. Byte addresses then point at the wrong data.

    Source AMBA AXI Protocol Specification IHI 0022L §A3.2.4 Byte invariance

  4. What IfStrobes Outside the TransferL1 JuniorL2 Mid-Level

    A 1-byte write to 0x1001 arrives with WSTRB 0110. Legal? And a beat with WSTRB 0000?

    Reveal the Model Answer

    WSTRB 0110 is illegal. The beat addresses only lane 1, so the lane 2 strobe lies outside the transfer and must be low. WSTRB 0000 is legal: inside the beat's lanes any pattern is allowed, including none, and that beat writes nothing. A manager uses all-zero strobes to finish a burst it no longer needs, because a burst cannot end early.

    Self-Check

    Tick each key point you covered in your answer.

  5. Break ItRight Strobes, Wrong LanesL2 Mid-LevelL3 Senior

    A DMA streams 16-bit samples with perfect strobes, and every second sample is lost. The protocol checker is silent. What happened?

    log
    Illustrative DMA debug excerpt
    Source samples: 1122, 3344, 5566, 7788
    Destination:    1122, 0000, 5566, 0000
    AXI protocol errors: 0
    WSTRB matches each addressed halfword.
    Reveal the Model Answer

    The data stayed in lanes 0 and 1, while the strobes moved to lanes 2 and 3 for the odd addresses. The strobes alone are legal, so no protocol rule fires. The subordinate writes whatever sits in the strobed lanes. Only a data check catches it: a scoreboard or read-back that compares bytes by address. Lesson P2.7 measured the result: 11 11 00 00 33 33 00 00.

    Four Legal Strobes, Two Lost SamplesA 4-beat burst of 2-byte transfers from 0x3000. The engine leaves every sample in the low half of the bus.
    AWVALIDWVALIDWDATAWREADYDMA enginemanager, 32-bit dataBuffer (32-bit bus)lane01230x30000x3004

    A lit cell is a byte the memory wrote in that beat.

    012345clkawvalidwvalidwreadybeat_addrx3000300230043006xwstrb00000011110000111100xwdata000001111000022220000333300004444xwlast
    1. Cycle 0

      The request: four transfers of two bytes from 0x3000, an INCR burst.

    2. Cycle 1

      Beat 0 is for 0x3000: lanes 0 and 1, strobe 0011, sample 1111 in the low half. Correct.

    3. Cycle 2

      Beat 1 is for 0x3002: lanes 2 and 3, strobe 1100. The engine left 2222 in the low half, so lanes 2 and 3 carry zeros, and the memory writes the zeros.

    4. Cycle 3

      Beat 2 is back in the low lanes, so 3333 lands where it should.

    5. Cycle 4

      Beat 3 repeats the mistake at 0x3006. The strobes were legal on every beat; the data was in the wrong place on two of them.

    Measured: the buffer reads 11 11 00 00 33 33 00 00 afterwards. The protocol checker reports no broken rule.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Mid-Level)

    A good mid-level answer names the bug: right strobes, data in the wrong lanes. It says only a check on the data can see it.

  6. Scale ItUpsizers, Downsizers and ModifiableL3 Senior

    You put a 32-to-64-bit upsizer and a 64-to-32-bit downsizer in a fabric. Which transactions are they allowed to reshape?

    Reveal the Model Answer

    A Non-modifiable transaction (AxCACHE[1] low) must not be split or merged. It keeps its address, size, length and burst type. So an upsizer steers each narrow beat into the right half of the wide word and leaves size and length alone. It may pack beats only when the transaction is Modifiable. A downsizer must split anyway when Size exceeds the narrow bus, a case the spec admits cannot meet the rule.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Senior)

    A good senior answer ties packing beats to AxCACHE[1], the Modifiable bit. It knows the downsizing exception, and that split responses must be joined back together.

  7. Prove ItSolve P2.7.1: The Lane MapperSimulator-graded

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

    Open Problem P2.7.1

What People Get Wrong

Common wrong answers and why they fail.

Misconception

"A narrow transfer always uses the low lanes, like a byte write on a CPU bus."

AXI lanes are fixed by address: byte address word+n travels on lane n. The run shows lanes 1, 2, 3, 0.

Source AMBA AXI Protocol Specification IHI 0022L §A3.2.3 Narrow transfers; §A3.1.6 Transaction equations

Spec Misquote

"An unaligned start is illegal; the address must be aligned to the size."

Only WRAP needs an aligned start. INCR and FIXED may start anywhere, and beat 0 just covers fewer bytes.

Source AMBA AXI Protocol Specification IHI 0022L §A3.2.5 Unaligned transfers; §A3.1.4 Burst attribute

Learn It, Then Prove It