Bfm procedures and functions, Bfm read and write procedures, Ebfm_barwr procedure – Altera Arria V Hard IP for PCI Express User Manual
Page 250: Bfm procedures and functions –28, Bfm read and write procedures –28, Ebfm_barwr procedure –28
17–28
Chapter 17: Testbench and Design Example
BFM Procedures and Functions
Arria V Hard IP for PCI Express
December 2013
Altera Corporation
User Guide
■
ebfm_barrd_nowt
—reads data from an offset of a specific Endpoint BAR and stores
it in the BFM shared memory. This procedure returns as soon as the request has
been passed to the VC interface module for transmission, allowing subsequent
reads to be issued in the interim.
These routines take as parameters a BAR number to access the memory space and the
BFM shared memory address of the
bar_table
data structure that was set up by the
ebfm_cfg_rp_ep
procedure. (Refer to
“Configuration of Root Port and Endpoint” on
.) Using these parameters simplifies the BFM test driver routines that
access an offset from a specific BAR and eliminates calculating the addresses assigned
to the specified BAR.
The Root Port BFM does not support accesses to Endpoint I/O space BARs.
For further details on these procedure calls, refer to the section
BFM Procedures and Functions
This section describes the interface to all of the BFM procedures, functions, and tasks
that the BFM driver uses to drive Endpoint application testing.
1
The last subsection describes procedures that are specific to the chaining DMA design
example.
BFM Read and Write Procedures
This section describes the procedures used to read and write data among BFM shared
memory, Endpoint BARs, and specified configuration registers.
The following procedures and functions are available in the Verilog HDL include file
altpcietb_bfm_driver.v
. These procedures and functions support issuing memory and
configuration transactions on the PCI Express link.
ebfm_barwr Procedure
The
ebfm_barwr
procedure writes a block of data from BFM shared memory to an
offset from the specified Endpoint BAR. The length can be longer than the configured
MAXIMUM_PAYLOAD_SIZE
; the procedure breaks the request up into multiple
transactions as needed. This routine returns as soon as the last transaction has been
accepted by the VC interface module.
Table 17–20. ebfm_barwr Procedure (Part 1 of 2)
Location
altpcietb_bfm_rdwr.v
Syntax
ebfm_barwr(bar_table, bar_num, pcie_offset, lcladdr, byte_len, tclass)
Arguments
bar_table
Address of the Endpoint
bar_table
structure in BFM shared memory. The
bar_table
structure stores the address assigned to each BAR so that the driver code does not need
to be aware of the actual assigned addresses only the Application Layer specific offsets
from the BAR.
bar_num
Number of the BAR used with
pcie_offset
to determine PCI Express address.
pcie_offset
Address offset from the BAR base.
lcladdr
BFM shared memory address of the data to be written.