|
Packit |
534379 |
====================
|
|
Packit |
534379 |
OPAE C API Reference
|
|
Packit |
534379 |
====================
|
|
Packit |
534379 |
|
|
Packit |
534379 |
The reference documentation for the OPAE C API is grouped into the following
|
|
Packit |
534379 |
sections:
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. contents::
|
|
Packit |
534379 |
:local:
|
|
Packit |
534379 |
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Types
|
|
Packit |
534379 |
=====
|
|
Packit |
534379 |
|
|
Packit |
534379 |
The OPAE C API defines a number of types; most prominent are the types
|
|
Packit |
534379 |
`fpga_token`, `fpga_handle`, and `fpga_properties`. All regular types are
|
|
Packit |
534379 |
defined in [types.h](#types-h), while the values of enumeration types are
|
|
Packit |
534379 |
defined in [types_enum.h](#types-enum-h).
|
|
Packit |
534379 |
|
|
Packit |
534379 |
types.h
|
|
Packit |
534379 |
-------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/types.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
types_enum.h
|
|
Packit |
534379 |
------------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/types_enum.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Enumeration API
|
|
Packit |
534379 |
===============
|
|
Packit |
534379 |
|
|
Packit |
534379 |
The OPAE enumeration API allows selective discovery of FPGA resources. When
|
|
Packit |
534379 |
enumerating resources, a list of filter criteria can be passed to the
|
|
Packit |
534379 |
respective function to select a subset of all resources in the system. The
|
|
Packit |
534379 |
fpgaEnumerate() function itself then returns a list of fpga_tokens denoting
|
|
Packit |
534379 |
resources, which can be used in subsequent API calls.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Filter criteria are specified using one or more fpga_properties object. These
|
|
Packit |
534379 |
objects need to be created using fpgaGetProperties() (defined in
|
|
Packit |
534379 |
<opae/properties/h>) before being passed to fpgaEnumerate(). Individual
|
|
Packit |
534379 |
attributes of an fpga_properties object are set using specific accessors,
|
|
Packit |
534379 |
which are also defined in <opae/properties.h>.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
enum.h
|
|
Packit |
534379 |
------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/enum.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
properties.h
|
|
Packit |
534379 |
------------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/properties.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Access API
|
|
Packit |
534379 |
==========
|
|
Packit |
534379 |
|
|
Packit |
534379 |
The access API provides functions for opening and closing FPGA resources.
|
|
Packit |
534379 |
Opening a resource yields an fpga_handle, which denotes ownership and can be
|
|
Packit |
534379 |
used in subsequent API calls to interact with a specific resource. Ownership
|
|
Packit |
534379 |
can be exclusive or shared.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
access.h
|
|
Packit |
534379 |
--------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/access.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Event API
|
|
Packit |
534379 |
=========
|
|
Packit |
534379 |
|
|
Packit |
534379 |
The event API provides functions and types for handling asynchronous events
|
|
Packit |
534379 |
such as errors or accelerator interrupts.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
To natively support asynchronous event, the driver for the FPGA platform
|
|
Packit |
534379 |
needs to support events natively (in which case the OPAE C library will
|
|
Packit |
534379 |
register the event directly with the driver). For some platforms that do not
|
|
Packit |
534379 |
support interrupt-driven event delivery, you need to run the FPGA Daemon
|
|
Packit |
534379 |
(fpgad) to enable asynchronous OPAE events. fpgad will act as a proxy for the
|
|
Packit |
534379 |
application and deliver asynchronous notifications for registered events.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
event.h
|
|
Packit |
534379 |
-------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/event.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
|
|
Packit |
534379 |
MMIO and Shared Memory APIs
|
|
Packit |
534379 |
===========================
|
|
Packit |
534379 |
|
|
Packit |
534379 |
These APIs feature functions for mapping and accessing control registers
|
|
Packit |
534379 |
through memory-mapped IO (mmio.h), allocating and sharing system memory
|
|
Packit |
534379 |
buffers with an accelerator (buffer.h), and using low-latency notifications
|
|
Packit |
534379 |
(umsg.h).
|
|
Packit |
534379 |
|
|
Packit |
534379 |
mmio.h
|
|
Packit |
534379 |
------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/mmio.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
buffer.h
|
|
Packit |
534379 |
--------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/buffer.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
umsg.h
|
|
Packit |
534379 |
------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/umsg.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Management API
|
|
Packit |
534379 |
==============
|
|
Packit |
534379 |
|
|
Packit |
534379 |
The management APIs define functions for reconfiguring an FPGA (writing new
|
|
Packit |
534379 |
partial bitstreams) as well as assigning accelerators to host interfaces.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
manage.h
|
|
Packit |
534379 |
--------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/manage.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Metrics API
|
|
Packit |
534379 |
==============
|
|
Packit |
534379 |
|
|
Packit |
534379 |
The metrics APIs define functions for discovery/enumeration of metrics information
|
|
Packit |
534379 |
and reading metrics values.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
metrics.h
|
|
Packit |
534379 |
--------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/metrics.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
SysObject
|
|
Packit |
534379 |
=========
|
|
Packit |
534379 |
|
|
Packit |
534379 |
The SysObject API can be used to get system objects by name. Names used with
|
|
Packit |
534379 |
the SysObject API are driver-specific and may not be compatible across plugins
|
|
Packit |
534379 |
and/or drivers. For example, SysObject names used with the xfpga plugin will
|
|
Packit |
534379 |
apply to the OPAE Linux Kernel driver and refer to sysfs nodes under the sysfs
|
|
Packit |
534379 |
tree for the resource used with the SysObject API.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
|
|
Packit |
534379 |
sysobject.h
|
|
Packit |
534379 |
-------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/sysobject.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Utilities
|
|
Packit |
534379 |
=========
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Functions for mapping fpga_result values to meaningful error strings are
|
|
Packit |
534379 |
provided by the utilities API.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
utils.h
|
|
Packit |
534379 |
-------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: include/opae/utils.h
|
|
Packit |
534379 |
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Samples
|
|
Packit |
534379 |
=======
|
|
Packit |
534379 |
|
|
Packit |
534379 |
Code samples demonstrate how to use OPAE C API.
|
|
Packit |
534379 |
|
|
Packit |
534379 |
hello_fpga.c
|
|
Packit |
534379 |
------------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: samples/hello_fpga.c
|
|
Packit |
534379 |
|
|
Packit |
534379 |
hello_events.c
|
|
Packit |
534379 |
--------------
|
|
Packit |
534379 |
|
|
Packit |
534379 |
.. doxygenfile:: samples/hello_events.c
|
|
Packit |
534379 |
|
|
Packit |
534379 |
|