An AXI master sends only the first address of a burst. The slave works out the rest from three fields: the burst length (AxLEN), the beat size (AxSIZE) and the burst type (AxBURST), which is FIXED, INCR or WRAP. This article explains each type, the rules that limit bursts, including the 4 KB boundary, and the address calculation a slave has to implement.

9 min read | Intermediate

What You'll Learn

  • Decode AxLEN, AxSIZE and AxBURST
  • Calculate the beat addresses of FIXED, INCR and WRAP bursts
  • Apply the burst rules: lengths, alignment and the 4 KB boundary
  • Implement the next-address calculation in Verilog

Length and Size

The burst length is AxLEN + 1 beats. In AXI4, AxLEN is 8 bits, so an INCR burst can have 1 to 256 beats. FIXED and WRAP bursts are limited to 16 beats, and a WRAP burst must have 2, 4, 8 or 16.

The beat size is 2 to the power AxSIZE bytes:

AxSIZEBytes per beat
0001
0012
0104
0118
10016
10132
11064
111128

The size may not be larger than the data bus. A size smaller than the bus is a narrow transfer, which uses only some of the byte lanes; see Write Strobes and Unaligned Transfers.

The Three Burst Types

AxBURSTTypeAddress of each beatTypical use
00FIXEDThe same for every beatFilling or emptying a FIFO through one register
01INCRPrevious address plus the beat sizeNormal sequential memory
10WRAPLike INCR, but wraps back to the start of an aligned blockCache line fills, critical word first
11-Reserved-

For a WRAP burst, the block size is the beat size times the number of beats, and the block is aligned to that size. The specification calls its lowest address the wrap boundary. A WRAP burst of four words starting at 0x0A8 uses the 16-byte block 0x0A0 to 0x0AF, so it runs 0x0A8, 0x0AC, then wraps to 0x0A0 and 0x0A4. The start address of a WRAP burst must be aligned to the beat size.

Quick Check

Q: List the addresses of a WRAP burst with ARLEN = 7 and ARSIZE = 2 starting at 0x34.

Show Answer

Eight beats of 4 bytes: a 32-byte block, 0x20 to 0x3F. The burst goes 0x34, 0x38, 0x3C, 0x20, 0x24, 0x28, 0x2C, 0x30.

The Burst Rules

  • 4 KB boundary: a burst must not cross a 4 KB address boundary. This keeps a burst from crossing from one slave into the next (slave address regions are laid out in units of 4 KB) and limits how many address bits a slave must increment. It is the AXI version of AHB's 1 KB rule.
  • No early termination: once started, a burst runs for all its beats. A master that wants to stop writing early can drive the remaining write strobes low; a master that wants fewer read beats must still accept them all.
  • WRAP lengths: 2, 4, 8 or 16 beats, with an aligned start address.
  • Long INCR bursts may be split into shorter bursts by an interconnect, for example to keep latency low for other masters, as long as the result is equivalent.

The Address Calculation

The specification gives the address of every beat in terms of the start address, the number of bytes per beat and the burst length. In Verilog it fits in one function, used by the slave for both reads and writes:


function [11:0] next_addr(input [11:0] a, input [2:0] size, input [1:0] burst, input [7:0] len);
  reg [11:0] bytes;
  reg [11:0] incr;
  reg [11:0] wrap_bytes;
  begin
    bytes = 12'd1 << size;
    incr  = (a & ~(bytes - 12'd1)) + bytes;           // aligned address + size
    if (burst == FIXED) begin
      next_addr = a;
    end
    else if (burst == WRAP) begin
      wrap_bytes = bytes * (len + 12'd1);              // the wrap boundary block
      next_addr  = (a & ~(wrap_bytes - 12'd1)) | (incr & (wrap_bytes - 12'd1));
    end
    else begin
      next_addr = incr;
    end
  end
endfunction

Two details matter. The increment is applied to the aligned address, so an unaligned first beat is followed by an aligned second beat. And for WRAP, the upper address bits stay those of the wrap boundary while the lower bits count around the block.

The Simulation

The testbench writes three four-beat bursts of words, one of each type. The memory slave has a trace option that prints the address of every beat it handles:


write(1, 12'h080, 3, WORD, FIXED, 32'hF0, 0, 0, 0);  // 4 beats, all to 0x080
write(1, 12'h090, 3, WORD, INCR,  32'h90, 0, 0, 0);  // 0x090, 0x094, 0x098, 0x09C
write(1, 12'h0A8, 3, WORD, WRAP,  32'hB0, 0, 0, 0);  // 0x0A8, 0x0AC, 0x0A0, 0x0A4
read(1, 12'h080, 0, WORD, INCR, 0, 30);
read(1, 12'h0A0, 3, WORD, INCR, 0, 0);
Output
45      slave: write beat at 0x080, WSTRB 1111
55      slave: write beat at 0x080, WSTRB 1111
65      slave: write beat at 0x080, WSTRB 1111
75      slave: write beat at 0x080, WSTRB 1111
105      slave: write beat at 0x090, WSTRB 1111
115      slave: write beat at 0x094, WSTRB 1111
125      slave: write beat at 0x098, WSTRB 1111
135      slave: write beat at 0x09c, WSTRB 1111
165      slave: write beat at 0x0a8, WSTRB 1111
175      slave: write beat at 0x0ac, WSTRB 1111
185      slave: write beat at 0x0a0, WSTRB 1111
195      slave: write beat at 0x0a4, WSTRB 1111
...
355  R   id=1 data=0x000000f3 OKAY last
365  R   id=1 data=0x000000b2 OKAY
375  R   id=1 data=0x000000b3 OKAY
385  R   id=1 data=0x000000b0 OKAY
395  R   id=1 data=0x000000b1 OKAY last

The FIXED burst wrote all four beats to 0x080, so only the last value, 0xF3, remains. The WRAP burst started at 0x0A8, so its first beat (0xB0) is at 0x0A8 and its third (0xB2) at 0x0A0: an INCR read of the block returns 0xB2, 0xB3, 0xB0, 0xB1.

Quick Check

Q: A master wants to write 512 bytes starting at 0x1F00 with word beats. Can it use one INCR burst?

Show Answer

No. 512 bytes of words is 128 beats, which is within the 256-beat limit, but the burst would run from 0x1F00 to 0x20FF and cross the 4 KB boundary at 0x2000. It must be split at 0x2000 into two bursts of 64 beats.

Running It in ChipVerify Lab

The example runs these bursts with the slave trace on. Change the start address of the WRAP burst and predict the beat addresses before you run it.

Common Mistakes

Mistake #1: Crossing 4 KB

An INCR burst that crosses a 4 KB boundary may start in one slave and end in another. Masters, DMA engines in particular, must split bursts at 4 KB.

Mistake #2: Incrementing the unaligned address

After an unaligned first beat, the next address is the aligned address plus the size, not the start address plus the size. Adding the size to 0x101 gives 0x105, but the second beat of a word burst is at 0x104.

Mistake #3: Wrong wrap block

The wrap block is beats times size, aligned to that size. Using the beat size alone, or a fixed 16 bytes, gives wrong addresses for any other burst shape.

Practice Exercise

Challenge: WRAP of Eight Halfwords

Replace the WRAP burst with a WRAP burst of eight halfwords starting at 0x0B6. Predict the eight beat addresses and the byte lanes of each beat, then run it with the trace on.

Hint

Eight beats of two bytes: the block is 16 bytes. A halfword with address bit 1 set uses lanes 3 and 2.

Solution

write(1, 12'h0B6, 7, HALF, WRAP, 32'hC0, 0, 0, 0);
Output
165      slave: write beat at 0x0b6, WSTRB 1100
175      slave: write beat at 0x0b8, WSTRB 0011
185      slave: write beat at 0x0ba, WSTRB 1100
195      slave: write beat at 0x0bc, WSTRB 0011
205      slave: write beat at 0x0be, WSTRB 1100
215      slave: write beat at 0x0b0, WSTRB 0011
225      slave: write beat at 0x0b2, WSTRB 1100
235      slave: write beat at 0x0b4, WSTRB 0011

The block is 0x0B0 to 0x0BF, so the burst wraps after 0x0BE. The strobes alternate between the upper and lower halfword lanes.

Open the ready-made example in the lab and run the simulation.

Summary

  • Only the start address is sent; AxLEN + 1 beats of 2 to the power AxSIZE bytes follow.
  • FIXED repeats one address, INCR adds the size, WRAP adds the size inside an aligned block of beats times size.
  • INCR bursts can be 256 beats in AXI4; FIXED and WRAP up to 16, WRAP only 2, 4, 8 or 16.
  • No burst may cross a 4 KB boundary, and no burst may end early.
  • After the first beat, the address increments from the aligned address.
Did you find what you were looking for?

Quiz

No quiz questions available for this article.