From 9ec1b939808a8538d9ae581c709b6ea4c3fc7b5d Mon Sep 17 00:00:00 2001 From: Richard Cooper Date: Tue, 21 Mar 2023 13:39:18 +0000 Subject: [PATCH] configs: Add --exit-on-uart-eot flag to Arm baremetal.py config Many benchmarks signal their termination by writing an EOT character to the UART. This change adds an option to the Arm `baremetal.py` example script to exit the simulation when an EOT character is detected on any of the UARTs. Change-Id: Ibfce9800c47090714258dbdbc5d6cee5ee6fb952 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69688 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini Tested-by: kokoro --- configs/example/arm/baremetal.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configs/example/arm/baremetal.py b/configs/example/arm/baremetal.py index ab24fd3d62..8ffd2b48e0 100644 --- a/configs/example/arm/baremetal.py +++ b/configs/example/arm/baremetal.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017,2019-2022 Arm Limited +# Copyright (c) 2016-2017,2019-2023 Arm Limited # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -157,6 +157,10 @@ def create(args): workload_class = workloads.workload_list.get(args.workload) system.workload = workload_class(object_file, system) + if args.exit_on_uart_eot: + for uart in system.realview.uart: + uart.end_on_eot = True + return system @@ -253,6 +257,12 @@ def main(): default="stdoutput", help="Destination for the Tarmac trace output. [Default: stdoutput]", ) + parser.add_argument( + "--exit-on-uart-eot", + action="store_true", + help="Exit simulation if any of the UARTs receive an EOT. Many " + "workloads signal termination by sending an EOT character.", + ) parser.add_argument( "--dtb-gen", action="store_true",