2.2.5. Parameters

Parameters allow component configuration and parameterization at initialization time or run time of the system model.

Table 2.4 lists the parameters that can be given to the PARAMETER keyword. Array syntax is not supported for parameters.

Table 2.4. PARAMETER parameters

ParameterTypeDefaultDescription
defaultint or string0 or ""Default value is 0 for integers and the empty string for string parameters.
descriptionstring""Plain text single line description of the parameter. The debugger might display this string next to the parameter to provide additional information about a parameter to the user.
maxint0x7FFFFFFFFFFFFFFFMaximum admissible value.
minint0x8000000000000000

Minimum admissible value.

Note

The minimum value (and therefore the maximum range) for a parameter depends on whether it is signed or unsigned. The maximum ranges are:

  • [0x0, 0x7FFFFFFFFFFFFFFF] for unsigned parameters

  • [0x8000000000000000, 0x7FFFFFFFFFFFFFFF] for signed parameters.

namestring""A text tag for the parameter that is displayed in the GUI. Any printable symbol except for # . and = can be used in name. Double quote characters within the tag must be escaped with \. If no name is specified, the parameter identifier is used.
typeint, bool, or stringint

Data type.

Note

The type can also be intx_size or uintx_size where size is one of 8, 16, 32, or 64.

read_functionstringnoneName of the read access behavior.
write_functionstringnoneName of the write access behavior.
runtimebooleanfalseSwitch between instantiation-time and run-time parameters. Instantiation-time parameters are set by the user before the system is instantiated and cannot be changed afterwards. This is the default. Run-time parameters can be changed during runtime.

The access functions have similar semantics as for registers. The access function prototypes are as follows:

For each parameter with name name, a constant PARAMETER_ID_name is generated. This is passed as id when the PARAMETER is read from or written to.

The default behavior for the read_function is to return the current value of the PARAMETER. The default behavior for the write_function is to set the value of the PARAMETER. If a write_function is specified, the parameter is no longer updated automatically. This update must be done in the write function.

Example 2.13 shows an example of using PARAMETER in a resources section.

Example 2.13. PARAMETER resource

resources
{
    PARAMETER { min(0), max(0xFFFF), default(0x80), name(”Base Address”)}
      baseAddress;
    
}

The parameter in the example would default to being called baseAddress if a name tag was not declared. When choosing parameter names or tags, you are strongly advised to adhere to the naming rules for C++ identifiers. This means you can use upper and lower case letters, numbers, and underscore characters. Avoid using hyphens, "-" in parameter names or tags. If you are supporting legacy code that uses hyphens in parameter names, you can use these old names within the name tag. However, the parameter name outside the braces must conform to C++ naming rules, and is what you must use in your LISA+ code.

Parameters that are integers and are entered in decimal format can have the multiplier suffixes listed in Table 2.5.

Table 2.5. Multiplier suffixes for integer properties and parameters

SuffixDescriptionMultiplier
KKilo210
MMega220
GGiga230
TTera240
PPeta250

Copyright © 2007-2009 ARM Limited. All rights reserved.ARM DUI 0372H
Non-Confidential