Apollo Carrier Board
User Manual
34
www.terasic.com
September 22, 2020
Create a Software Application
All the files needed to create a PCIe software application are located in the directory
CDROM\demonstration\PCIe_SW_KIT\Windows\PCIe_Library. It includes the following files:
TERASIC_PCIE_AVMM.h
TERASIC_PCIE_AVMM.DLL (64-bit DLL)
Below lists the procedures to use the SDK files in users’ C/C++ project :
1.
Create a 64-bit C/C++ project.
2.
Include TERASIC_PCIE_AVMM.h in the C/C++ project.
3.
Copy TERASIC_PCIE_AVMM.DLL to the folder where the project.exe is located.
4.
Dynamically load TERASIC_PCIE_AVMM.DLL in C/C++ program. To load the DLL, please
refer to the PCIe fundamental example below.
5.
Call the SDK API to implement the desired application.
Users can easily communicate with the FPGA through the PCIe bus through the
TERASIC_PCIE_AVMM.DLL API. The details of API are described below:
5.4
PCI Express Library API
Below shows the exported API in the TERASIC_PCIE_AVMM.DLL. The API prototype is defined in
the TERASIC_PCIE_AVMM.h.
Note: the Linux library terasic_pcie_qsys.so also use the same API and header file.
PCIE_Open
Function:
Open a specified PCIe card with vendor ID, device ID, and matched card index.
Prototype:
PCIE_HANDLE PCIE_Open(
uint8_t wVendorID,
uint8_t wDeviceID,
uint8_t wCardIndex);
Parameters:
wVendorID:
Specify the desired vendor ID. A zero value means to ignore the vendor ID.
wDeviceID:
Specify the desired device ID. A zero value means to ignore the device ID.
wCardIndex:
Specify the matched card index, a zero based index, based on the matched vendor ID and