Intel® FPGA SDK for OpenCL™: Intel® Stratix® 10 GX FPGA Development Kit Reference Platform Porting Guide

ID 683809
Date 3/28/2022
Public
Document Table of Contents

2.1.4.2. PCIe Kernel Driver

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

This driver is installed using the Intel® FPGA SDK for OpenCL™ install utility.

The s10_ref Reference Platform

  • For Windows systems, the driver is in the <path_to_sl0_ref>\windows64\driver folder.

  • For Linux, an open-source MMD-compatible kernel driver is in the <path_to_sl0_ref>/linux64/driver directory. The table below highlights some of the files that are available in this directory.
Table 8.  Highlights of the Intel® Stratix® 10 GX FPGA Development Kit Reference Platform's Linux PCIe Kernel Driver Directory
File Description
pcie_linux_driver_exports.h Header file that defines the special commands that the kernel driver supports.

The installed kernel driver works as a character device. The basic operations to the driver are open(), close(), read(), and write().

To execute a complicated command, create a variable as an acl_cmd struct type, specify the command with the proper parameters, and then send the command through a read() or write() operation. This header file defines the interface of the kernel driver, which the MMD layer uses to communicate with the device.

aclpci.c File that implements the Linux kernel driver's basic structures and functions, such as the init, remove, and probe functions, as well as hardware design-specific functions that handle interrupts.

For more information about the interrupt handler, refer to the Message Signaled Interrupts section.

aclpci fileio.c File that implements the kernel driver's file I/O operations.

The kernel driver that is available with the s10_ref Reference Platform supports four file I/O operations: open(), close(), read(), and write(). Implementing these file I/O operations allows the OpenCL* user program to access the kernel driver through the file I/O system calls (that is, open, read, write, or close).

aclpci cmd.c File that implements the specific commands defined in the pcie_linux_driver_exports.h file.

These special commands include SAVE_PCI_CONTROL_REGS, LOAD_PCI_CONTROL_REGS, and GET_PCI_SLOT_INFO.

aclpci dma.c File that implements DMA-related routines in the kernel driver.

Refer to the Direct Memory Access section for more information.

aclpci queue.c File that implements a queue structure for use in the kernel driver to simplify programming.