PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Enumerations
Enumerated types
PDL API Reference » NNLITE HW Accelerator (NNLITE)

## General Description

## Enumerations
enum | cy_en_nnlite_status_t { CY_NNLITE_SUCCESS = 0U , CY_NNLITE_OP_QUEUED = 1U , CY_NNLITE_MEM_READ_ERR = (CY_NNLITE_ID | CY_PDL_STATUS_ERROR | 0x11) , CY_NNLITE_MEM_WRITE_ERR = (CY_NNLITE_ID | CY_PDL_STATUS_ERROR | 0x12) , CY_NNLITE_SATURATION_EVENT = (CY_NNLITE_ID | CY_PDL_STATUS_ERROR | 0x13) , CY_NNLITE_BAD_PARAM = (CY_NNLITE_ID | CY_PDL_STATUS_ERROR | 0x41U) , CY_NNLITE_BAD_STATE = (CY_NNLITE_ID | CY_PDL_STATUS_ERROR | 0x42U) , CY_NNLITE_EXTERN_API_ERR = (CY_NNLITE_ID | CY_PDL_STATUS_ERROR | 0x43U) }
| NNLite pdl status codes. More...
enum | cy_en_nnlite_fused_activation_t { CY_NNLITE_ACTIVATION_NONE = 0U , CY_NNLITE_ACTIVATION_SIGMOID = 1U , CY_NNLITE_ACTIVATION_TANH = 2U , CY_NNLITE_ACTIVATION_PWL = 3U , CY_NNLITE_ACTIVATION_RECIP_POW2 = 4U , CY_NNLITE_ACTIVATION_RECIPROCAL = 5U }
| Out Activation type, includes some implement via PDL. More...
enum | cy_en_nnlite_activation_size_t { CY_NNLITE_ACTIVATION_8BIT = 0U , CY_NNLITE_ACTIVATION_16BIT = 1U }
| Activation size. More...
enum | cy_en_nnlite_output_size_t { CY_NNLITE_OUTPUT_8BIT = 0U , CY_NNLITE_OUTPUT_16BIT = 1U , CY_NNLITE_OUTPUT_32BIT = 2U }
| Output size. More...
enum | cy_en_nnlite_input_rescaling_t { CY_NNLITE_RESCALE_NONE = 0U , CY_NNLITE_RESCALE_WGT = 1U , CY_NNLITE_RESCALE_ACT = 2U }
| Input re-scaling mode. More...
enum | cy_en_nnlite_output_rescaling_t { CY_NNLITE_OUTSCALE_NONE = 0U , CY_NNLITE_OUTSCALE_PER_TENSOR = 1U , CY_NNLITE_OUTSCALE_PER_AXIS = 2 , CY_NNLITE_OUTSCALE_PER_ROW = 3 }
| Output re-scaling mode. More...
enum | cy_en_nnlite_op_t { CY_NNLITE_NOOP_ACT = 0U , CY_NNLITE_MUL = 1U , CY_NNLITE_ADD = 2U , CY_NNLITE_SUB_LR = 3U , CY_NNLITE_SUB_RL = 4U , CY_NNLITE_SUM_ACT = 5U , CY_NNLITE_MIN_ACT = 6U , CY_NNLITE_MAX_ACT = 7U , CY_NNLITE_SUM_ACT32 = 8U }
| NNLite nn operation type. More...
enum | cy_en_nnlite_mode_t { CY_NNLITE_DWACT_WGT = 0U , CY_NNLITE_ACT_WGT = 1U , CY_NNLITE_DWACT_ONLY = 2U , CY_NNLITE_ACT_ONLY = 3U }
| NNLite nn operating mode type. More...
enum | cy_en_nnlite_prefetch_length_t { CY_NNLITE_PREFETCH_WORD_1x128 = 0U , CY_NNLITE_PREFETCH_WORD_2x128 = 1U , CY_NNLITE_PREFETCH_WORD_3x128 = 2U , CY_NNLITE_PREFETCH_WORD_4x128 = 3U }
| NNLite length of weight prefetch. More...
enum | cy_en_nnlite_streamer_id_t { CY_NNLITE_ACTIVATION_STREAMER = 0U , CY_NNLITE_WEIGHT_STREAMER = 1U , CY_NNLITE_BIAS_STREAMER = 2U , CY_NNLITE_OUT_STREAMER = 3U , CY_NNLITE_SCALE_STREAMER = 4U , CY_NNLITE_WEIGHT_COUNT_STREAMER = 5U , CY_NNLITE_SPARSITY_MAP_STREAMER = 6U }
| Streamer id's. More...
enum | cy_en_nnlite_state_t { CY_NNLITE_DEINIT = 0U , CY_NNLITE_INIT = 1U , CY_NNLITE_CONFIG_STATE = 2U , CY_NNLITE_OP_STARTED = 3U , CY_NNLITE_OP_DONE = 4U }
| NNLite PDL Driver State Machine. More...

