Skip to Main Content Skip to Search
Product Documentation

Generated Code with Memory Sections

Sample ERT-Based Model with Subsystem

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 AssignmentSection NameField NameField Value
Input/OutputMemSect1Prepragma#pragma IO_begin
Postpragma#pragma IO-end
Internal dataMemSect2Prepragma#pragma InData-begin(%<identifier>)
Postpragma#pragma InData-end
ParametersMemSect3Prepragma#pragma Parameters-begin
Postpragma#pragma Parameters-end
Initialize/
Terminate
MemSect4Prepragma#pragma InitTerminate-begin
Postpragma#pragma InitTerminate-end
Execution functionsMemSect5Prepragma#pragma ExecFunc-begin(%<identifier>)
Postpragma#pragma ExecFunc-begin(%<identifier>)

Subsystem-Level Memory Section Assignments and Definitions

Section AssignmentSection NameField NameField Value
Execution functionsMemSect6Prepragma#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.

  


Related Products & Applications

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