Conditions for Code Replacement of Simulink Blocks with QHL
R2026bEach Simulink® block that can be used with the Embedded Coder® Support Package for Qualcomm® Hexagon® Processors requires specific conditions to allow code replacement by using the Qualcomm Hexagon library (QHL). You use this code replacement library to generate C/C++ code from a Simulink model or from MATLAB® code.
When you satisfy the specified conditions, the generated C/C++ code uses QHL support to achieve optimized execution on Qualcomm Hexagon processors.
Basic Math Operations
QHL supports these Simulink math blocks for floating-point data type only when you configure the required properties, as specified in this table.
| Function | Input Requirements | Parameter Requirements | Equivalent Functions |
|---|---|---|---|
| Addition (+) |
|
|
|
| Subtraction (-) |
|
|
|
| Element-wise matrix multiplication |
|
|
|
| Multiplication - scaling |
|
|
|
| Dot product |
|
|
|
| Absolute |
| Input length must be > 11 |
|
| Square-root |
| - |
|
| Reciprocal square-root |
| - |
|
| Natural logarithm |
| - |
|
| Base 2 logarithm |
| - |
|
| Common logarithm (base 10) |
| - |
|
| Exponential |
| - |
|
| Power |
| - |
|
| Minimum |
| Input length must be > 22 |
|
| Maximum |
| Input length must be > 22 |
|
QHL supports these Simulink math blocks for fixed-point Q15 data type only when you configure the required properties, as specified in this table.
| Function | Input Requirements | Input DataType | Parameter Requirements | Equivalent Functions |
|---|---|---|---|---|
| Addition (+) |
|
|
|
|
| Subtraction (-) |
|
|
|
|
| Element-wise matrix multiplication |
|
|
|
|
| Multiplication - Scaling |
|
|
|
|
| Dot product |
|
|
|
|
| Absolute |
|
| - |
|
| Square root |
|
| - |
|
| Maximum |
|
| Input length must be > 22 |
|
| Minimum |
|
| Input length must be > 22 |
|
| Dot product |
|
|
|
|
Trigonometric Operations
QHL supports these Simulink trigonometric blocks for floating-point data type only when you configure the required properties, as specified in this table.
| Function | Input Requirements | Parameter Requirements | Equivalent Functions |
|---|---|---|---|
sin |
| - |
|
cos |
| - |
|
tan |
| - |
|
asin |
| - |
|
acos |
| - |
|
atan |
| - |
|
sinh |
| - |
|
cosh |
| - |
|
tanh |
| - |
|
| Hypotenuse |
| - |
|