Altera PCI Compiler User Manual
Page 112

3–38
User Guide Version 11.1
Altera Corporation
PCI Compiler
October 2011
Configuration Registers
shows the format of memory BARs.
In addition to the type of space reserved by the BAR, the wizard allows
you to define the size of address space reserved for each individual BAR
and sets the BARn parameter value accordingly. The value for parameter
BARn defines the number of read/write bits instantiated in the
corresponding BAR (Refer to Section 6.2.5 of the PCI Local Bus
Specification, Revision 3.0). The number of read/write bits instantiated in a
BAR is indicated by the number of 1s in the corresponding BARn value
starting from bit 31. The BARn parameter should contain 1s from bit 31
down to the required bit without any 0s in between (e.g., 0xFF000000 is
legal, but 0xFF700000 is not). The wizard does not offer options that set
the BARn parameters to illegal values.
For high-end systems that require more than 4 GBytes of memory space,
the pci_mt64 and pci_t64 functions support 64-bit addressing. These
functions offer the option to use either BARs 1 and 0 or BARs 2 and 1 to
implement a 64-bit BAR.
When implementing a 64-bit BAR, the least significant BAR contains the
lower 32-bit BAR and the most significant BAR contains the upper 32-bit
BAR. When implementing a 64-bit BAR, the wizard allows the option of
which BARs to use and sets the BARn parameters accordingly. On the
least significant BAR, bits [31..4] are read/write registers that are used
to indicate the size of the memory, along with the most significant BAR.
For the most significant BAR, the wizard allows you to choose the
maximum number of read/write registers to implement per the
application.
Table 3–23. Memory BAR Format
Data
Bit
Mnemonic
Read/Write
Definition
0
mem_ind
Read
Memory indicator. The
mem_ind
bit indicates that the register maps into
memory address space. This bit must be set to 0 in the BARn parameter.
2..1
mem_type
Read
Memory type. The
mem_type
bits indicate the type of memory that can
be implemented in the function’s memory address space. Only the
following two possible values are valid for the PCI MegaCore functions:
locate memory space in the 32-bit address space and locate memory
space in the 64-bit address space.
3
pre_fetch
Read
Memory prefetchable. The
pre_fetch
bit indicates whether the blocks
of memory are prefetchable by the host bridge.
31..4
bar
Read/write
Base address registers.