Real-Time Workshop    

Optimizing the Model for Code Generation


You can optimize memory usage and performance of code generated from your model by Real-Time Workshop a number of ways. Here we discuss optimization techniques that are common to all target configurations and code formats. For optimizations specific to a particular target configuration, see the chapter relevant to that target. Topics covered here include the following:
General Modeling Techniques
Optimizations that you can use with any target configuration
Expression Folding
A default optimization that significantly reduces the need to compute and store temporary results
Conditional Branch Execution
A default optimization for executing inputs to switch blocks only as often as required
Block Diagram Performance Tuning
How to efficiently use look-up tables, accumulator constructs, and data types
Stateflow Optimizations
Ways to optimize models containing Stateflow blocks
Simulation Parameters
Options on the Simulation Parameters dialog box that affect code optimization
Compiler Options
Hints for helping your compiler build more efficient executables



  Multitasking Execution General Modeling Techniques