Real-Time Workshop User's Guide | ![]() ![]() |
Basic Code Generation Options
To access the basic code generation options, select the Real-Time Workshop tab of the Simulation Parameters dialog box. Then select ERT code generation options from the Category menu.
Figure 9-1 displays the basic code generation options for the Real-Time Workshop Embedded Coder.
Figure 9-1: Basic Code Generation Options
Setting the code generation options as follows will result in more highly optimized code:
Also, remove or comment out the #if MAT_FILE...
error check in your production version of ert_main.c
.
Note that disabling logging causes the program to run indefinitely, regardless of the setting of the model's stop time.
Initializing the internal and external data is a precaution and may not be necessary for your application. Many embedded application environments initialize all RAM to zero at startup. Therefore, reinitializing RAM to zero is redundant.
Note that nonzero initialization of your program's data structures is still performed when Initialize internal data and Initialize external I/O data are selected.
Also, remove or comment out the following in your production version of ert_main.c
:
#if TERMFCN...
error checkMODEL_TERMINATE
model
_step
call, which reduces overhead and allows the Real-Time Workshop to use more local variables in the step function of the model.If you do not want to combine output and update functions, make the following changes in your production version of ert_main.c
:
MODEL_STEP
with calls to model
_output
and model
_update
.#if ONESTEPFCN...
error check.![]() | Optimizing the Generated Code | Generating Code from Subsystems | ![]() |