16–22
Chapter 16: Testbench and Design Example
Root Port BFM
Arria V GZ Hard IP for PCI Express
November 2012
Altera Corporation
BFM Memory Map
The BFM shared memory is configured to be two MBytes. The BFM shared memory is
mapped into the first two MBytes of I/O space and also the first two MBytes of
memory space. When the Endpoint application generates an I/O or memory
transaction in this range, the BFM reads or writes the shared memory. For illustrations
of the shared memory and I/O address spaces, refer to
.
Configuration Space Bus and Device Numbering
The Root Port interface is assigned to be device number 0 on internal bus number 0.
The Endpoint can be assigned to be any device number on any bus number (greater
than 0) through the call to procedure
ebfm_cfg_rp_ep
. The specified bus number is
assigned to be the secondary bus in the Root Port Configuration Space.
Configuration of Root Port and Endpoint
Before you issue transactions to the Endpoint, you must configure the Root Port and
Endpoint Configuration Space registers. To configure these registers, call the
procedure
ebfm_cfg_rp_ep
, which is included in
altpcietb_bfm_driver_rp.v
.
The
ebfm_cfg_rp_ep
executes the following steps to initialize the Configuration
Space:
1. Sets the Root Port Configuration Space to enable the Root Port to send transactions
on the PCI Express link.
2. Sets the Root Port and Endpoint PCI Express Capability Device Control registers
as follows:
a. Disables
Error
Reporting
in both the Root Port and Endpoint. BFM does not
have error handling capability.
b. Enables
Relaxed
Ordering
in both Root Port and Endpoint.
c. Enables
Extended
Tags
for the Endpoint, if the Endpoint has that capability.
d. Disables
Phantom
Functions
,
Aux
Power
PM
, and
No
Snoop
in both the Root Port
and Endpoint.
e. Sets the
Max
Payload
Size
to what the Endpoint supports because the Root Port
supports the maximum payload size.
f. Sets the Root Port
Max
Read
Request
Size
to 4 KBytes because the example
Endpoint design supports breaking the read into as many completions as
necessary.
g. Sets the Endpoint
Max
Read
Request
Size
equal to the
Max Payload
Size
because the Root Port does not support breaking the read request into multiple
completions.