1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-04-20 11:29:54 +00:00

runfvp: make fvp runner to hold the config

At the moment the config is load and pass to FVPRunner.

Change the ownership to FVPRunner.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Clément Péron
2023-05-17 12:09:11 +02:00
committed by Jon Mason
parent 316e02c0f1
commit 272359be5d
4 changed files with 52 additions and 36 deletions

View File

@@ -14,7 +14,7 @@ logger = logging.getLogger("RunFVP")
libdir = pathlib.Path(__file__).parents[1] / "meta-arm" / "lib"
sys.path.insert(0, str(libdir))
from fvp import terminal, runner, conffile
from fvp import terminal, runner
def parse_args(arguments):
import argparse
@@ -49,12 +49,13 @@ def parse_args(arguments):
logger.debug(f"FVP arguments: {fvp_args}")
return args, fvp_args
def start_fvp(args, config, extra_args):
def start_fvp(args, fvpconf, extra_args):
fvp = runner.FVPRunner(logger)
try:
fvp.start(config, extra_args, args.terminals)
fvp.start(fvpconf, extra_args, args.terminals)
if args.console:
config = fvp.getConfig()
expected_terminal = config["consoles"].get("default")
if expected_terminal is None:
logger.error("--console used but FVP_CONSOLE not set in machine configuration")
@@ -87,9 +88,7 @@ def runfvp(cli_args):
config_file = args.config
else:
config_file = conffile.find(args.config)
logger.debug(f"Loading {config_file}")
config = conffile.load(config_file)
start_fvp(args, config, extra_args)
start_fvp(args, config_file, extra_args)
if __name__ == "__main__":