Skip to content

File types_enum.h

FileList > docs > sw > include > opae > types_enum.h

Go to the source code of this file.

Definitions of enumerated types for the OPAE C API. More...

Public Types

Type Name
enum fpga_accelerator_state
accelerator state
enum fpga_buffer_flags
Buffer flags.
enum fpga_event_type
FPGA events.
enum fpga_interface
OPAE plugin interface.
enum fpga_metric_datatype
Metrics data type.
enum fpga_metric_type
fpga metrics types opae defines power,thermal, performance counter and afu metric types
enum fpga_objtype
OPAE FPGA resources (objects)
enum fpga_open_flags
Open flags.
enum fpga_reconf_flags
Reconfiguration flags.
enum fpga_result
OPAE C API function return codes.
enum fpga_sysobject_flags
enum fpga_sysobject_type

Detailed Description

This file defines return and error codes, event and object types, states, and flags as used or reported by OPAE C API functions.

Public Types Documentation

enum fpga_accelerator_state

enum fpga_accelerator_state {
    FPGA_ACCELERATOR_ASSIGNED = 0,
    FPGA_ACCELERATOR_UNASSIGNED
};

enum fpga_buffer_flags

Buffer flags.

enum fpga_buffer_flags {
    FPGA_BUF_PREALLOCATED = (1u << 0),
    FPGA_BUF_QUIET = (1u << 1),
    FPGA_BUF_READ_ONLY = (1u << 2)
};

These flags can be passed to the fpgaPrepareBuffer() function.

enum fpga_event_type

FPGA events.

enum fpga_event_type {
    FPGA_EVENT_INTERRUPT = 0,
    FPGA_EVENT_ERROR,
    FPGA_EVENT_POWER_THERMAL
};

OPAE currently defines the following event types that applications can register for. Note that not all FPGA resources and target platforms may support all event types.

enum fpga_interface

OPAE plugin interface.

enum fpga_interface {
    FPGA_IFC_DFL = 0,
    FPGA_IFC_VFIO,
    FPGA_IFC_SIM_DFL,
    FPGA_IFC_SIM_VFIO,
    FPGA_IFC_UIO
};

These are the supported plugin interfaces.

enum fpga_metric_datatype

enum fpga_metric_datatype {
    FPGA_METRIC_DATATYPE_INT,
    FPGA_METRIC_DATATYPE_FLOAT,
    FPGA_METRIC_DATATYPE_DOUBLE,
    FPGA_METRIC_DATATYPE_BOOL,
    FPGA_METRIC_DATATYPE_UNKNOWN
};

enum fpga_metric_type

enum fpga_metric_type {
    FPGA_METRIC_TYPE_POWER,
    FPGA_METRIC_TYPE_THERMAL,
    FPGA_METRIC_TYPE_PERFORMANCE_CTR,
    FPGA_METRIC_TYPE_AFU,
    FPGA_METRIC_TYPE_UNKNOWN
};

enum fpga_objtype

OPAE FPGA resources (objects)

enum fpga_objtype {
    FPGA_DEVICE = 0,
    FPGA_ACCELERATOR
};

These are the FPGA resources currently supported by the OPAE object model.

enum fpga_open_flags

Open flags.

enum fpga_open_flags {
    FPGA_OPEN_SHARED = (1u << 0)
};

These flags can be passed to the fpgaOpen() function.

enum fpga_reconf_flags

Reconfiguration flags.

enum fpga_reconf_flags {
    FPGA_RECONF_FORCE = (1u << 0),
    FPGA_RECONF_SKIP_USRCLK = (1u << 1)
};

These flags can be passed to the fpgaReconfigureSlot() function.

enum fpga_result

OPAE C API function return codes.

enum fpga_result {
    FPGA_OK = 0,
    FPGA_INVALID_PARAM,
    FPGA_BUSY,
    FPGA_EXCEPTION,
    FPGA_NOT_FOUND,
    FPGA_NO_MEMORY,
    FPGA_NOT_SUPPORTED,
    FPGA_NO_DRIVER,
    FPGA_NO_DAEMON,
    FPGA_NO_ACCESS,
    FPGA_RECONF_ERROR
};

Every public API function exported by the OPAE C library will return one of these codes. Usually, FPGA_OK denotes successful completion of the requested operation, while any return code other than FPGA_OK indicates an error or other deviation from the expected behavior. Users of the OPAE C API should always check the return codes of the APIs they call, and not use output parameters of functions that did not execute successfully.

The fpgaErrStr() function converts error codes into printable messages.

OPAE also has a logging mechanism that allows a developer to get more information about why a particular call failed with a specific message. If enabled, any function that returns an error code different from FPGA_OK will also print out a message with further details. This mechanism can be enabled by setting the environment variable LIBOPAE_LOG to 1 before running the respective application.

enum fpga_sysobject_flags

enum fpga_sysobject_flags {
    FPGA_OBJECT_SYNC = (1u << 0),
    FPGA_OBJECT_GLOB = (1u << 1),
    FPGA_OBJECT_RAW =
        (1u << 2),
    FPGA_OBJECT_RECURSE_ONE =
        (1u
         << 3),
    FPGA_OBJECT_RECURSE_ALL =
        (1u
         << 4)
};

enum fpga_sysobject_type

enum fpga_sysobject_type {
    FPGA_OBJECT_CONTAINER =
        (1u << 0),
    FPGA_OBJECT_ATTRIBUTE =
        (1u << 1)
};

The documentation for this class was generated from the following file docs/sw/include/opae/types_enum.h