From 5b059ed240cae510e17b2db0b6ea9fca450ce94b Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Wed, 29 Jan 2025 14:23:16 +0000 Subject: [PATCH 1/3] Fixes in FVP invocation This patches fixes two bugs: - Properly propagate FVP's return code to the caller. - Prepend '*=' to the --application argument value. This is required when the application's path contains equal signs ('='). This sign is interpreted as a special case inside FVP: its presence in the path leads to ambiguity. One way to work around this is to do the prepend. After that, any '=' sign that comes up in the path is treated as part of the path. --- arm-software/embedded/arm-runtimes/test-support/lit-exec-fvp.py | 2 +- arm-software/embedded/arm-runtimes/test-support/run_fvp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arm-software/embedded/arm-runtimes/test-support/lit-exec-fvp.py b/arm-software/embedded/arm-runtimes/test-support/lit-exec-fvp.py index ef62c9c00190..6045820e26c1 100755 --- a/arm-software/embedded/arm-runtimes/test-support/lit-exec-fvp.py +++ b/arm-software/embedded/arm-runtimes/test-support/lit-exec-fvp.py @@ -77,7 +77,7 @@ def main(): help="optional arguments for the image", ) args = parser.parse_args() - return run_fvp( + ret_code = run_fvp( args.fvp_install_dir, args.fvp_config_dir, args.fvp_model, diff --git a/arm-software/embedded/arm-runtimes/test-support/run_fvp.py b/arm-software/embedded/arm-runtimes/test-support/run_fvp.py index 8f3f95635c3f..5d529eace1a5 100755 --- a/arm-software/embedded/arm-runtimes/test-support/run_fvp.py +++ b/arm-software/embedded/arm-runtimes/test-support/run_fvp.py @@ -58,7 +58,7 @@ def run_fvp( command.extend(["--quiet"]) for config in fvp_configs: command.extend(["--config-file", path.join(fvp_config_dir, config + ".cfg")]) - command.extend(["--application", image]) + command.extend(["--application", f"*={image}"]) command.extend(["--parameter", f"{model.cmdline_param}={shlex.join(arguments)}"]) command.extend(["--plugin", path.join(fvp_install_dir, model.crypto_plugin)]) if tarmac_file is not None: From e7eb3eaab2b33c4e25f227f42146bdde4a8e0cd0 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Mon, 3 Feb 2025 10:14:21 +0000 Subject: [PATCH 2/3] Specify instance in --application --- .../embedded/arm-runtimes/test-support/run_fvp.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arm-software/embedded/arm-runtimes/test-support/run_fvp.py b/arm-software/embedded/arm-runtimes/test-support/run_fvp.py index 5d529eace1a5..ba57aaedd9b7 100755 --- a/arm-software/embedded/arm-runtimes/test-support/run_fvp.py +++ b/arm-software/embedded/arm-runtimes/test-support/run_fvp.py @@ -58,7 +58,18 @@ def run_fvp( command.extend(["--quiet"]) for config in fvp_configs: command.extend(["--config-file", path.join(fvp_config_dir, config + ".cfg")]) - command.extend(["--application", f"*={image}"]) + + if fvp_model == "corstone-310": + command.extend(["--application", f"cpu0={image}"]) + elif fvp_model == "aem-a" or fvp_model == "aem-r": + # In case we ever need to run multiprocessor images, the instance name below + # can be renamed to "cluster0.cpu*" (wildcard). + command.extend(["--application", f"cluster0.cpu0={image}"]) + else: + raise RuntimeError( + "FVP model {fvp_model} not covered in --application definition" + ) + command.extend(["--parameter", f"{model.cmdline_param}={shlex.join(arguments)}"]) command.extend(["--plugin", path.join(fvp_install_dir, model.crypto_plugin)]) if tarmac_file is not None: From 6a9522f736fcb600d49f62ece9e942577145e171 Mon Sep 17 00:00:00 2001 From: Victor Campos Date: Mon, 3 Feb 2025 10:44:54 +0000 Subject: [PATCH 3/3] Fixed f-string --- arm-software/embedded/arm-runtimes/test-support/run_fvp.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arm-software/embedded/arm-runtimes/test-support/run_fvp.py b/arm-software/embedded/arm-runtimes/test-support/run_fvp.py index ba57aaedd9b7..c1008d93c23a 100755 --- a/arm-software/embedded/arm-runtimes/test-support/run_fvp.py +++ b/arm-software/embedded/arm-runtimes/test-support/run_fvp.py @@ -67,7 +67,7 @@ def run_fvp( command.extend(["--application", f"cluster0.cpu0={image}"]) else: raise RuntimeError( - "FVP model {fvp_model} not covered in --application definition" + f"FVP model {fvp_model} not covered in --application definition" ) command.extend(["--parameter", f"{model.cmdline_param}={shlex.join(arguments)}"]) @@ -105,4 +105,3 @@ def run_fvp( ) sys.stdout.buffer.write(result.stdout) return result.returncode -