Accepts a target machine address, optionally with an address space
prefix, such as v:
for virtual addresses or p:
for
physical.
Generator function for boolean arguments. A boolean argument accepts the strings "TRUE" and "FALSE", as well as boolean integers (that is, the values 0 and 1). In addition, if the optional strings true_str and false_str are given, the boolean argument will accept them as well. The argument passes True or False to the command function depending on which string (or value) was given.
Generator function for filename arguments. If the dirs
argument is false (which is default), no directories will be
accepted. The exist flag, when set, forces the file to
actually exist. If simpath is true, files will be checked for
existence using SIM_lookup_file()
, searching the Simics
search path. simpath implies exist. On Windows, if Cygwin path
conversion is performed (see SIM_native_path()
for details), the
filename will be converted to host native format.
The checkpoint flag will constrain the argument to checkpoints,
and treat existing checkpoints as opaque entities.
Passes True
to command function when flag is provided, False
when flag is not provided.
Accepts floating-point numbers.
Accepts any unsigned integer that fits in 16 bits, modulo-reducing values outside into that range.
Accepts any unsigned integer that fits in 32 bits, modulo-reducing values outside into that range.
Accepts any unsigned integer that fits in 64 bits, modulo-reducing values outside into that range.
Accepts any unsigned integer that fits in 8 bits, modulo-reducing values outside into that range.
Accepts any integer (regardless of size).
Accepts any unsigned integer that fits in 64 bits, modulo-reducing values outside into that range.
Accepts integers that are valid IP port numbers (that is, integers between 0 and 65535 inclusive).
Accepts a comma separated list of CLI types. Can also be given to any CLI argument that accepts more than one value as input.
Nil argument. Accepts NIL, zero or the empty string, and passes None to the command function. Not so usable by itself, but see e.g. poly_t.
Returns an argument which accepts any object.
desc is the string returned as a description of the argument. kind can be used to limit the accepted objects to only allow objects of a certain kind. This parameter can either be a class name that the object should be an instance of, or the name of an interface that the object must implement, or a tuple of kinds. want_port indicates whether it should be allowed to specify an object and a port name, separated with a colon. If a port is wanted, the argument will be a list [obj, port] instead of only the object.
Generates an argument with the given description that will match any of the given types; they will be tried one by one, in the order specified, and the first one that accepts the input will be used.
Returns an argument which accepts any integer x between min and max inclusively. desc is the string returned as a description of the argument.
Values outside the interval cause an error to be signalled if modulo is false, and a modulo-reduction to the specified interval otherwise.
Accepts any signed integer that fits in 16 bits, modulo-reducing values outside into that range.
Accepts any signed integer that fits in 32 bits, modulo-reducing values outside into that range.
Accepts any signed integer that fits in 64 bits, modulo-reducing values outside into that range.
Accepts any signed integer that fits in 8 bits, modulo-reducing values outside into that range.
Accepts any one word or quoted string.
Accepts only strings from the given set. strings can be any iterable, such as a tuple, list, or set, in which case the return value is the exact string the user gave; or a dictionary mapping acceptable user input strings to return values.
The optional parameter visible is a list of strings. If given, only strings in this list will be suggested by the expander.
Accepts any unsigned integer that fits in 16 bits, modulo-reducing values outside into that range.
Accepts any unsigned integer that fits in 32 bits, modulo-reducing values outside into that range.
Accepts any unsigned integer that fits in 64 bits, modulo-reducing values outside into that range.
Accepts any unsigned integer that fits in 8 bits, modulo-reducing values outside into that range.
Accepts any unsigned (that is, non-negative) integer (regardless of size).
CliError(args)
arg(handler, name = "", spec = "1", default = None, data = None, doc = "", expander = None, pars = [])
command_quiet_return(value)
value should either be the value returned, or a function taking no arguments that returns the actual value.
Note that value can only be of types directly supported by CLI.
command_return(message = None, value = None)
message and value may both be functions that take no arguments and return the message (a string) or a value, respectively.
If it is a function, message is only evaluated if needed.
Note that value (or, when a function, its return value) can only be of types directly supported by CLI.
command_verbose_return(message = None, value = None)
The value and message parameters are identical to the same as for cli.command_return.
get_available_object_name(prefix)
get_component_object(cmp_obj, slot)
The function will raise a CliError if the object can not be found in the component.
global_cmds.wrapper_function(...)
_cmd
suffix is added
to the wrapper function name
and the function parameter gets the _
suffix.
Wrapper functions return the value returned by the command
which they execute.
Please consult the docstring of the wrapper function and the respective command documentation for the information about function arguments and the returned value.
interactive_command()
new_command(name, fun, args = [], **kwargs)
new_info_command(cls, get_info, ctype = None, doc = None)
[(SectionName1, [(DataName1.1, DataValue1.1), (DataName1.2, DataValue1.2), ...]), (SectionName2, [(DataName2.1, DataValue2.1), (DataName2.2, DataValue2.2), ...]), ...]
Each section will be printed separately. Each piece of data will be printed
on one line. If no sections are necessary, just provide None
as
the only section's name, followed by the list of data.
new_status_command(cls, get_status, ctype = None, doc = None)
new_tech_preview_command(name, feature, fun, args=[], doc="", **kwargs)
new_unsupported_command(name, feature, fun, args = [], doc = "", **kwargs)
number_str(val, radix = None, group = None, use_prefix = True, precision = 1)
The default digit grouping can be overridden with the
group parameter, where 0 means no grouping.
The radix prefix can be removed
by specifying use_prefix as False
.
The minimum number of digits to be printed is specified by precision. If precision is negative, the precision is taken to be zero. Regardless of the radix, a value of zero with zero precision will always return the empty string.
Negative numbers that fit in a signed 64-bit integer are treated as such. Other negative numbers are prefixed with a minus ("-").
object_expander(kind)
For example, to expand a string with the list of processor available in the machine, you would write:
arg(str_t, "cpu", expander = object_expander("processor_info"))
To expand a string to all gcache objects:
arg(str_t, "cache", expander = object_expander("gcache"))
quiet_run_command(text, output_mode = output_modes.formatted_text)
The quiet_run_command function is similar to run_command but returns a tuple with the command return value as first entry, and the command output text as the second. Please note that sometimes unrelated output might be included, e.g., for commands that advance the virtual time or in some other way may allow other commands to run in parallel with them.
Set 'output_mode' to one of the output modes:
run_command(text)
Use quiet_run_command if you need to suppress or catch messages printed.
simenv.variable
Running del simenv.foo
will unset that variable. The return value
from the dir function will also include defined variables. The
repr function will return the dictionary of variable and value
pairs as a string.
str_number(text)
Raises ValueError for invalid arguments.