Code replacement for "abs" is "mw_arm_abs_f32" instead of "fabs"

4 vues (au cours des 30 derniers jours)
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?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 16 Fév 2017
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.

Plus de réponses (0)

Tags

Aucun tag saisi pour le moment.

Produits


Version

R2015b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by