Accelerator Functional Unit Developer’s Guide for Intel® FPGA Programmable Acceleration Card

ID 683129
Date 7/20/2020
Public
Document Table of Contents

6.1.5.3.1. Accessing the AFU in Shared Mode

When using OPAE application/test code running on the debug target host to stimulate the AFU for the purposes of in-system debug, both the mmlink tool and your host application/test code must have simultaneous access to the AFU. For this to happen, any user space code calls to the fpgaOpen() OPAE API function must pass the FPGA_OPEN_SHARED flag. The Acceleration Stack installation uses the FPGA_OPEN_SHARED flag with calls to fpgaOpen() in the source code for the mmlink tool and the hello_fpga sample application, which enables remote debug as delivered in the installation for the nlb_mode_0_stp example AFU stimulated by the hello_fpga sample application without modification.

Here is an example call to fpgaOpen() for shared access to the AFU:
fpgaOpen(afc_token, &afc_handle, FPGA_OPEN_SHARED);
Refer to the following sources in the Acceleration Stack installation for examples of using the FPGA_OPEN_SHARED flag:
$OPAE_PLATFORM_ROOT/sw/<opae-version>/tools/extra/mmlink/main.cpp
$OPAE_PLATFORM_ROOT/sw/<opae-version>/samples/hello_fpga.c

Any other sample applications included in the Acceleration Stack installation or host code of your own design must use the shared flag when used to stimulate the AFU during in-system remote debug where mmlink is required to run simultaneously.