Code replacement for "abs" is "mw_arm_abs_f32" instead of "fabs"
5 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2017 年 1 月 30 日
回答済み: MathWorks Support Team
2017 年 2 月 16 日
I am attempting to generate code for the ARM Cortex-M using Embedded Coder. I am using a code replacement library in order to do this but it is not working correctly because the code generation process is replacing the calls to "abs" with "mw_arm_abs_f32" instead of the expected "fabs". How can I get code to be generated using the "fabs" function?
採用された回答
MathWorks Support Team
2017 年 2 月 16 日
Code replacement during the code generation process is based on a series of constraints. If these constraints are met for a given case, the code is replaced with the specific function. You can view the code replacement table for the ARM Cortex-M using the command below:
RTW.viewTfl('ARM Cortex-M')
You will be able to see the constraints which must be met in order for each replacement to happen. As can be seen in the "In1Type" section for the "mw_arm_abs_f32" replacement, the size is a column vector of singles. Therefore, if you want to avoid this replacement being applied, you must ensure the size of the input is a 1x1 variable. If none of the replacement constraints are met, "fabs" will be used.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!