beautypg.com

Bfm configuration procedures, Ebfm_cfg_rp_ep procedure, Bfm configuration procedures –34 – Altera Arria V Hard IP for PCI Express User Manual

Page 256: Ebfm_cfg_rp_ep procedure –34, Ons, see

background image

17–34

Chapter 17: Testbench and Design Example

BFM Procedures and Functions

Arria V Hard IP for PCI Express

December 2013

Altera Corporation

User Guide

BFM Configuration Procedures

The following procedures are available in altpcietb_bfm_driver_rp.v. These
procedures support configuration of the Root Port and Endpoint Configuration Space
registers.

All Verilog HDL arguments are type

integer

and are input-only unless specified

otherwise.

ebfm_cfg_rp_ep Procedure

The

ebfm_cfg_rp_ep

procedure configures the Root Port and Endpoint Configuration

Space registers for operation. Refer to

Table 17–28

for a description the arguments for

this procedure.

Table 17–28. ebfm_cfg_rp_ep Procedure

Location

altpcietb_bfm_driver_rp.v

Syntax

ebfm_cfg_rp_ep(bar_table, ep_bus_num, ep_dev_num, rp_max_rd_req_size,

display_ep_config, addr_map_4GB_limit)

Arguments

bar_table

Address of the Endpoint

bar_table

structure in BFM shared memory. This

routine populates the

bar_table

structure. The

bar_table

structure stores

the size of each BAR and the address values assigned to each BAR. The address
of the

bar_table

structure is passed to all subsequent read and write

procedure calls that access an offset from a particular BAR.

ep_bus_num

PCI Express bus number of the target device. This number can be any value
greater than 0. The Root Port uses this as its secondary bus number.

ep_dev_num

PCI Express device number of the target device. This number can be any value.
The Endpoint is automatically assigned this value when it receives its first
configuration transaction.

rp_max_rd_req_size

Maximum read request size in bytes for reads issued by the Root Port. This
parameter must be set to the maximum value supported by the Endpoint
Application Layer. If the Application Layer only supports reads of the

MAXIMUM_PAYLOAD_SIZE

, then this can be set to 0 and the read request size

will be set to the maximum payload size. Valid values for this argument are 0,
128, 256, 512, 1,024, 2,048 and 4,096.

display_ep_config

When set to 1 many of the Endpoint Configuration Space registers are displayed
after they have been initialized, causing some additional reads of registers that
are not normally accessed during the configuration process such as the Device
ID and Vendor ID.

addr_map_4GB_limit

When set to 1 the address map of the simulation system will be limited to 4
GBytes. Any 64-bit BARs will be assigned below the 4 GByte limit.