17.7 Parameter Groups 17.9 Example
Simics User's Guide  /  V Appendix  /  17 Old Script Parameters  / 

17.8 Script Execution

When a script with a declaration block is run, interactively or from another script, this is what happens in detail:

  1. The script declaration is read and checked for errors. Imported parameters ("params from") are resolved recursively.
  2. Actual parameter values are taken from, in order:
    1. The supplied arguments, if the script was started from a shell command, or from run-command-file.
    2. CLI variables.
    3. Default values from the script declaration.
    An error is signalled if a parameter value is missing or has the wrong type.
  3. The current CLI variables, if any, are saved away and replaced with the script parameters having their initial values as described above.
  4. The command part of the script (below the declaration) is executed. If the script runs another script, this entire algorithm is used again.
  5. CLI variables corresponding to declared result names are retrieved. An error is signalled for missing results or ones with the wrong type.
  6. The saved CLI variables are restored, throwing away all current variables except for the declared results, which retain their values from the executed script.
17.7 Parameter Groups 17.9 Example