| Contents | Index |
| On this page… |
|---|
The next figure shows an ERT-based Simulink model that defines one subsystem, and the contents of that subsystem.

Assume that the subsystem is atomic. On the Code Generation tab, the Function packaging parameter is Reusable function. Memory sections have been created and assigned as shown in the next two tables, and all data memory sections specify Pragma surrounds to be Each variable.
Model-Level Memory Section Assignments and Definitions
| Section Assignment | Section Name | Field Name | Field Value |
|---|---|---|---|
| Input/Output | MemSect1 | Prepragma | #pragma IO_begin |
| Postpragma | #pragma IO-end | ||
| Internal data | MemSect2 | Prepragma | #pragma InData-begin(%<identifier>) |
| Postpragma | #pragma InData-end | ||
| Parameters | MemSect3 | Prepragma | #pragma Parameters-begin |
| Postpragma | #pragma Parameters-end | ||
| Initialize/ Terminate | MemSect4 | Prepragma | #pragma InitTerminate-begin |
| Postpragma | #pragma InitTerminate-end | ||
| Execution functions | MemSect5 | Prepragma | #pragma ExecFunc-begin(%<identifier>) |
| Postpragma | #pragma ExecFunc-begin(%<identifier>) |
Subsystem-Level Memory Section Assignments and Definitions
| Section Assignment | Section Name | Field Name | Field Value |
|---|---|---|---|
| Execution functions | MemSect6 | Prepragma | #pragma DATA_SEC(%<identifier>, "FAST_RAM") |
| Postpragma |
Given the preceding specifications and definitions, the code generator would create the following code, with minor variations depending on the current version of the Target Language Compiler.
![]() | Apply Memory Sections | Model-Level Data Structures | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |