| Real-Time Workshop® Embedded Coder™ | ![]() |
| On this page… |
|---|
Editing Memory Section Properties Specifying the Memory Section Name Specifying a Qualifier for Custom Storage Class Data Definitions Specifying Comment and Pragma Text |
After you have satisfied the requirements in Requirements for Defining Memory Sections, you can define memory sections and specify their properties. To create new memory sections or specify memory section properties,
Choose View > Model Explorer in the model window.
The Model Explorer appears.
Choose Tools > Custom Storage Class Designer in the Model Explorer window.
A notification box appears that states Please Wait ... Finding Packages. After a brief pause, the notification box closes and the Custom Storage Class Designer appears.
Click the Memory Section tab of the Custom Storage Class Designer. The Memory Section pane looks like this:

The rest of this section describes the use of the Memory section subpane on the lower left. For descriptions of the other subpanes, instructions for validating memory section definitions, and other information, see Editing Memory Section Definitions.
To specify the name of a memory section, use the Name field. A memory section name must be a legal MATLAB identifier.
To specify a qualifier for custom storage class data definitions in a memory section, enter the components of the qualifier below the Name field.
To specify const, check Is const.
To specify volatile, check Is volatile.
To specify anything else (e.g., static), enter the text in the Qualifier field.
The qualifier will appear in generated code with its components in the same left-to-right order in which their definitions appear in the dialog box. A preview appears in the Pseudocode preview subpane on the lower right.
Note Specifying a qualifier affects only custom storage class data definitions. The code generator omits the qualifier from any other category of definition. |
To specify a comment, pre-pragma, or post-pragma for a memory section, enter the text in the appropriate edit boxes on the left side of the Custom Storage Class Designer. These boxes accept multiple lines separated by ordinary Returns.
If the Pragma surrounds field for a memory section specifies Each variable, the code generator will surround each definition in a contiguous block of definitions with the comment, pre-pragma, and post-pragma defined for the section. This behavior occurs with all categories of definitions.
If the Pragma surrounds field for a memory section specifies All variables, the code generator will insert the comment and pre-pragma for the section before the first definition in a contiguous block of custom storage class data definitions, and the post-pragma after the last definition in the block.
Note Specifying All variables affects only custom storage class data definitions. For any other category of definition, the code generator surrounds each definition separately regardless of the value of Pragma surrounds. |
When pragmas surround each separate definition in a contiguous block, you can include the string %<identifier> in a pragma. The string must appear without surrounding quotes.
When %<identifier> appears in a pre-pragma, the code generator will substitute the identifier from the subsequent function or data definition.
When %<identifier> appears in a post-pragma, the code generator will substitute the identifier from the previous function or data definition.
You can use %<identifier> with pragmas only when pragmas to surround each variable. The Validate phase will report an error if you violate this rule.
Note Although %<identifier> looks like a TLC variable, it is not: it is just a keyword that directs the code generator to substitute the applicable data definition identifier when it outputs a pragma. TLC variables cannot appear in pragma specifications in the Memory Section pane. |
![]() | Requirements for Defining Memory Sections | Applying Memory Sections | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |