Functions | |
| cy_en_nnlite_status_t | Cy_NNLite_Init (NNLITE_Type *nnlite, cy_nnlite_context_t *context) |
| nnlite driver init function, validate context structure and set driver to init state More... | |
| cy_en_nnlite_status_t | Cy_NNLite_DeInit (NNLITE_Type *nnlite, cy_nnlite_context_t *context) |
| nnlite driver deinit function check's for pending or ongoing operation and set driver state to deinit More... | |
| cy_en_nnlite_status_t | Cy_NNLite_Start (NNLITE_Type *nnlite, cy_nnlite_context_t *context) |
| nnlite start operation, streamer should should be configured before calling this function, this function will write to start bit in CMD MEMIO More... | |
| cy_en_nnlite_status_t | Cy_NNLite_Stop (NNLITE_Type *nnlite, cy_nnlite_context_t *context) |
| nnlite stop/abort operation, can be used to stop/abort current operation or to reset all configuration, API write abort in CMD MEMIO which will reset all the registers More... | |
| cy_en_nnlite_status_t | Cy_NNLite_ActivationStreamerCfg (NNLITE_Type *nnlite, cy_nnlite_context_t *context, uint32_t filterWidth, uint32_t filterHeight, uint32_t activationRepeats, uint32_t inputWidth, uint32_t inputHeight, uint32_t inputChannel, int16_t padVal, uint8_t padWidth, uint8_t padHeight, uint8_t strideCol, uint8_t strideRow, int32_t inputOffset) |
| nnlite activation streamer configuration set, API will configure parameters for activation streamer More... | |
| cy_en_nnlite_status_t | Cy_NNLite_WeightStreamerCfg (NNLITE_Type *nnlite, cy_nnlite_context_t *context, uint32_t weightPerNeuron, int32_t filterOffset) |
| nnlite weight streamer configuration set, API will configure offset for weight streamer and weights per neuron parameter* More... | |
| cy_en_nnlite_status_t | Cy_NNLite_OutputStreamerCfg (NNLITE_Type *nnlite, cy_nnlite_context_t *context, cy_nnlite_clipping_t clipping, int32_t outputOffset, uint32_t outputWidth, uint32_t outputHeight, uint32_t outputChannels) |
| nnlite out streamer configuration set, API will set clipping mask, offset, width, height and channel for output streamer More... | |
| cy_en_nnlite_status_t | Cy_NNLite_StreamerBaseAddrSet (NNLITE_Type *nnlite, cy_en_nnlite_streamer_id_t strmId, const void *baseAddr) |
| set nnlite streamer base address More... | |
| static cy_en_nnlite_status_t | Cy_NNLite_PipelineConfig (NNLITE_Type *nnlite, cy_en_nnlite_op_t opType, cy_en_nnlite_mode_t fetchMode, bool repeatWeights, bool biasEn, bool sparsityEn, cy_en_nnlite_output_rescaling_t outputRescaling, cy_en_nnlite_input_rescaling_t inputRescaling, cy_en_nnlite_fused_activation_t actType, cy_en_nnlite_activation_size_t inputSize, cy_en_nnlite_activation_size_t weightSize, cy_en_nnlite_output_size_t outputSize) |
| Set NNLiteV2 pipeline configuration. More... | |
| cy_en_nnlite_status_t | Cy_NNLite_SetPrePostScaling (NNLITE_Type *nnlite, float preScalingFactor, const float *postScalingFactors) |
| Set pre/post arithmetic/accumulation scaling. More... | |
| cy_en_nnlite_status_t | Cy_NNLite_SetInterpolationParam (NNLITE_Type *nnlite, uint32_t segment, float gradient) |
| set interpolation parameter More... | |
| cy_en_nnlite_status_t | Cy_NNLite_FFTCfg (NNLITE_Type *nnlite, cy_nnlite_context_t *context, void *ppBuf0, void *ppBuf1, unsigned int fftStages) |
| Configure NNLite for Q1.15 complex FFT. More... | |
| cy_en_nnlite_status_t | Cy_NNLite_SetInterruptMask (NNLITE_Type *nnlite, uint32_t intrMask) |
| nnlite set interrupt mask, available interrupt are operation STATUS Done, MEM Fetch Error different streamers, Output Saturation interrupt More... | |
| cy_en_nnlite_status_t | Cy_NNLite_DatawireTriggerEnable (NNLITE_Type *nnlite, bool trigEn) |
| nnlite set datawire trigger control, trigger datawire for next layer when trigger is 1 More... | |
| cy_en_nnlite_status_t | Cy_NNLite_GetOperationStatus (NNLITE_Type *nnlite, uint32_t *opStatus) |
| nnlite get nnlite operation status, can be used to poll operation status More... | |
| cy_en_nnlite_status_t | Cy_NNLite_GetInterruptStatus (NNLITE_Type *nnlite, uint32_t *intrStatus) |
| get nnlite interrupt status More... | |
| cy_en_nnlite_status_t | Cy_NNLite_GetInterruptMask (NNLITE_Type *nnlite, uint32_t *intrMask) |
| get nnlite interrupt mask More... | |
| cy_en_nnlite_status_t | Cy_NNLite_GetDriverState (NNLITE_Type *nnlite, cy_nnlite_context_t *context, cy_en_nnlite_state_t *nnliteState) |
| get nnlite driver state More... | |
| cy_en_nnlite_status_t | Cy_NNLite_InterruptClear (NNLITE_Type *nnlite, uint32_t intrMask) |
| clear nnlite interrupts More... | |
| void | Cy_NNLite_InterruptHandler (NNLITE_Type *nnlite, cy_nnlite_context_t *context) |
| nnlite ISR handler More... | |
| cy_en_nnlite_status_t | Cy_NNLite_WaitForCompletion (NNLITE_Type *nnlite, cy_nnlite_context_t *context) |
| wait for completion of operation in busy loop More... | |
| cy_en_nnlite_status_t Cy_NNLite_Init | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context | ||
| ) |
nnlite driver init function, validate context structure and set driver to init state
| [in] | nnlite | base pointer of NNLite Register Map. |
| [in] | context | pointer to the driver context structure. |
| Refer | cy_en_nnlite_status_t |
[in] context pointer to the driver context structure
| cy_en_nnlite_status_t Cy_NNLite_DeInit | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context | ||
| ) |
nnlite driver deinit function check's for pending or ongoing operation and set driver state to deinit
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | pointer to the driver context structure. |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[in] context pointer to the driver context structure
| cy_en_nnlite_status_t Cy_NNLite_Start | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context | ||
| ) |
nnlite start operation, streamer should should be configured before calling this function, this function will write to start bit in CMD MEMIO
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | pointer to the driver context structure. |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[in] context pointer to the driver context structure
| cy_en_nnlite_status_t Cy_NNLite_Stop | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context | ||
| ) |
nnlite stop/abort operation, can be used to stop/abort current operation or to reset all configuration, API write abort in CMD MEMIO which will reset all the registers
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | pointer to the driver context structure. |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[in] context pointer to the driver context structure
| cy_en_nnlite_status_t Cy_NNLite_ActivationStreamerCfg | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context, | ||
| uint32_t | filterWidth, | ||
| uint32_t | filterHeight, | ||
| uint32_t | activationRepeats, | ||
| uint32_t | inputWidth, | ||
| uint32_t | inputHeight, | ||
| uint32_t | inputChannel, | ||
| int16_t | padVal, | ||
| uint8_t | padWidth, | ||
| uint8_t | padHeight, | ||
| uint8_t | strideCol, | ||
| uint8_t | strideRow, | ||
| int32_t | inputOffset | ||
| ) |
nnlite activation streamer configuration set, API will configure parameters for activation streamer
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | pointer to the driver context structure |
| [in] | filterWidth | filter width |
| [in] | filterHeight | fFilter height |
| [in] | activationRepeats | activation streamer repeat count (how often each "kernel footprint" needs to be fetched) |
| [in] | inputWidth | input activation Width |
| [in] | inputHeight | input activation Height |
| [in] | inputChannel | input activation channels |
| [in] | inputChannel | channel depth multiplier (depthwise convolution only) |
| [in] | padVal | padding value |
| [in] | padHeight | padding Height |
| [in] | padWidth | padding Width |
| [in] | strideCol | Stride column |
| [in] | strideRow | Stride rows |
| [in] | inputOffset | input offset value |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[in] context pointer to the driver context structure
[in] filterWidth filter width
[in] filterHeight filter height
[in] activationRepeats activation streamer repeat count
[in] inputWidth input activation Width
[in] inputHeight input activation Height
[in] inputChannel input activation channels
[in] padVal padding value
[in] padHeight padding Height
[in] padWidth padding Width
[in] strideCol Stride column
[in] strideRow Stride rows
[in] inputOffset input offset value
| cy_en_nnlite_status_t Cy_NNLite_WeightStreamerCfg | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context, | ||
| uint32_t | weightPerNeuron, | ||
| int32_t | filterOffset | ||
| ) |
nnlite weight streamer configuration set, API will configure offset for weight streamer and weights per neuron parameter*
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | pointer to the driver context structure |
| [in] | weightPerNeuron | weight/filter elements count per neuron |
| [in] | filterOffset | weight/filter elements offset value |
| Refer | cy_en_nnlite_status_t |
nnlite weight streamer configuration set, API will configure offset for weight streamer and weights per neuron parameter*
[in] nnlite base pointer of register map.
[in] context pointer to the driver context structure
[in] weightPerNeuron wight/filter elements count per neuron
[in] filterOffset wight/filter elements offset value
| cy_en_nnlite_status_t Cy_NNLite_OutputStreamerCfg | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context, | ||
| cy_nnlite_clipping_t | clipping, | ||
| int32_t | outputOffset, | ||
| uint32_t | outputWidth, | ||
| uint32_t | outputHeight, | ||
| uint32_t | outputChannels | ||
| ) |
nnlite out streamer configuration set, API will set clipping mask, offset, width, height and channel for output streamer
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | pointer to the driver context structure |
| [in] | clipping | output clipping setting |
| [in] | outputOffset | output elements offset value |
| [in] | outputWidth | output width |
| [in] | outputHeight | output height |
| [in] | outputChannels | output Channels |
| Refer | cy_en_nnlite_status_t |
nnlite out streamer configuration set, API will set clipping mask, offset, width, height and channel for output streamer
[in] nnlite base pointer of register map.
[in] context pointer to the driver context structure
[in] clipping output clipping setting mask or max/min values
[in] outputOffset output elements offset value
[in] outputChannels output Channels
| cy_en_nnlite_status_t Cy_NNLite_StreamerBaseAddrSet | ( | NNLITE_Type * | nnlite, |
| cy_en_nnlite_streamer_id_t | strmId, | ||
| const void * | baseAddr | ||
| ) |
set nnlite streamer base address
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | strmId | streamer id |
| [in] | baseAddr | base address of buffer |
| Refer | cy_en_nnlite_status_t |
set nnlite streamer base address
[in] nnlite base pointer of register map.
[in] strmId streamer id
[in] baseAddr base address of buffer
|
inlinestatic |
Set NNLiteV2 pipeline configuration.
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | opType | ALU (Arithmetic accumulation) stage operation |
| [in] | fetchMode | Activation fetch mode (depthwise, tensorwise) |
| [in] | repeatWeights | Enable weight repetition |
| [in] | biasEn | Enable bias |
| [in] | sparsityEn | Enable packed sparse weights |
| [in] | outputRescaling | ALU stage scaling mode |
| [in] | inputRescaling | ALU prescaling mode |
| [in] | actType | Activation stage activation function |
| [in] | inputSize | Activation.rhs input bit width |
| [in] | weightSize | Weight/lhs input bit width |
| [in] | outputSize | Output bit width. |
| cy_en_nnlite_status_t Cy_NNLite_SetPrePostScaling | ( | NNLITE_Type * | nnlite, |
| float | preScalingFactor, | ||
| const float * | postScalingFactors | ||
| ) |
Set pre/post arithmetic/accumulation scaling.
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | preScalingFactor | Pre-scaling factor to input prior to arithmetic/accumulation operation |
| [in] | postScalingFactors | Post-scaling factor(s) to be applied after arithmetic/accumulation |
| Refer | cy_en_nnlite_status_t |
| cy_en_nnlite_status_t Cy_NNLite_SetInterpolationParam | ( | NNLITE_Type * | nnlite, |
| uint32_t | segment, | ||
| float | gradient | ||
| ) |
set interpolation parameter
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | segment | lookup segment table addr (0: [-inf..0], 1: [0..inf] ) |
| [in] | gradient | slope value for interpolation (IEEE 32-bit float mantissa will be rounded to 7 bits) |
| Refer | cy_en_nnlite_status_t |
set interpolation parameter
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | segment | lookup segment table addr (0: [-inf..0], 1: [0..inf] ) |
| [in] | gradient | slope value for interpolation (IEEE 32-bit float mantissa will be rounded to 7 bits) |
| Refer | cy_en_nnlite_status_t |
| cy_en_nnlite_status_t Cy_NNLite_FFTCfg | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context, | ||
| void * | ppBuf0, | ||
| void * | ppBuf1, | ||
| unsigned int | fftStages | ||
| ) |
Configure NNLite for Q1.15 complex FFT.
NNLite implements Decimation-in-Time Radix-2 FFT
| context | pointer to the driver context structure. |
| ppBuf0 | Input / ping-pong buffer 0, Output (even stages/# values) |
| ppBuf1 | ping-pong buffer 1, Output (odd stages/# values) |
| fftStages | log_2(FFT length) |
NNLite implements Decimation-in-Time Radix-2 FFT
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | pointer to the driver context structure. |
| [in] | ppBuf0 | Input / ping-pong buffer 0, Output (even stages/# values) |
| [in] | ppBuf1 | ping-pong buffer 1, Output (odd stages/# values) |
| [in] | fftStages | log_2(FFT length) |
| Refer | cy_en_nnlite_status_t |
| cy_en_nnlite_status_t Cy_NNLite_SetInterruptMask | ( | NNLITE_Type * | nnlite, |
| uint32_t | intrMask | ||
| ) |
nnlite set interrupt mask, available interrupt are operation STATUS Done, MEM Fetch Error different streamers, Output Saturation interrupt
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | intrMask | nnlite interrupt mask register |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[in] intrMask interrupt mask value
| cy_en_nnlite_status_t Cy_NNLite_DatawireTriggerEnable | ( | NNLITE_Type * | nnlite, |
| bool | trigEn | ||
| ) |
nnlite set datawire trigger control, trigger datawire for next layer when trigger is 1
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | trigEn | datawire trigger mask |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[in] trigEn datawire trigger enable
| cy_en_nnlite_status_t Cy_NNLite_GetOperationStatus | ( | NNLITE_Type * | nnlite, |
| uint32_t * | opStatus | ||
| ) |
nnlite get nnlite operation status, can be used to poll operation status
| [in] | nnlite | base pointer of NNLIte register map. |
| [out] | opStatus | nnlite last operation status |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[out] opStatus nnlite last operation status
| cy_en_nnlite_status_t Cy_NNLite_GetInterruptStatus | ( | NNLITE_Type * | nnlite, |
| uint32_t * | intrStatus | ||
| ) |
get nnlite interrupt status
| [in] | nnlite | base pointer of NNLIte register map. |
| [out] | intrStatus | nnlite interrupt status register |
| Refer | cy_en_nnlite_status_t |
get nnlite interrupt status
[in] nnlite base pointer of register map.
[out] intrStatus nnlite interrupt status register
| cy_en_nnlite_status_t Cy_NNLite_GetInterruptMask | ( | NNLITE_Type * | nnlite, |
| uint32_t * | intrMask | ||
| ) |
get nnlite interrupt mask
| [in] | nnlite | base pointer of NNLIte register map. |
| [out] | intrMask | interrupt mask value |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[out] intrMask nnlite interrupt mask
| cy_en_nnlite_status_t Cy_NNLite_GetDriverState | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context, | ||
| cy_en_nnlite_state_t * | nnliteState | ||
| ) |
get nnlite driver state
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | pointer to the driver context structure |
| [out] | nnliteState | driver current state |
| Refer | cy_en_nnlite_status_t |
| cy_en_nnlite_status_t Cy_NNLite_InterruptClear | ( | NNLITE_Type * | nnlite, |
| uint32_t | intrMask | ||
| ) |
clear nnlite interrupts
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | intrMask | nnlite interrupts to be cleared |
| Refer | cy_en_nnlite_status_t |
[in] nnlite base pointer of register map.
[in] intrMask nnlite interrupts to be cleared
| void Cy_NNLite_InterruptHandler | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context | ||
| ) |
nnlite ISR handler
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | nnlite context structure pointer |
[in] nnlite base pointer of register map.
[in] context nnlite context structure pointer
| cy_en_nnlite_status_t Cy_NNLite_WaitForCompletion | ( | NNLITE_Type * | nnlite, |
| cy_nnlite_context_t * | context | ||
| ) |
wait for completion of operation in busy loop
| [in] | nnlite | base pointer of NNLIte register map. |
| [in] | context | nnlite context structure pointer |
wait for completion of operation in busy loop
[in] nnlite base pointer of register map.
[in] context pointer to the driver context structure