Skip to content

Commit 08ed54e

Browse files
Erik-Lundellfreddan80
authored andcommitted
Add pytest option to run FVPs in fast mode
Add --fast_fvp when running pytest to enable Also adds flag to disable visualisation for Corstone320 Signed-off-by: Erik Lundell <[email protected]> Change-Id: I4a49bce7f773d805f89f0255c1c08e0c277edd58
1 parent 43555d2 commit 08ed54e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

backends/arm/test/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class arm_test_options(Enum):
2929
corstone300 = auto()
3030
dump_path = auto()
3131
date_format = auto()
32+
fast_fvp = auto()
3233

3334

3435
_test_options: dict[arm_test_options, Any] = {}
@@ -41,6 +42,7 @@ def pytest_addoption(parser):
4142
parser.addoption("--arm_run_corstone300", action="store_true")
4243
parser.addoption("--default_dump_path", default=None)
4344
parser.addoption("--date_format", default="%d-%b-%H:%M:%S")
45+
parser.addoption("--fast_fvp", action="store_true")
4446

4547

4648
def pytest_configure(config):
@@ -63,6 +65,7 @@ def pytest_configure(config):
6365
f"Supplied argument 'default_dump_path={dump_path}' that does not exist or is not a directory."
6466
)
6567
_test_options[arm_test_options.date_format] = config.option.date_format
68+
_test_options[arm_test_options.fast_fvp] = config.option.fast_fvp
6669
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
6770

6871

backends/arm/test/runner_utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import numpy as np
1818
import torch
1919

20+
from executorch.backends.arm.test.common import arm_test_options, is_option_enabled
21+
2022
from torch.export import ExportedProgram
2123
from torch.fx.node import Node
2224

@@ -249,6 +251,10 @@ def run_corstone(
249251
for input_path in input_paths:
250252
cmd_line += f" -i {input_path}"
251253

254+
ethos_u_extra_args = ""
255+
if is_option_enabled(arm_test_options.fast_fvp):
256+
ethos_u_extra_args = ethos_u_extra_args + "--fast"
257+
252258
command_args = {
253259
"corstone-300": [
254260
"FVP_Corstone_SSE-300_Ethos-U55",
@@ -267,6 +273,8 @@ def run_corstone(
267273
"-C",
268274
"cpu0.semihosting-stack_base=0",
269275
"-C",
276+
f"ethosu.extra_args='{ethos_u_extra_args}'",
277+
"-C",
270278
"cpu0.semihosting-heap_limit=0",
271279
"-C",
272280
f"cpu0.semihosting-cmd_line='{cmd_line}'",
@@ -282,6 +290,8 @@ def run_corstone(
282290
"-C",
283291
"mps4_board.visualisation.disable-visualisation=1",
284292
"-C",
293+
"vis_hdlcd.disable_visualisation=1",
294+
"-C",
285295
"mps4_board.telnetterminal0.start_telnet=0",
286296
"-C",
287297
"mps4_board.uart0.out_file='-'",
@@ -296,6 +306,8 @@ def run_corstone(
296306
"-C",
297307
"mps4_board.subsystem.cpu0.semihosting-heap_limit=0",
298308
"-C",
309+
f"mps4_board.subsystem.ethosu.extra_args='{ethos_u_extra_args}'",
310+
"-C",
299311
f"mps4_board.subsystem.cpu0.semihosting-cmd_line='{cmd_line}'",
300312
"-a",
301313
elf_path,

0 commit comments

Comments
 (0)