Non-Confidential | ![]() | ARM DUI0446W | ||
| ||||
Home > Debugging with Scripts > Defining the Options for usecase scripts |
Each usecase has a list of options which specify a set of values which can be supplied on the command-line to a particular usecase to configure what values are supplied when usecase is run.
$Options$
tag
in a usecase definition block. The $Options$
tag provides the name of a
method in the script which returns a single list of options.... $Options$ myOptions ...
def myOptions():
return [list_of_options
]
$Options$
tag is defined, and the function named in
this tag is not present in the script or the function used to supply the options
takes arguments, then an error occurs when running the script.True
or
False
.traceCapture
or
etmv4
which can be used, for
example, to refer to the Coresight components in the current system by
name.UseCaseScript.booleanOption(name="timestamps", displayName="Enable global timestamping", defaultValue=True)
UseCaseScript.stringOption(name="traceBuffer", "Trace Capture Method", defaultValue="none")
UseCaseScript.integerOption(name="cores", displayName="Number of cores", defaultValue=1, min=1, max=16, format=UseCaseScript.DEC)
UseCaseScript.integerOption(name="retries", displayName="Attempts to retry", defaultValue=5, min=1, format=UseCaseScript.HEX)
UseCaseScript.enumOption(name="contextid", displayName="Context ID Size", values = [("8", "8 bits"), ("16", "16 bits"), ("32", "32 bits")] , defaultValue="32")
childOptions
keyword which is a list of other options which are
nested within this option. An example set of nested options can be seen below.def myOptions(): return [ UseCaseScript.optionGroup( name="options", displayName="Usecase Options", childOptions=[ UseCaseScript.optionGroup( name="connection", displayName="Connection Options", childOptions=[ UseCaseScript.integerOption( name="cores", displayName="Number of cores", defaultValue=1, min=1, max=16), UseCaseScript.stringOption( name="traceBuffer", displayName="Trace Capture Method", defaultValue="none"), ] ), UseCaseScript.enumOption( name="contextID", displayName="Context ID Size", values = [("8", "8 bits"), ("16", "16 bits"), ("32", "32 bits")] , defaultValue="32"), ] ), ]
options
with two child options: options
object, as the required first parameter, which can be used to
get and set the option values. The functions that are provided to work with defined
options are getOptionValue(name
)
and setOptionValue(name
,
value
)
. name
of the option, use the full name, for example
group.subgroup.variable
. The value
must be of
the correct type for the named variable, for example string, integer or a member of
the enumeration.usecase help
script_name.py
on the command-line.