Slave Address Translation Examples - 3.3 English

Versal ACAP CPM DMA and Bridge Mode for PCI Express Product Guide (PG347)

Document ID
PG347
Release Date
2022-11-02
Version
3.3 English

Example 1: BAR Size of 64 KB, with 1 Window Size 4 KB

Window 0: 4 KB with address translation of 0xF for bits [15:12].

  1. Selections in Vivado IP configuration in the AXI BARs tab are as follows:
    • AXI BAR size 64K: 0xFFFF bits [15:0]
    • Address translation for bits[63:16] can be set in GUI. In this example [63:16] = 0x0
    • Set Aperture Base Address: 0x0000_0000_0000_0000
    • Set Aperture High Address: 0x0000_0000_0000_FFFF
  2. The BDF table programming:
    • Program 1 entries for 1 window
    • Window Size = AXI BAR size/8 = 64K / 8 = 0x1FFF = 8 KB (13 bits). Each window max size is 8 KB.
    • In this example for window size of 4K, 0x1 is programmed at 0x2430 bits [25:0].
    • Address translation for bits [15:13] are programmed at 0x2420 and 0x2424.
    • In this example, address translation for bits [15:13] are set to 0x7.
Table 1. BDF Table Programming
Program Value Registers
0x0000_E000 Address translation value Low
0x0 Address translation value High
0x0 PASID/ Reserved
0x0 [11:0]: Function Number
0xC0000001

[31:30] Read/Write Access permission

[29] : R0 access Error

[28:26] Protection ID

[25:0] Window Size

([25:0]*4K = actual size of the window)

0x0 reserved

For this example Slave address 0x0000_0000_0000_0100 will be address translated to 0x0000_0000_0000_E100.

Example 2: BAR Size of 64 KB, with 1 Window 8 KB

Window 0:8 KB with address translation of 0x6 ('b110) for bits [15:13].

  1. Selections in Vivado IP configuration in the AXI BARs tab are as follows:
    • AXI BAR size 64K: 0xFFFF bits [15:0]
    • Address translation for bits [63:16] can be done in GUI. In this example [63:16] = 0x0
    • Set Aperture Base Address: 0x0000_0000_0000_0000
    • Set Aperture High Address: 0x0000_0000_0000_FFFF
  2. The BDF table programming:
    • Program 1 entries for 1 window.
    • Window Size = AXI BAR size/8 = 64K / 8 = 0x1FFF = 8 KB (13 bits). Each window max size is 8 KB.
    • In this example for window size of 8K, 0x2 is programmed at 0x2430 bits [25:0].
    • Address translation for bits [15:13] are programmed at 0x2420 and 0x2424.
    • In this example, address translation for bits [15:13] are set to 0x6 ('b110).
Table 2. BDF Table Programming
Offset Program Value Registers
0x2420 0x0000_C000 Address translation value Low
0x2424 0x0 Address translation value High
0x2428 0x0 PASID/ Reserved
0x242C 0x0 [11:0]: Function Number
0x2430 0xC0000002

[31:30] Read/Write Access permission

[29] : R0 access Error

[28:26] Protection ID

[25:0] Window Size

([25:0]*4K = actual size of the window)

0x2434 0x0 reserved

For this example, the Slave address 0x0000_0000_0000_0100 will be address translated to 0x0000_0000_0000_C100.

Example 3: BAR Size of 32 GB, and 4 Windows of Various Sizes

  • Window 0: 4 KB with address translation of 0xAAAAA for bits [31:12].
  • Window 1: 4 GB with no address translation on window.
  • Window 2: 64 KB with address translation of 0xBBBB for bits [31:16].
  • Window 3: 1 GB with address translation of 11111 for bits [34:30].
  1. Selections in Vivado IP configuration in the AXI BARs tab are as follows:
    • AXI BAR size 32G: 0x7_FFFF_FFFF bits [34:0].
    • Address translation for bits [63:35] can be programmed in GUI. In this example [63:36] = 0xAB.
    • Set Aperture Base Address: 0x0000_0AB0_0000_0000.
    • Set Aperture High Address: 0x0000_0AB7_FFFF_FFFF.
  2. The BDF table programming:
    • Window Size = AXI BAR size/8 = 32 GB / 8 = 0xFFFF_FFFF = 4 GB (32 bits). Each window max size is 4 GB.
    • Program 4 entries for 4 windows:
      • BDF entry 0 table starts at 0x2420.
      • BDF entry 1 table starts at 0x2440.
      • BDF entry 2 table starts at 0x2460.
      • BDF entry 3 table starts at 0x2480.
    • Window 0 size 4 KB.
      • Program 0x1 to 0x2430 bits [25:0].
      • Address translation for bits [34:32] are programmed at 0x2420 and 0x2424.
      • Program 0x0000_0000 to 0x2420.
      • Program 0x0000_0007 to 0x2424
    • Window 1 size 4 GB.
      • Program 0x10_0000 to 0x2450 bits [25:0].
      • No address translation because all address bits will be used by the window.
      • Program 0x0000_0000 to 0x2440.
      • Program 0x0000_0000 to 0x2444
    • Window 2 size 64 KB.
      • Program 0x10 to 0x2470 bits [25:0].
      • Address translation for bits [34:32] are programmed at 0x2460 and 0x2464.
      • Program 0x0000_0000 to 0x2460
      • Program 0x0000_00005 to 0x2464
    • Window 3 size 1 GB.
      • Program 0x4_0000 to 0x2490 bits [25:0].
      • Address translation for bits [34:30] are programmed at 0x2480 and 0x2484.
      • Program 0x0000_0000 to 0x2480.
      • Program 0x0000_0003 to 0x2484
Table 3. BDF Table Programming Entry 0
Offset Program Value Registers
0x2420 0x0000_0000 Address translation value Low
0x2424 0x7 Address translation value High
0x2428 0x0 PASID/ Reserved
0x242C 0x0 [11:0]: Function Number
0x2430 0xC0000001

[31:30] Read/Write Access permission

[29] : R0 access Error

[28:26] Protection ID

[25:0] Window Size

([25:0]*4K = actual size of the window)

0x2434 0x0 reserved
Table 4. BDF Table Programming Entry 1
Offset Program Value Registers
0x2440 0x0000 Address translation value Low
0x2444 0x0 Address translation value High
0x2448 0x0 PASID/ Reserved
0x244C 0x0 [11:0]: Function Number
0x2450 0xC010_0000

[31:30] Read/Write Access permission

[29] : R0 access Error

[28:26] Protection ID

[25:0] Window Size

([25:0]*4K = actual size of the window)

0x2454 0x0 reserved
Table 5. BDF Table Programming Entry 2
Offset Program Value Registers
0x2460 0x_0000 Address translation value Low
0x2464 0x05 Address translation value High
0x2468 0x0 PASID/ Reserved
0x246C 0x0 [11:0]: Function Number
0x2470 0xC000_00010

[31:30] Read/Write Access permission

[29] : R0 access Error

[28:26] Protection ID

[25:0] Window Size

([25:0]*4K = actual size of the window)

0x2474 0x0 reserved
Table 6. BDF Table Programming Entry 3
Offset Program Value Registers
0x2480 0x0000_0000 Address translation value Low
0x2484 0x3 Address translation value High
0x2488 0x0 PASID/ Reserved
0x248C 0x0 [11:0]: Function Number
0x2490 0xC004_0000

[31:30] Read/Write Access permission

[29] : R0 access Error

[28:26] Protection ID

[25:0] Window Size

([25:0]*4K = actual size of the window)

0x2494 0x0 reserved

For this example

the Slave address 0x0000_0000_0000_0100 will be address translated to 0x0000_0AB7_0000_0100.

the Slave address 0x0000_0001_0000_0100 will be address translated to 0x0000_0AB0_0000_0100.

the Slave address 0x0000_0002_0000_0100 will be address translated to 0x0000_0AB5_0000_0100.

the Slave address 0x0000_0003_0000_0100 will be address translated to 0x0000_0AB3_0000_0100.

The slave bridge does not support narrow burst AXI transfers. To avoid narrow burst transfers, connect the AXI smart-connect module which will convert narrow burst to full burst AXI transfers.