FpgaManager 2.15.0
Software API Documentation
Loading...
Searching...
No Matches
FPGA Manager Software API

Overview

General

The FPGA manager allows communication with an FPGA over different interfaces including Ethernet, USB and others. The idea of this product is to supply all the functionality for data transfers between a host PC and an FPGA to be used in different applications.
Basically FPGA manager supports memory mapped accesses and streaming transfers. Transfer options include bursting/non-bursing access, access to continuous addresses or accessing the same DWORD address multiple times for memory mapped accesses. Both, streaming transfers and memory mapped accesses, can be exuted blocking or non-blocking. For the latter case a transfer object can be used to observe the progress of the transfer and call callback functions on completion.

Terminology

Term Description
Device / Target An FPGA connected to the host PC via a link.
Link Connectivity between FPGA and host PC (e.g. USB, Ethernet).
Slave The target endpoint of the FPGA Manager, usually the FPGA.
Master The controlling endpoint of the FPGA Manager, this is the FPGA Manager Software Library running on the host PC.
Stream FPGA Manager supports up to 16 independent streams between host PC and FPGA.
Each stream can be uni- or bi-directional.
Memory Mapped Access Memory mapped access is realized via a special protocol sent over a normal stream.
Upstream Data flow from FPGA to host PC, slave to master.
Downstream Data flow from host PC to FPGA, master to slave.

Installation

To run FPGA Manager you have to perform the follwing installation steps.

Windows

Supported Windows Versions:

  • Windows 11
  • Windows 10 Installation procedure:
  • Get your Visual Studio 2022 (2019, 2017 or 2015) or Visual Studio Code ready.
  • Make sure you have the latest .NET runtime installed.
  • Add the appropriate NuGet Packages to your project.

Linux

Supported Linux Distributions:

  • Ubuntu 24.04 LTE
  • Ubuntu 22.04 LTE
  • Ubuntu 20.04 LTE
  • Ubuntu 18.04 LTE Installation procedure:
  • The following packages are required to build the examples :
    • build-essential
    • g++-multilib
    • cmake
  • Add the appropriate NuGet Packages to your .NET project.

API

Classes

The API concept is the same for .NET and C++, there is a main API object that is instantiated for each link that the application wants to communicate with. The main API then can be used to create the required streams and memory mapping. With single Open() call the connection to all those streams is established. Connection is closed and resources free'd when the main API object is disposed / destructed.

Main API and interfaces in .NET

Main API and interfaces in C++

NuGet Packages

For Windows or .NET cross-platform development, FPGA Manager API is shipped in NuGet packages for easy integration into software projects.

Nuget Package Language Purpose
Enclustra.FPGAManager.DotNet .NET Main FPGA Manager .NET assembly for all modern .NET projects.
Enclustra.FPGAManager.ApiDotNet .NET .NET Wrapper to FPGA Manager base API
For legacy .NET projects that cannot reference the main .NET assembly
Contains common types that are used by the main assembly,
Enclustra.FPGAManager.ApiCpp C++ C++ Wrapper to FPGA Manager base API
The runtime linkage has to be configured in the FPGA Manager NuGet project settings and must match that of the project.
Requires the addition of the native assets package.
Enclustra.FPGAManager.AnsiC C Headers and linkage to the base API
Requires the addition of the native assets package.
Enclustra.FPGAManager.NativeAssets.Windows All Base API and referenced binaries
  • FPGA Manager base library for C/C++ projects
  • FTDI D2XX library for all windows workloads using the USB2 link
Enclustra.FPGAManager.SwTarget .NET Framework to build FPGA Manger device emulators in software.

Deployment

Overview

FpgaManager.dll is the loader DLL wich is required for all non .NET languages. The loader DLL provides the native entry points for the base C API plus it contains the loader for the .NET runtime, required by the FPGA Manager core DLLs. In addition to the loader DLL, a runtime-config JSON is required to properly initialize the .NET runtime. The loader DLL is operating system and architecture dependent. The same Core DLLs can be deployed on all supported operating systems and architectures.

Windows

Windows ANSI-C C++ .NET
FpgaManager.dll Yes Yes No
FpgaManagerDotNet.dll Yes Yes Yes
FpgaManagerNextGen.dll Yes Yes Yes
FpgaManagerNextGen.runtimeconfig.json Yes Yes No

Linux

Linux ANSI-C C++ .NET
FpgaManager.so Yes Yes No
FpgaManagerCppApi.so No Yes No
FpgaManagerDotNet.dll Yes Yes Yes
FpgaManagerNextGen.dll Yes Yes Yes
FpgaManagerNextGen.runtimeconfig.json Yes Yes No

AOT

On both Windows and Linux, you can choose to utilize the AOT dynamic library. This brings the following features and restrictions:

  • It replaces all dotnet assemblies, runtimeconfig and loader dll.
  • A .NET runtime does not need to be installed
  • Quick cold start time (it is already compiled into native code)
  • It is the only way to use this library with older .NET applications (e.g. .NET Framework)
  • No x86 support on Linux
  • Reduced precision of the trace logs
  • .NET runtime baked in, no ad-hoc security fixes and improvements

Native Assets on Windows

The NuGet packages for C/C++ application development might require additional configuration. For both C and C++ you must choose if the .NET based library or AOT is used.

For C++, it is required to configure the runtime linkage, it must match the project setting.

.NET projects can utilize the NativeAssets NuGet package to include native binaries in the build. The binary artifact deployment can be controlled by project properties.

Property Value Purpose
ShouldIncludeFpgaManagerNativeFtdi False FTDI D2XX library is not included
True FTDI D2XX library is published
ShouldIncludeFpgaManagerNativeAot False FPGA Manager AOT base library is not included
True FPGA Manager AOT base library is published
FpgaManagerNativeFtdiArchitecture Auto Architecture is determined from the selected runtime
x64 Force x64 architecture
x84 Force x86 architecture
All Publish x64 and x86 libraries
FpgaManagerNativeAotArchitecture Auto Architecture is determined from the selected runtime
x64 Force x64 architecture
x84 Force x86 architecture