AXI Wrap Address Calculation

AXI (Advanced eXtensible Interface) is a widely used protocol in modern SoC (System on Chip) designs, primarily due to its efficiency in handling high-speed data transfers. One key feature of AXI is its burst transactions, which allow multiple data transfers to occur with a single address phase. Among different burst types, the wrap burst is particularly useful for cache operations.

A wrap burst is a special type of burst mode in AXI where the address wraps around within a fixed boundary. This ensures that memory accesses remain within a predefined address range, making it particularly useful for cache-line fills and circular buffers.

Key Characteristics of Wrap Burst:

  • The address sequence follows a wrapping pattern within an aligned boundary.
  • The boundary is determined by the burst size and length.
  • Ensures efficient memory access patterns, particularly in cache operations.

Two restrictions apply to wrapping bursts:

  • the start address must be aligned to the size of the transfer
  • the length of the burst must be 2, 4, 8, or 16.

Before we dive into examples, let’s understand the general formula for wrap address calculation.

For wrap address calculation, we will require two things:

  1. Upper address limit, once it reached address wraps around to lower address.
  2. Lower address to wrap to

For lower address calculation:

Wrap_Boundary = (INT(Start_Address / (Number_Bytes×Burst_Length))) × (Number_Bytes×Burst_Length)

Upper Address Limit

Address_N = Wrap_Boundary + (Number_Bytes x Burst_Length)

WRAP Address Calculation Examples:

WRAP Example 1:

Starting Address = 0x0004, AxLEN = 3, AxSIZE = 2

Burst_Length = AxLEN + 1

= 3 + 1 = 4

Number_Bytes = 2 ^ 2 = 4

Wrap_Boundary = (INT(Start_Address / (Number_Bytes×Burst_Length))) × (Number_Bytes×Burst_Length)

Wrap _Boundary = INT(0x004/(4 x 4)) x (4 x 4)

= 0 x 16 = 0x0000

Address_N = Wrap_Boundary + (Number_Bytes x Burst_Length)

= 0x0000 + 16 = 0x000F

Since the burst length is 4, burst will consist of 4 addresses.

0x0004

0x0008 = 0x0004 + 4

0x000C = 0x0008 + 4

0x0000 (LWB) because 0x0010 = 0x000c +4 is beyond 0x000F (UWB)

WRAP Example 2:

Starting Address = 0x38, AxLEN = 3, AxSIZE = 2

Burst_Length = AxLEN + 1

= 3 + 1 = 4

Number_Bytes = 2 ^ 2 = 4

Wrap_Boundary = (INT(Start_Address / (Number_Bytes×Burst_Length))) × (Number_Bytes×Burst_Length)

Wrap _Boundary = INT(0x38/(4 x 4)) x (4 x 4)

= INT(56/16) x 16 = 48 = 0x30

Address_N = Wrap_Boundary + (Number_Bytes x Burst_Length)

= 48 + 16 = 64 = 0x40

Since the burst length is 4, burst will consist of 4 addresses.

0x38

0x3C= 0x38 + 4

0x30 (LWB) because 0x40 = 0x3C +4 is beyond 0x40 (UWB)

0x34 = 0x30 + 4