Changing autocoded function calls in Matlab 2008A & Realtime workshop

1 visualizzazione (ultimi 30 giorni)
I am using simulink and real time workshop to generate code for a MCP5554 processor. In the simulink model, I am using the default ABS block with single precision values.
When I generate the code, it uses fabs() functions for those blocks.
I'm using Greenhills OS and the multi compiler to generate the final image. There are several options for the ABS function in the ANSI/math.h file: double fabs __ARGS((double));
In my debugger, I can see the CPU is converting my single precision input to a double, getting the abs value, then converting the double back to single.
In the same ANSI/math.h file, I see another function: float fabsf __ARGS((float)); If I manually search the autocoded c file for fabs and relplace it with fabsf. It compiles and executes fine and reduces my cpu utilization by 5%.
Is there a way to force the autocoder to call the fabsf function instead of fabs?

Risposte (0)

Categorie

Scopri di più su Code Generation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by