Xapp 1022
Xapp 1022
Summary This application note discusses using the provided Memory Endpoint Test (MET)
demonstration driver to exercise the Programmed Input/Output (PIO) design that is delivered
with all Xilinx solutions for PCI Express®. Instructions for installing this driver on a typical
Windows XP operating system are provided, along with how to access the I/O and memory
space of the design.
Important Notice
The MET driver is provided as is with no implied warranty or support. This driver is not
guaranteed to work on all systems. While there are no known issues with using the driver
application, no technical support will be provided for problems that might arise. Source code for
the MET driver is not available.
Overview Xilinx offers cores for PCI Express to be used in endpoint applications. The appropriate core
choice is based on the target device and design requirements. Table 1 shows a summary of the
cores and supported devices.
More information about the current versions of these cores is available in the product data
sheets located in the Xilinx online Documentation Center. The specific product pages are linked
by the Core Name column in Table 1. Visit the Xilinx solutions for PCI Express page for more
information about the cores for PCI Express.
The cores for PCI Express are delivered by the Xilinx CORE Generator™ software. This
software allows users to customize various parameters of the core such as Device and Vendor
ID, BAR requirements, and power management settings. Detailed instructions for generating
the core using the CORE Generator software can be found in the Getting Started Guide or User
Guide for the core. This document is delivered with the core, but can also be downloaded from
the Xilinx online Documentation Center.
© 2007-2009 Xilinx, Inc. XILINX, the Xilinx logo, Virtex, Spartan, ISE, and other designated brands included herein are trademarks of Xilinx in the United States and other
countries. All other trademarks are the property of their respective owners. PCI, PCI-SIG, PCI EXPRESS, PCIE, PCI-X, PCI HOT PLUG, MINI PCI, EXPRESSMODULE, and the
PCI, PCI-X, PCI HOT PLUG, and MINI PC design marks are trademarks, registered trademarks, and/or service marks of PCI-SIG.
Note: If the Virtex-5 Block Plus Wrapper for PCI Express is selected, the panel to select the class code
will be first followed by the panel to customize the BARs.
X-Ref Target - Figure 1
8. Change the Sub-Class code to 80 to indicate an “Other Memory Controller” to the system.
An example is shown in Figure 2.
X-Ref Target - Figure 2
9. Accept the default settings for all other fields. Click Finish.
Restart. Note that sometimes re-programming the FPGA after the OS has started can
cause the system to hang.
2. Select Install from a list or specific location (Advanced) and click Next.
This is because the driver is being provided as a ZIP file instead of on a CD.
X-Ref Target - Figure 4
3. Select Don't search, I will choose the driver to install and click Next.
X-Ref Target - Figure 5
5. Browse to the location of the driver (Figure 7). The driver is provided as a ZIP file with this
document. Unzip it to any location on the machine and browse to the filename
“xlinx_pcie_block.inf.” Select this file, click Open, and then click OK.
X-Ref Target - Figure 7
6. After clicking OK to choose the “.inf” file, click Next to install the driver (Figure 8).
X-Ref Target - Figure 8
8. After successful installation, you are instructed to reboot. Click Finish to exit the Wizard.
X-Ref Target - Figure 10
9. After the reboot, the device will appear in the Device Manager under “System Devices”
(Figure 11).
X-Ref Target - Figure 11
The ScriptFile and TestSpec file options are mutually exclusive, meaning only one can be used
at a time. However, a test specification can be combined with the scripting method by calling it
through the interactive test specification command. Following are usage examples:
• C:\>MET
Runs the MET application in interactive mode.
• C:\>MET --log log1.txt
Runs the MET application in interactive mode and logs the results.
• C:\>MET --log log1.txt --script my_script.txt
Runs the MET application with script file inputs and logs the results.
• C:\>MET --log log1.txt memtest.ini
Runs the MET with the test file specified and logs the results.
Table 4 shows the supported commands that can be used to access the memory space of the
PIO design. Commands are not case-sensitive. Only the first 255 characters are parsed.
Table 4: MET Application Commands
Syntax Description Example
Access { C | I | M} Changes the current space to Config, A M
I/O, or Memory, respectively. Only
Change to Memory Space
memory space accesses are currently
supported.
Width {B | W | D} Changes width to byte, word (16-bit), W D
or doubleword (32-bit), respectively.
Change width to 32-bit
Radix {O | D | H} Changes radix to octal, decimal, or RD
hex, respectively.
change radix to decimal
Location <Offset> Changes the current address offset to L 0x40
that given. By default, offset is parsed
Change offset to 40 (hex)
per current radix, but “C” notation is
regardless of current radix
also accepted.
Dump <Count> Dumps data, starting at the current D 40
address offset, for the given number of
Dump 40 (current radix) bytes
bytes and updates the current address
offset.
Next Advances the dump; i.e., dumps the N
same number of bytes as given in the
Assuming above, dump 40
last dump command.
bytes
Set <Datum> [… Writes the given data starting at the S A5 88 F00F
<Datum>] current address offset. Data is parsed
Assuming 16-bit and hex, write
assuming the current radix and bit-
the 3 words at the current
width. Shortcuts are provided, which
offset.
override the current bit-width: sb for
byte, sw for word, sd for doubleword. SD AAAA5555
Write the 32-bit datum
Config Performs an annotated dump of the C
PCI and PCI Express config space.
Analyze config space
Test <TestSpecFile> Runs the test suite from the given file T memtest.ini
(only once, vs. the continuous mode).
Run the test suite in
memtest.ini
Exit Exits the program. E
Example 2:
1. Dump 0x40 bytes of memory space (d 40).
2. Change the address offset back to the beginning (l 0x0).
3. Write one DWord at address offset 0x00000000 (s 12345678).
4. Change the address offset to 0x28 (l 0x28).
5. Write one DWord at address offset 0x00000028 (s 12345678).
6. Change the address offset back to the beginning (l 0x0).
7. Display what was written (d 40).
X-Ref Target - Figure 14
[Suite]
Count=200 ; how many times to repeat this test before moving to next one
; the starting data pattern is rotated at each
; iteration, so a different set
; of data is used each iteration
Delay=10;optional microsecond delay between iterations of this test
;(iteration means the 200 iterations here since
; Count=200)
ReadWidth=4 ; optional
; read using double-word (32-bit) accesses
;(default=byte)
[Test4]
…
MET GUI
Included in xapp1022.zip is a GUI application that will write and read packets to the endpoint
application and note any errors that occurred. This application is located in a sub-directory of
the ZIP file called MET_GUI. To launch the GUI shown in Figure 15, double-click the
MET_GUI.bat file.
X-Ref Target - Figure 15
Using the MET All Linux software was built and tested on Fedora core 10. It is likely to work on different
Driver for Linux variations of Linux, but none have been tested. The driver source and application are provided
as is with no implied support or warranty. Xilinx appreciates any feedback regarding problems
and solutions found with different versions of Linux and will try to incorporate these in future
updates. To provide feedback, open a webcase and include details about:
• Linux distribution
• Version
• Description of the problem
• Work around, if found
Installation of the driver requires root privileges. To install the driver and run the test, go to the
directory containing the driver files and type the following commands:
1. make
The expected output is shown in Figure 16.
X-Ref Target - Figure 16
2. ./make_device
The expected output is highlighted in Figure 17.
X-Ref Target - Figure 17
3. insmod xpcie.ko
There is no noticeable output after running insmod. Note that without root privileges
insmod will fail to load the driver.
4. ./met
This runs the application and expected output is shown in Figure 18.
X-Ref Target - Figure 18
Debugging Problems
If problems are encountered, use the following commands to determine what is happening.
1. Verify the card is recognized by the system by using lspci. At the prompt type:
lspci
Look for the output highlighted in Figure 19.
X-Ref Target - Figure 19
To see more details of the device and verify the BAR is set type:
lspci -d 10EE:0007 -v -x
2. Type dmesg to see the kernel message output. If a problem occurs while trying to load the
driver, this command may provide helpful messages.
3. Use the lsmod command to verify the device is loaded on the system. You should see an
output similar to Figure 21.
X-Ref Target - Figure 21
Bitstreams Included in xapp1022.zip are bitstreams for the Virtex-6 ML605, Spartan-6 SP605, and
Virtex-5 ML555 development boards that will support the MET driver application. These
bitstreams are located in a subdirectory of the ZIP file called bitstreams.
Conclusion The MET driver and application provide a simple interface to read and write to the PIO example
design included with Xilinx Endpoint solutions for PCI Express. Instructions for installing and
exercising the driver on a Windows XP operating system are provided in this document.
Revision The following table shows the revision history for this document.
History Date Version Revision
09/19/07 1.0 Initial Xilinx release.
11/20/09 2.0 Added support for Virtex-6 and Spartan-6 FPGA Endpoint cores.
Notice of Xilinx is providing this product documentation, hereinafter "Information," to you "AS IS" with no warranty of
any kind, express or implied. Xilinx makes no representation that the Information, or any particular
Disclaimer implementation thereof, is free from any claims of infringement. You are responsible for obtaining any
rights you may require for any implementation based on the Information. All specifications are subject to
change without notice. XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH
RESPECT TO THE ADEQUACY OF THE INFORMATION OR ANY IMPLEMENTATION BASED
THEREON, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR REPRESENTATIONS THAT
THIS IMPLEMENTATION IS FREE FROM CLAIMS OF INFRINGEMENT AND ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Except as
stated herein, none of the Information may be copied, reproduced, distributed, republished, downloaded,
displayed, posted, or transmitted in any form or by any means including, but not limited to, electronic,
mechanical, photocopying, recording, or otherwise, without the prior written consent of Xilinx.