OPAE Intel FPGA Linux Device Driver Architecture Guide

ID 683857
Date 10/02/2017
Public
Document Table of Contents

1.1.7. Application FPGA Device Enumeration

This section introduces how applications enumerate the FPGA device from the sysfs hierarchy under /sys/class/fpga.

In the example below, two Intel® FPGA devices are installed in the host. Each FPGA device has one FME and two Ports (AFUs).

For each FPGA device, a device directory is created under /sys/class/fpga:
/sys/class/fpga/intel-fpga-dev.0 
/sys/class/fpga/intel-fpga-dev.1
Each node has one FME and two Ports (AFUs) as child devices:
/sys/class/fpga/intel-fpga-dev.0/intel-fpga-fme.0 
/sys/class/fpga/intel-fpga-dev.0/intel-fpga-port.0 
/sys/class/fpga/intel-fpga-dev.0/intel-fpga-port.1 

/sys/class/fpga/intel-fpga-dev.1/intel-fpga-fme.1 
/sys/class/fpga/intel-fpga-dev.1/intel-fpga-port.2 
/sys/class/fpga/intel-fpga-dev.1/intel-fpga-port.3
In general, the FME/Port sysfs interfaces are named as follows:
/sys/class/fpga/intel-fpga-dev.i/intel-fpga-fme.j/ 
/sys/class/fpga/intel-fpga-dev.i/intel-fpga-port.k/

with i consecutively numbering all the container devices, j consecutively numbering the FME’s and k consecutively numbering all Ports.

The device nodes used for ioctl() and mmap() can be referenced through:
/dev/intel-fpga-fme.j 
/dev/intel-fpga-port.k