Main Content

Supported CMSIS Library Functions for ARM Cortex-A Processors

The Embedded Coder® Support Package for ARM® Cortex®-A Processors provides a code replacement library (CRL) ARM Cortex-A CMSIS to generate calls to CMSIS-DSP library optimized for ARM Cortex-A processors.

For more information on CMSIS-DSP library, see https://github.com/ARM-software/CMSIS-DSP.

To improve the simulation speed of your models and performance of the generated code, you can set the model configuration parameters under the Code Generation>Optimization category. For more information on how to set the model parameters, see Model Configuration Parameters: Code Generation Optimization.

Note

  • ARM Cortex-A CMSIS CRL supports both 32 bit and 64 bit ARM Cortex-A architectures.

  • Only 64 bit ARM Cortex-A architectures support the half data type.

  • If you encounter situations where the ARM Cortex-A CMSIS CRL does not provide code replacements due to the input vector length being below the threshold, you can enable CMSIS function generation for all input lengths. To do this, set the environment variable DISABLE_ARMCORTEXA_CMSIS_CRL_THRESHOLDS to true using the following command:

    setenv('DISABLE_ARMCORTEXA_CMSIS_CRL_THRESHOLDS',true)

Basic Math Operations

OperationCMSIS FunctionSupported Data TypesInput SpecificationsReplaced MATLAB® Function, Operator, or Simulink® Block
Elementwise real addition
  • arm_add_f64

  • arm_add_f32

  • arm_add_f16

  • arm_add_q31

  • arm_add_q15

  • arm_add_q7

  • single

  • double

  • half

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Vector

  • Matrix

Note

To get the code replacement for elementwise real addition, both inputs must be of the same datatype.

plus
Real vector offset
  • arm_offset_f32

  • arm_offset_q31

  • arm_offset_q15

  • arm_offset_q7

Elementwise real subtraction
  • arm_sub_f64

  • arm_sub_f32

  • arm_sub_f16

  • arm_sub_q31

  • arm_sub_q15

  • arm_sub_q7

  • single

  • double

  • half

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Vector

  • Matrix

Note

To get the code replacement for elementwise real subtraction, both inputs must be of the same datatype.

minus
Elementwise real multiplication
  • arm_mult_f64

  • arm_mult_f32

  • arm_mult_f16

  • arm_mult_q31

  • arm_mult_q15

  • arm_mult_q7

  • single

  • double

  • half

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Vector

  • Matrix

Note

To get the code replacement for elementwise real multiplication and real vector scale:

  • Ensure that inputs with floating-point data types, such as double, single, or half, are of the same type.

  • For fixed point inputs, both the inputs must be of equal word length.

  • When using the fixdt(true,32,*) data type , the fraction length of the output must be equal to 31 less than the sum of fraction length of the two inputs.

  • When using the fixdt(true,16,*)data type , the fraction length of the output must be equal to 15 less than the sum of fraction length of the two inputs.

  • When using the fixdt(true,8,*) data type , the fraction length of the output must be equal to 7 less than the sum of fraction length of the two inputs.

Real vector scale
  • arm_scale_f32

  • arm_scale_q31

  • arm_scale_q15

  • arm_scale_q7

Gain
Real absolute
  • arm_abs_f64

  • arm_abs_f32

  • arm_abs_f16

  • arm_abs_q31

  • arm_abs_q15

  • arm_abs_q7

  • single

  • double

  • half

  • fixdt(true,32,31)

  • fixdt(true,16,15)

  • fixdt(true,8,7)

  • Vector

  • Matrix

abs
Real dot product
  • arm_dot_prod_f64

  • arm_dot_prod_f32

  • arm_dot_prod_q31

  • arm_dot_prod_q15

  • arm_dot_prod_q7

  • single

  • double

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • fixdt(true,8,*)

  • Vector

  • Real inputs

  • Both inputs must have same fraction length

Note

Fixed point real dot product:

  • For inputs of type, fixdt(true,32,L1) and fixdt(true,32,L2), the output will be of type fixdt(true,64,L1+L2-14)

  • For inputs of type, fixdt(true,16,L1) and fixdt(true,16,L2), the output can be of type fixdt(true,64,L1+L2), fixdt(true,32,L1+L2-6), or fixdt(true,16,L1+L2-18).

dot
Vector log real
  • arm_vlog_f64

  • arm_vlog_f32

  • single

  • double

  • Scalar

  • Vector

  • Matrix

log
Vector exponential real
  • arm_vexp_f64

  • arm_vexp_f32

  • arm_vexp_f16

  • single

  • double

  • half

  • Scalar

  • Vector

  • Matrix

exp
Real vector offset
  • arm_offset_f32

  • arm_offset_q31

  • arm_offset_q15

  • arm_offset_q7

  • single

  • fixdt(true,32,31)

  • fixdt(true,16,15)

  • fixdt(true,8,7)

  • Vector

  • Matrix

  • Real inputs

  • Fraction length of input and output must be equal

Bias
Saturate
  • arm_offset_f32

  • arm_offset_q31

  • arm_offset_q15

  • arm_offset_q7

  • single

  • fixdt(true,32,31)

  • fixdt(true,16,15)

  • fixdt(true,8,7)

  • Vector

  • Matrix

  • Real inputs

  • For fixed point data type, the lower limit and higher limit must match

Saturation

Complex Math Operations

OperationCMSIS FunctionSupported Data TypesInput SpecificationsReplaced MATLAB Function, Operator, or Simulink Block
Complex dot product
  • arm_cmplx_dot_prod_f32

  • arm_cmplx_dot_prod_f16

  • arm_cmplx_dot_prod_q31

  • arm_cmplx_dot_prod_q15

  • single

  • Vector and matrix

  • Complex inputs

Dot Product
Complex-by-complex multiplication
  • arm_cmplx_mult_cmplx_f64

  • arm_cmplx_mult_cmplx_f32

  • arm_cmplx_mult_cmplx_f16

  • arm_cmplx_mult_cmplx_q31

  • arm_cmplx_mult_cmplx_q15

  • single

  • double

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • Vector and matrix

  • Both inputs must be complex

Product, Matrix Multiply
Complex-by-real multiplication
  • arm_cmplx_mult_real_f32

  • arm_cmplx_mult_real_f16

  • arm_cmplx_mult_real_q31

  • arm_cmplx_mult_real_q15

  • arm_real_mult_cmplx_f32

  • arm_real_mult_cmplx_f16

  • arm_real_mult_cmplx_q31

  • arm_real_mult_cmplx_q15

  • single

  • fixdt(true,32,*)

  • fixdt(true,16,*)

  • Vector and matrix

  • Real and complex inputs

  • One input must be real and the other input must be complex

Product, Matrix Multiply

Matrix Operations

OperationFunction NameSupported Data TypesInput SpecificationsReplaced MATLAB Function, Operator, or Simulink Block
Matrix-by-vector multiplicationneon_mv_mul_u8x16uint8
  • Vector and matrix

  • Number of rows and columns of first input must be a multiple of 16 to get code replacement.

  • Number of rows of second input must be a multiple of 16 to get code replacement.

Product, Matrix Multiply
neon_mv_mul_u16x8uint16
  • Vector and matrix

  • Number of rows and columns of first input must be a multiple of 8 to get code replacement.

  • Number of rows of second input must be a multiple of 8 to get code replacement.

neon_mv_mul_u32x4uint32
  • Vector and matrix

  • Number of rows and columns of first input must be a multiple of 4 to get code replacement.

  • Number of rows of second input must be a multiple of 4 to get code replacement.

Matrix-by-matrix multiplicationneon_mm_mul_u16x8uint16
  • Matrix

  • Number of rows and columns of first and second input must be a multiple of 8 to get code replacement.

neon_mm_mul_u32x4uint32
  • Matrix

  • Number of rows and columns of first and second input must be a multiple of 4 to get code replacement.