Configuration setting | Effect | Recommended Values |
Signal storage reuse(Enable local block outputs, Reuse local block outputs, Reuse global block outputs, Optimize global data access) | Decrease RAM and ROM usage | Change Optimize global data access to „Minimize global data access“ |
| Conserves RAM consumption and increases code execution speed | Set Pass reusable subsystem outputs as to Individual arguments |
| Improves control flow, reduces code size and RAM consumption, increases execution speed | |
| Conserves RAM and ROM usage, improves code execution speed | |
| RAM efficient code for models containing referenced models | |
| Accelerates model initialization, reduces ROM consumption, increases execution speed of generated code | Set the Code interface packaging parameter to Reusable function and select the Use dynamic memory allocation for model initialization |
| Improves execution speed and reduces ROM consumption | Select the Remove Disable Function and Remove Reset Function parameters |
| Reduces ROM and RAM consumption, improves execution speed. | Set Default parameter behavior to Inlined |
| Reduces the amount of memory that stores state configuration variables OR reduces the amount of memory that stores Boolean variables. | |
| Reduces RAM consumption. Can increase code size and execution time | |
| | |
| Might improve ROM efficiency | Try setting to Bitwise operator |
| | |
Modeling approach | Effect | Recommended value |
| Reduce global RAM for a nonreusable subsystem | Generate a function interface that passes data through arguments instead of global variables |
| Reduces RAM and ROM consumption, imrpves execution speed | Explicitly set data types for all block parameters (gains, constants, ...) |
| Minimize global data access trades global RAM/ROM for stack usage; limited stack can force globals, while allowing more stack enables more local reuse and lower global memory | |
| Reduce stack size by reducing the number of parameters in the parameter list of a generated function | Graphical function in Stateflow chart: set Function Inline Option to Inline |
| Reduces ROM and RAM consumption | Specify reusable storage class for Simulink.Signals |
| Reduces ROM usage by avoiding duplicate-generated code for identical subsystem instances across models. Can also reduce RAM usage by preventing duplicated data structures, depending on the function interface and model structure. | Configure library subsystems for reuse and generate code to shared utilities |
| | Configure subsystems as atomic and set Function packaging to Reusable function or Auto to enable function reuse |