DE10-Advanced revC demo: PCI Express Software Stack
From Terasic Wiki
Figure 1-1 shows the software stack for the PCI Express application software on 64-bit Windows. The PCIe library module TERASIC_PCIE_AVMM.dll provides DMA and direct I/O access for user application program to communicate with FPGA. Users can develop their applications based on this DLL. The altera_pcie_win_driver.sys kernel driver is provided by Altera.
- Figure 1-1 PCI Express Software Stack
Install PCI Express Driver on Windows
The PCIe driver is locate in the folder:
"CDROM\Demonstrations\PCIe_SW_KIT\Windows\PCIe_Driver"
The folder includes the following four files:
- Altera_pcie_win_driver.cat
- Altera_pcie_win_driver.inf
- Altera_pcie_win_driver.sys
- WdfCoinstaller01011.dll
To install the PCI Express driver, please execute the steps below:
- Make sure the DE10-Advanced and the PC are both powered off.
- Plug the PCIe adapter card into the PCIe slot on the PC motherboard. Use the PCIe cable to connect to the DE10-Advanced PCIE connector and the PCIe adapter card (See Figure 1-2)
- Power on your DE10-Advanced board and the host PC
- Make sure Altera Programmer and USB-Blaster II driver are installed
- Execute test.bat in "CDROM\Demonstrations\PCIe_Fundamental\demo_batch" to configure the FPGA
- Restart windows operation system
- Click Control Panel menu from Windows Start menu. Click Hardware and Sound item before clicking the Device Manager to launch the Device Manager dialog. There will be a PCI Device item in the dialog, as shown in Figure 1-3. Move the mouse cursor to the PCI Device item and right click it to select the Update Driver Software... item.
- In the How do you want to search for driver software dialog, click Browse my computer for driver software item, as shown in Figure 1-4.
- In the Browse for driver software on your computer dialog, click the Browse button to specify the folder where altera_pcie_win_driver.inf is located, as shown in Figure 1-5. Click the Next button
- When the Windows Security dialog appears, as shown Figure 1-6, click the Install button.
- When the driver is installed successfully, the successfully dialog will appears, as shown in Figure 1-7. Click the Close button.
- 12. Once the driver is successfully installed, users can see the Altera PCI API Driver under the device manager window, as shown in Figure 1-8.
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 :
# Create a 64-bit C/C++ project.
- Include TERASIC_PCIE_AVMM.h in the C/C++ project.
- Copy TERASIC_PCIE_AVMM.dll to the folder where the project.exe is located.
- Dynamically load TERASIC_PCIE_AVMM.dll in C/C++ program. To load the dll, please refer to the PCIe fundamental example below.
- 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: