SPRACV1B February   2022  – January 2024 AM2434 , AM6411 , AM6412 , AM6421 , AM6441 , AM6442

 

  1.   Abstract
  2.   2
  3.   Trademarks
  4. 1Introduction
  5. 2Processor Core Benchmarks
    1. 2.1 Dhrystone
    2. 2.2 Trigonometric Functions
  6. 3Compute and Memory System Benchmarks
    1. 3.1 Memory Bandwidth and Latency
      1. 3.1.1 LMBench
      2. 3.1.2 STREAM
      3. 3.1.3 Cortex-R5 Memory Access Latency
    2. 3.2 CoreMark®-Pro
    3. 3.3 Fast Fourier Transform
    4. 3.4 Cryptographic Benchmarks
  7. 4Application Benchmarks
    1. 4.1 Machine Learning Inference
    2. 4.2 Field Oriented Control (FOC) Loop
    3. 4.3 PCIE to DDR Performance Using BCDMA
      1. 4.3.1 Test Setup
      2. 4.3.2 Result and Observation
    4. 4.4 DDR to DDR Performance Using BCDMA
      1. 4.4.1 Test Setup
      2. 4.4.2 Result and Observation
  8. 5References
  9. 6Revision History

Trigonometric Functions

Trigonometric functions are compute functions leveraged in for example motor control. The most commonly used ones are sine, cosine, arctan and arctan2. The standard C library math.h has highly accurate implementations of these functions, but the worst case execution time might not be acceptable. For Arm Cortex-R5F, the Arm CMSIS DSP library also has optimized implementations for some trigonometric functions. Sitara™ software development kit MCU-PLUS-SDK_AM243X and PROCESSOR-SDK-AM64X contains the CMSIS libary (in folder <mcu-plus-install-directoty>/source/cmsis) and further optimized functions for some of the functions in a library called ti_r5fmath_trig (in folder <mcu-plus-install-directoty>/examples/motor_control/benchmark_demo/common). Table 2-1 and Table 2-2 show the performance of the most commonly used trigonometric functions using the implementations found in C runtime library (math.h), CMSIS, and ti_r5fmath_trig library. The implementations trade off accuracy, shown in column max error, and compute time and sometimes additional memory consumption (a lookup table with constants in memory) as shown in column labeled Table size. This table needs to be in TCM or warm L1D cache for the documented performance.

Table 2-1 Sine and Cosine on Arm Cortex-R5F (32-bit float)
Function Max Cycles Avg Cycles Max Error (abs rad) Table Size Library
ti_r5fmath_sin() 34 34 7.20E-07 polynomial TI_R5FMATHLIB
ti_r5fmath_cos() 38 38 2.90E-07 polynomial TI_R5FMATHLIB

ti_r5fmath

_sincos()
51 51 7.20E-07 polynomial TI_R5FMATHLIB
ti_r5fmath_fast_sincosB() 57 57 1.90E-07 polynomial TI_R5FMATHLIB
arm_cos_f32() 66 66 1.80E-05 Table 2kbytes CMSIS
sinf() 71 71 8.40E-08 polynomial math.h
cosf() 81 81 9.70E-08 polynomial math.h
arm_sin_cos_f32() 114 114 6.10E-07 Table 2kbytes CMSIS
sin() (double) 340 296 3.00E-08 polynomial math.h
Table 2-2 Arctan and Arctan2 on Arm Cortex-R5F (32-bit float)
Function Max Cycles Avg Cycles Max Error (abs rad) Table Size Library
ti_r5fmath_atanFast() 45 39 3.76E-03 function TI_R5FMATHLIB
ti_r5fmath_atan2Fast() 54 54 3.76E-03 function TI_R5FMATHLIB
ti_r5fmath_atan() 80 68 6.00E-07 poly TI_R5FMATHLIB
atanf() 111 90 6.80E-08 poly math.h
ti_r5fmath_atan2() 97 90 6.00E-07 poly TI_R5FMATHLIB
atan2f() 204 171 2.00E-07 poly math.h