## Enumeration Type Documentation

## ◆ cy_en_nnlite_status_t

enum cy_en_nnlite_status_t

NNLite pdl status codes.

Enumerator
CY_NNLITE_SUCCESS | Status successful
CY_NNLITE_MEM_READ_ERR | Operation is Pending state. Mem read Error Bus error response for a value read. I.e. and invalid address for for a nn-zero weight count, sparsity map, bias, scale-factor, weights or activation fetch
CY_NNLITE_MEM_WRITE_ERR | Mem write error Bus error response for a value write - output is only writer at present.
CY_NNLITE_SATURATION_EVENT | Arithmetic saturation events. Arithmetic saturation was detected during processing of the operation. Note Saturation does not halt operation process - this continues to completion or an error event. Currently saturation event interrupts are masked and hence ignored by the PDL. However their presence can be detected in the `cy_nnlite_context_t` structure `opIntrStatus` structure.
CY_NNLITE_BAD_PARAM | function call with invalid parameter
CY_NNLITE_BAD_STATE | Invalid state, order.
CY_NNLITE_EXTERN_API_ERR | Error code for system (RTOS) level API failure.

## ◆ cy_en_nnlite_fused_activation_t

enum cy_en_nnlite_fused_activation_t

Out Activation type, includes some implement via PDL.

Note
  For ReLU use clipping mask with ACTIVATION_NONE For Leaky ReLU use ACTIVATION_PWL together with interpolation params

Enumerator
CY_NNLITE_ACTIVATION_NONE | No function applied - Only re-scaling.
CY_NNLITE_ACTIVATION_SIGMOID | Sigmoid: sigma(2x) - Q1.25 result from Q8.16 / Q8.8 input.
CY_NNLITE_ACTIVATION_TANH | Tanh: tanh(x) - Q1.24 from Q8.8 / Q16.8 input.
CY_NNLITE_ACTIVATION_PWL | No function applied - Output re-scaling left / right 0 differently (used for leaky RELU)
CY_NNLITE_ACTIVATION_RECIP_POW2 | 2^-x - positive Q31 from non-negative Q3.8 / Q3.16 input (saturating)
CY_NNLITE_ACTIVATION_RECIPROCAL | 1/x - 32-bit IEEE754 float from positive Qx.31 input

## ◆ cy_en_nnlite_activation_size_t

enum cy_en_nnlite_activation_size_t

Activation size.

Enumerator
CY_NNLITE_ACTIVATION_8BIT | 8 bits Activation
CY_NNLITE_ACTIVATION_16BIT | 16 bits Activation

## ◆ cy_en_nnlite_output_size_t

enum cy_en_nnlite_output_size_t

Output size.

Enumerator
CY_NNLITE_OUTPUT_8BIT | 8 bit Output words
CY_NNLITE_OUTPUT_16BIT | 16 bits Output words
CY_NNLITE_OUTPUT_32BIT | 32 bits Output words

## ◆ cy_en_nnlite_input_rescaling_t

