void scx_parse_and_configure(int argc,
char *argv[],
const char *trailer = NULL,
bool sig_handler = true);
argc
- command-line options.
argv
- command-line options.
trailer
- a string that follows the option list when printing help message
(
--help
option).
sig_handler
- whether to enable signal handler function,
true
to enable (default),
false
to disable.
The application must pass the values of the options from function
sc_main()
as arguments to this function.
-a
, --application
- application to load, format:
-a [INST=]FILE
.
-d
, --data
- raw data to load, format:
-d [INST=]FILE@[MEMSPACE:]ADDRESS
.
-L
, --cadi-log
- log all CADI calls to XML log files.
-S
, --cadi-server
- start CADI server allowing debuggers to connect to targets in the simulation.
-D
, --allow-debug-plugin
- allow a plug-in to debug the simulation.
-h
, --help
- print help message and exit.
-K
, --keep-console
- keep console window open after completion (Microsoft Windows only).
-l
, --list-params
- print list of platform parameters to standard output and exit.
-C
, --parameter
- set parameter, format:
--C INST.PARAM=VALUE
.
--plugin
- plug-in to load, format:
--plugin [NAME=]FILE
.
--trace-plugin
- the predecessor of
--plugin FILE
.
-P
, --prefix
- prefix semi-hosting output with the name of the instance.
-p
, --print-port-number
- print TCP port number the CADI server is listening to.
-R
, --run
- run simulation immediately after CADI server starts.
-s
, --stat
- print run statistics on simulation exit.
This function treats all other command-line arguments as applications to load.
This function calls std::exit(EXIT_SUCCESS)
to exit (options
--list-params
, --help
). It calls
std::exit(EXIT_FAILURE)
in case of error (error in parameter
specification, invalid option, application or plug-in not found).