CPU Usage on the 112-pin Module

From MotoHawk
Jump to navigationJump to search

Double vs Single Precision

The use of Double Precision Floating point can be very resource intensive and should only be used where absolutely required.

Customers using the 112 have seen improvements in CPU loading when switching from double precision floating point to single precision floating point on this module. By default, Simulink will force the use of doubles. You can specify the datatype in the Target Definition block to be single, but this will not enforce single on all blocks. Double should be used only if absolutely needed. The model has to be reviewed and changed so that each block parameter sets the datatype according to the design application – what makes sense for the calculations and results. The datatypes for signals can be seen in the build directory under YourModelName.h file, or display on Model in Format, Port Signal Displays.

Saturate Option on Datatype Conversion Blocks

The Simulink Datatype conversion block contains a 'Saturate' checkbox option. Checking this box causes the value to saturate to its max/min value on overflow, while leaving the box unchecked casts the datatype to try to accommodate the overflow. We have seen reduction in CPU use when the 'Saturate' option is checked.

ANSI vs ISO C Code Generation Option

CPU use may also be improved on the 55xx modules by using the ERT option for ISO C rather than ANSI C.