DE10-Advanced revC demo: PCI Express Software Stack

From Terasic Wiki

Jump to: navigation, search

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.

DE10-Advanced revC PCIE pic 2.jpg

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:
  1. Make sure the DE10-Advanced and the PC are both powered off.
  2. 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)
    DE10-Advanced revC PCIE pic 3.jpg
    Figure 1-2 FPGA board connect to PC
  3. Power on your DE10-Advanced board and the host PC
  4. Make sure Altera Programmer and USB-Blaster II driver are installed
  5. Execute test.bat in "CDROM\Demonstrations\PCIe_Fundamental\demo_batch" to configure the FPGA
  6. Restart windows operation system
  7. 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.
    DE10-Advanced revC PCIE pic 4.png
    Figure 1-3 Screenshot of launching Update Driver Software… dialog
  8. 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.
    DE10-Advanced revC PCIE pic 5.png
    Figure 1-4 Dialog of Browse my computer for driver software
  9. 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
    DE10-Advanced revC PCIE pic 6.png
    Figure 1-5 Browse for driver software on your computer
  10. When the Windows Security dialog appears, as shown Figure 1-6, click the Install button.
    DE10-Advanced revC PCIE pic 7.png
    Figure 1-6 Click Install in the dialog of Windows Security
  11. When the driver is installed successfully, the successfully dialog will appears, as shown in Figure 1-7. Click the Close button.
    DE10-Advanced revC PCIE pic 8.png
    Figure 1-7 Click Close when the installation of Altera PCI API Driver is complete
  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.
    DE10-Advanced revC PCIE pic 9.jpg
    Figure 1-8 Altera PCI API Driver in Device Manager

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:


Back

Personal tools