Intel® FPGA SDK for OpenCL™: Stratix® V Network Reference Platform Porting Guide

ID 683645
Date 11/06/2017
Public
Document Table of Contents

3.1.5. PCIe Kernel Driver

A PCIe® kernel driver is necessary for the OpenCL™ runtime library to access your board design via a PCIe bus.

The Stratix® V Network Reference Platform PCIe kernel driver is in the following directory:

  • For Windows systems, the driver is in the <path_to_s5_net>\windows64\driver folder
  • For Linux systems, the driver is in the <path_to_s5_net>/linux64/driver directory

Use the Intel® FPGA SDK for OpenCL™ install utility to install the kernel driver. Refer to aocl install for more information.

For Windows systems, the WinDriver API kernel driver is a third-party driver from Jungo Connectivity Ltd. For more information about the WinDriver, refer to the Jungo Connectivity Ltd. website or contact a Jungo Connectivity representative.

For Linux systems, an open-source, MMD-compatible kernel driver is available with s5_net.

Table 6.  Highlight of Files Available in the Linux Kernel Driver Directory
File Name Description
pcie_linux_driver_exports.h Header file defining the special commands that the kernel driver supports. It defines the interface of the kernel driver. The MMD layer uses this header file to communicate with the device.

After you install the kernel driver, it works as a character device. The basic operations to the driver are open(), close(), read(), and write(). To support more complex commands, an acl_cmd struct variable is necessary to pass the command of interest to the kernel driver through the read() or write() operation.

To execute a command, perform the following tasks:

  1. Create a variable as type acl_cmd_struct.
  2. Specify the command you want to execute with the appropriate parameters.
  3. Send the command through a read() or write() operation.
aclpci.c File that implements the basic structures and functions that a Linux kernel driver requires (for example, the init and remove functions, probe function, and functions that handle interrupts).
aclpci_fileio.c

File that implements the file I/O operations of the kernel driver. The s5_net Linux kernel driver supports four file I/O operations, namely open(), close(), read() and write(). Implementation of these file I/O operations allows the user application to access the kernel driver via file I/O system calls (open/read/write/close).

aclpci_cmd.c File that implements the special commands defined in the pcie_linux_driver_exports.h file. Examples of these special commands include SAVE_PCI_CONTROL_REGS, LOAD_PCI_CONTROL_REGS, DO_CVP, and GET_PCI_SLOT_INFO.
aclpci_dma.c File that implements DMA-related routine in the kernel driver.

Refer to SG-DMA for more information.

aclpci_cvp.c File that implements CvP-related routine in the kernel driver.

Refer to CvP for more information.

aclpci_queue.c File that implements a queue structure for use in the kernel driver. Such a queue structure eases programming.