Memory Allocate - Allocate memory section on supported processors -

Library

Core Support in Embedded IDE Link MU

Description

On your processor, this block directs the Green Hills MULTI® compiler to allocate memory for a new variable you specify. Parameters in the block dialog box let you specify the variable name, the alignment of the variable in memory, the data type of the variable, and other features that fully define the memory required.

The block does not verify whether the entries for your variable are valid, such as checking the variable name, data type, or section. You must ensure that all variable names are valid, that they use valid data types, and that all section names you specify are valid as well.

The block does not have input or output ports. It only allocates a memory location. You do not connect it to other blocks in your model.

Dialog Box

The block dialog box comprises multiple tabs:

The dialog box images show all of the available parameters enabled. Some of the parameters shown do not appear until you select one or more other parameters.

The following sections describe the contents of each pane in the dialog box.

Memory Parameters

You find the following memory parameters on this tab.

Variable name

Specify the name of the variable to allocate. The variable is allocated in the generated code.

Specify variable alignment

Select this option to direct the compiler to align the variable in Variable name to an alignment boundary. When you select this option, the Memory alignment boundary parameter appears so you can specify the alignment. Use this parameter and Memory alignment boundary when your processor requires this feature.

Memory alignment boundary

After you select Specify variable alignment, this option enables you to specify the alignment boundary in bytes. If your variable contains more than one value, such as a vector or an array, the elements are aligned according to rules applied by the compiler.

Data type

Defines the data type for the variable. Select from the list of types available.

Specify data type qualifier

Selecting this enables Data type qualifier so you can specify the qualifier to apply to your variable.

Data type qualifier

After you select Specify data type qualifier, you enter the desired qualifier here. Volatile is the default qualifier. Enter the qualifier you need as text. Common qualifiers are static and register. The block does not check for valid qualifiers.

Data dimension

Specifies the number of elements of the type you specify in Data type. Enter an integer here for the number of elements.

Initialize memory

Directs the block to initialize the memory location to a fixed value before processing.

Initial value

Specifies the initialization value for the variable. At run time, the block sets the memory location to this value.

Section Parameters

Parameters on this pane specify the section in memory to store the variable.

Specify memory section

Selecting this parameter enables you to specify the memory section to allocate space for the variable. Enter either one of the standard memory sections or a custom section that you declare elsewhere in your code.

Memory section

Identify a specific memory section to allocate the variable in Variable name. Verify that the section has sufficient space to store your variable. After you specify a memory section by selecting Specify memory section and entering the section name in Memory section, use Bind memory section to bind the memory section to a location.

See Also

Memory Copy

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS