WRAP Address Calculation

AHB AXI WRAP Burst

A WRAP burst is similar to INCR burst. In WRAP the address will be incremented based the SiZE,
but on reaching the upper address limit address will wrap to lower address.

From the above statement, we could see  that there are two considerations during WRAP address calculation,

  1. Upper address limit to make WRAP
  2. Lower address to WRAP to

There are restrictions on WRAP bursts,

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

Equations for WRA Address Calculation

Below equations are used for WRAP address calculation,

  • Lower address to WRAP to

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

  • Upper address limit to make WRAP

Address_N = Wrap_Boundary + (Number_Bytes × Burst_Length)

WRAP Address calculation examples

WRAP Example-1

AxADDR = 0x04,  AxLEN = 3, AxSIZE = 2, AxBURST = 3

Start_Address   = 0x04
Burst_Length    = 4
Number_Bytes  = 4

Wrap_Boundary = (INT(Start_Address/(Number_Bytes×Burst_Length)))×(Number_Bytes×Burst_Length)
= (0x04/(4×4)) x (4×4)
= 0

Address_N = Wrap_Boundary + (Number_Bytes × Burst_Length)
= 0 + (4 x 4)
= 16

As Burst_Length is 4, Burst consists of 4 Address,
Address_0
Address_1
Address_2
Address_3

Condition, If the Address_n == 16, Address_n = wrap_boundary = 0

Address_0 = 4
Address_1 = Address_0 + Number_Bytes =  4 + 4 = 8
Address_2 = Address_1 + Number_Bytes =  8 + 4 = 12
Address_3 = Address_2 + Number_Bytes = 12 + 4 = 16

As per condition, Address_3 == 16, so Address_3 = 0

Therefore, ADDRESSES are 4, 8, 12, 0.

WRAP Example-2

AxADDR = 0x38,  AxLEN = 3, AxSIZE = 2, AxBURST = 3

Start_Address   = 0x38
Burst_Length    = 4
Number_Bytes  = 4

Wrap_Boundary = (INT(Start_Address/(Number_Bytes×Burst_Length)))×(Number_Bytes×Burst_Length)
= (0x38/(4×4)) x (4×4)
= 0x30

Address_N = Wrap_Boundary + (Number_Bytes × Burst_Length)
= 0x30 + (4 x 4)
= 0x40

As Burst_Length is 4, Burst consists of 4 Address,
Address_0
Address_1
Address_2
Address_3

Condition, If the Address_n == 0x34, Address_n = wrap_boundary = 0x30

Address_0 = 0x38
Address_1 = Address_0 + Number_Bytes = 0x38 + 0x4 = 0x3C
Address_2 = Address_1 + Number_Bytes = 0x3C + 0x4 = 0x40

As per condition, Address_2 == 0x40, so Address_2 = 0x30

Address_3 = Address_2 + Number_Bytes = 0x30 + 0x4 = 0x34

Therefore, ADDRESSES are 0x38, 0x3C, 0x30, 0x34.

WRAP Example-3

Lets consider an example,
AxADDR = 0x34,  AxLEN = 7, AxSIZE = 2, AxBURST = 3

Start_Address = 0x34
Burst_Length  = 8
Number_Bytes  = 4

Wrap_Boundary = (INT(Start_Address/(Number_Bytes×Burst_Length)))×(Number_Bytes×Burst_Length)
= (0x34/(4×8)) x (4×8)
= 0x20

Address_N = Wrap_Boundary + (Number_Bytes × Burst_Length)
= 0x20 + (4 x 8)
= 0x40

As Burst_Length is 4, Burst consists of 4 Address,
Address_0
Address_1
Address_2
Address_3

Address_7

Condition, If the Address_n == 0x40, Address_n = wrap_boundary = 0x20

Address_0 = 0x34
Address_1 = Address_0 + Number_Bytes = 0x34 + 4 = 0x38
Address_2 = Address_1 + Number_Bytes = 0x38 + 4 = 0x3C
Address_3 = Address_2 + Number_Bytes = 0x3C + 4 = 0x40

As per condition, Address_3 == 0x40, so Address_3 = 0x20

Address_4 = Address_3 + Number_Bytes = 0x20 + 4 = 0x24
Address_5 = Address_4 + Number_Bytes = 0x24 + 4 = 0x28
Address_6 = Address_5 + Number_Bytes = 0x28 + 4 = 0x2C
Address_7 = Address_6 + Number_Bytes = 0x2C + 4 = 0x30

Therefore, ADDRESSES are 0x34, 0x38, 0x3C, 0x20, 0x24, 0x28, 0x2C, 0x30

AMBA AHB AXI Interview Questions

AHB Interview Questions

  1. How AHB is pipelined architecture?
  2. What is the size of the max data that can be transferred in a single transfer?
  3. Explain the 1k boundary concept in AHB?
  4. Okay, response is a single cycle? but error/split/retry is two cycles, why?
  5. Explain the concept of a two-cycle response?
  6. What if the slave gets the address out of range?
  7. How to connect multiple slaves to a single master?
  8. Explain the round robin arbitration concept?
  9. Explain the split-retry concept?
  10. What is the difference between HREADY and HREADY_OUT signals?
  11. What is the slave response for a BUSY transfer?
  12. What is the difference between WRAP4 and INCR4?
  13. How to terminate the INCR type transfer?
  14. What is the difference between BURST and Beat?
  15. How to calculate the size of the burst?
  16. Is HREADY is Input or output to/from the slave?
  17. What is the aligned and un-align concept?
  18. Explain wrapping calculation?
  19. Is early burst termination is done by Slave/Arbiter?
  20. Explain the LOCKED transfer?
  21. What is the default Master?
  22. What is a little-endian and big-endian?
  23. How the slave will detect the end of INCR type burst transfer?

AXI Interview Questions

  1. How AXI is different from AHB?
  2. Explain the concept of the AXI 4KB boundary condition?
  3. Explain the valid ready handshake in AXI?
  4. Explain the channel concept?
  5. Explain the out-of-order concept?
  6. What is the fixed burst type?
  7. Explain the AXI response types?

Related Topics:

What is WRAP and How to Calculate Address in WRAP Burst? Click here