enum cy_en_nnlite_input_rescaling_t

Input re-scaling mode.

Enumerator
CY_NNLITE_RESCALE_NONE | No re-scaling.
CY_NNLITE_RESCALE_WGT | Rescale Weights.
CY_NNLITE_RESCALE_ACT | Rescale Activations.

## ◆ cy_en_nnlite_output_rescaling_t

enum cy_en_nnlite_output_rescaling_t

Output re-scaling mode.

Enumerator
CY_NNLITE_OUTSCALE_NONE | No re-scaling (hard-wired 1.0 scale factor)
CY_NNLITE_OUTSCALE_PER_TENSOR | Per-tensor re-scaling
CY_NNLITE_OUTSCALE_PER_AXIS | Per-filter re-scaling
CY_NNLITE_OUTSCALE_PER_ROW | Per output row re-scaling

## ◆ cy_en_nnlite_op_t

enum cy_en_nnlite_op_t

NNLite nn operation type.

Enumerator
CY_NNLITE_NOOP_ACT | Pass-through act stream (inputs left shifted 16)
CY_NNLITE_MUL | NN Convolution Layer, pointwise mul.
CY_NNLITE_ADD | NN Pointwise addition (inputs left shifted 16)
CY_NNLITE_SUB_LR | NN Pointwise subtraction activation/rhs - weights/lhs (inputs left shifted 16)
CY_NNLITE_SUB_RL | NN Pointwise subtraction weights/lhs - activation/rhs (left shifted 16)
CY_NNLITE_MIN_ACT | NN Summation act stream.
CY_NNLITE_MAX_ACT | Max of act stream.
CY_NNLITE_SUM_ACT32 | Max of act stream.

## ◆ cy_en_nnlite_mode_t

enum cy_en_nnlite_mode_t

NNLite nn operating mode type.

Enumerator
CY_NNLITE_DWACT_WGT | "Depthwise"-striped channel activation + weights
CY_NNLITE_ACT_WGT | Channel-minor activation + weights.
CY_NNLITE_DWACT_ONLY | "Depthwise"-striped channel activation only
CY_NNLITE_ACT_ONLY | Channel-minor activation only.

## ◆ cy_en_nnlite_prefetch_length_t

enum cy_en_nnlite_prefetch_length_t

NNLite length of weight prefetch.

Enumerator
CY_NNLITE_PREFETCH_WORD_1x128 | prefetch 1x128 weights
CY_NNLITE_PREFETCH_WORD_2x128 | prefetch 2x128 weights
CY_NNLITE_PREFETCH_WORD_3x128 | prefetch 3x128 weights
CY_NNLITE_PREFETCH_WORD_4x128 | prefetch 4x128 weights, default value

## ◆ cy_en_nnlite_streamer_id_t

enum cy_en_nnlite_streamer_id_t

Streamer id's.

Enumerator
CY_NNLITE_ACTIVATION_STREAMER | Activation Streamer ID.
CY_NNLITE_WEIGHT_STREAMER | Weight Streamer ID.
CY_NNLITE_BIAS_STREAMER | Bias Streamer ID.
CY_NNLITE_OUT_STREAMER | Output Streamer ID.
CY_NNLITE_SCALE_STREAMER | Scale-factors (per-axis/per-row)
CY_NNLITE_WEIGHT_COUNT_STREAMER | Non-zero weight count for sparse weights.
CY_NNLITE_SPARSITY_MAP_STREAMER | Sparsity map for sparse weights.

## ◆ cy_en_nnlite_state_t

enum cy_en_nnlite_state_t

NNLite PDL Driver State Machine.

Enumerator
CY_NNLITE_DEINIT | Deinitialized State.
CY_NNLITE_INIT | Init State.
CY_NNLITE_CONFIG_STATE | Configuration State.
CY_NNLITE_OP_STARTED | NN layer Operation Started.
CY_NNLITE_OP_DONE | Last NN operation completed.