Bfm memory map, Configuration space bus and device numbering, Configuration of root port and endpoint – Altera IP Compiler for PCI Express User Manual

Page 260

Advertising
background image

15–28

Chapter 15: Testbench and Design Example

Root Port BFM

IP Compiler for PCI Express User Guide

August 2014

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

Figure 15–7 on page 15–31

Figure 15–9 on page 15–33

.

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 part of altpcietb_bfm_configure.

1

Configuration procedures and functions are in the VHDL package file
altpcietb_bfm_configure.vhd

or in the Verilog HDL include file

altpcietb_bfm_configure.v

that uses the altpcietb_bfm_configure_common.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.

Advertising