Real-Time Workshop Embedded Coder    

Introduction to Custom Storage Classes

In Real-Time Workshop, the storage class specification of a signal, tunable parameter, block state, or data object specifies how that entity is declared, stored, and represented in generated code.

Note that in the context of Real-Time Workshop, the term "storage class" is not synonymous with the term "storage class specifier," as used in the C language.

Real-Time Workshop defines built-in storage classes for use with all targets. Examples of built-in storage classes are Auto, ExportedGlobal, and ImportedExtern. These storage classes provide limited control over the form of the code generated for references to the data. For example, data of storage class Auto is typically declared and accessed as an element of a structure, while data of storage class ExportedGlobal is declared and accessed as unstructured global variables. Built-in storage classes are discussed in detail in the Code Generation and the Build Process chapter of the Real-Time Workshop documentation.

The built-in storage classes are suitable for a simulation or rapid prototyping environment, but embedded system designers often require greater control over the representation of data. For example, you may need to

The Real-Time Workshop Embedded Coder's custom storage classes provide extended control over the constructs required to represent data in an embedded algorithm. A custom storage class is defined by a set of Target Language Compiler (TLC) instructions that the Real Time Workshop uses when generating code for each type of reference to data of that class. These instructions tell the Real Time Workshop exactly how to define, declare, and access the data. Since the instructions are created by the user, the variations in the code generated are unlimited.

The Real Time Workshop Embedded Coder includes a set of predefined custom storage classes designed to be useful in embedded systems development. You can use these classes without any TLC programming. The sections that follow explain the custom storage classes provided and supported by The MathWorks for use with the Real Time Workshop Embedded Coder.

The TLC code for each predefined storage class is found in
matlabroot/toolbox/simulink/simulink/@Simulink/tlc. If you want to create your own custom storage classes, you can use this code as an example. However, the creation of new classes is outside the scope of this document.


  Custom Storage Classes Properties of Predefined Custom Storage Classes