Altera PCI Compiler User Manual
Page 265

Altera Corporation
User Guide Version 11.1
6–15
October 2011
Parameter Settings
The PCI-Avalon address translation circuit requires that you supply the
PCI-Avalon bridge with the Avalon-MM base address value that
corresponds to the PCI base address value. The PCI-Avalon address
translation circuit replaces the most significant bits of the PCI address
(the read/write bits of the PCI BAR) and replaces them with the
corresponding most significant bits of the Avalon-MM base address.
shows a pictorial view of the process, assuming a 1 MByte PCI
BAR size.
Figure 6–3. Pictorial View of the PCI-to-Avalon Address Translation Circuit
A simplified way to determine the size and Avalon-MM base address is
shown in the following procedure (
1.
Record the base and end addresses of each Avalon-MM peripheral
you want to address with one BAR. List the addresses vertically
with the lowest base address in the bottom and the highest end
address on the top.
2.
Starting from the most significant bit (bit 31), count the number of
bits (W) that remain constant for all the addresses you wrote. If the
number of bits is W, the size of the BAR is 2
32-W
.
3.
The corresponding base value is the smallest base address for the
Avalon-MM peripherals.
Because you can only address a 32-bit space on the Avalon-MM side, the
size calculation is the same for both the 32-bit BAR and 64-bit BAR.
0xFE612345
PCI Base Address Register
Avalon Base Address
0xFE6
PCI Base
0x12345
0 . . . 0
31
19
20
3 0
0
AV BASE
X X X X X . . . X
31
19
20
0
0x00A
do not care
PCI-Avalon
Address
Translation
Circuit
Avalon
Address
PCI
Address
0x00A12345
0x0
4