User`s guide
12 Configuring Real-Time Workshop for Your Application
12-14
Embedded-C Code Format
The embedded-C code format (corresponding to the embedded real-time target)
produces code that is optimized for speed, memory usage, and simplicity. It is
intended for use in deeply embedded systems, as opposed to in the rapid
prototyping process. It uses static memory allocation and produces only two or
three entry points that you can call from the main routine:
model_initialize
model_step
model_terminate (optional)
The embedded-C code format uses a much smaller version of the SimStruct
called the real-time object. Defined in model_export.h, this data structure
contains the necessary model and timing information.
Optimizations
This section contains suggestions that will help you optimize the code
generated by the embedded-C code format. All the options are located on the
Code Generation Options dialog box that you can access by pressing the
Options button on the Real-Time Workshop page of the Simulation
Parameters
dialog box.
Each of the following actions will result in more highly optimized code:
• Deselect the
MAT-file logging check box.
• Deselect the
Initialize internal data check box.
• Deselect the
Initialize external I/O data check box.
Initializing the internal and external data is a precaution and may not be
necessary for your application. Many embedded application environments
initialize all RAM at startup. Therefore, reinitializing the memory is
redundant.
• Deselect the
Terminate function required check box if you do not require a
terminate function for your model.