CLI variables can be used to store temporary values. To set a variable, write $variable = value
at the Simics prompt. The value can be of type integer, string, float, boolean or a list or values. To access a variable, prefix the name with a dollar sign ($); e.g., $variable
. A variable can be used wherever an expression can be used. For example:
simics> $tmp = %pc + 4 simics> $count = 10 simics> disassemble $tmp $count
They can also be accessed from Python by using the namespace simenv (simenv is imported into global namespace by default, but if it is needed elsewhere, it can be imported from the cli module):
simics> $foo = 1 + 4 * 4 simics> @print(simenv.foo) 17 simics> @simenv.bar = "hello" simics> echo $bar hello