aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPer Åstrand <per.astrand@arm.com>2022-02-03 19:35:35 +0100
committerPer Åstrand <per.astrand@arm.com>2022-02-25 09:07:41 +0100
commit9de1b74ed1b8af942b82be8ee53edc4278b34fb3 (patch)
tree94bfd1fa141d872490e0992ecb3b1766cf87fbf8 /scripts
parent41dc341e91cb0d406bcac26294305dbb0879af61 (diff)
downloadethos-u-core-platform-9de1b74ed1b8af942b82be8ee53edc4278b34fb3.tar.gz
Add CMake variable to pass arguments to ctest22.02-rc3
This is needed in order to for example turn tarmac tracing on for the FVP running the tests. Change-Id: I6606134046c2e228d3fe06db41792e7403cd6ba8
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/run_ctest.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/run_ctest.py b/scripts/run_ctest.py
index 1faf0e2..93a5427 100755
--- a/scripts/run_ctest.py
+++ b/scripts/run_ctest.py
@@ -21,6 +21,8 @@
import argparse
import subprocess
import sys
+import os
+from pathlib import Path
def __print_arguments(args):
if isinstance(args, list):
@@ -89,6 +91,25 @@ def run_corstone_300(args):
'-C', 'mps3_board.uart0.unbuffered_output=1',
'-C', 'mps3_board.uart0.shutdown_on_eot=1']
+ if args.tarmac:
+ try:
+ pvlib_home = Path(os.getenv('PVLIB_HOME'))
+ except:
+ raise Exception("Environment variable PVLIB_HOME not found. Needed to produce tarmac trace.")
+
+ if sys.platform == 'linux':
+ tarmac_trace_plugin = pvlib_home / Path('plugins/Linux64_GCC-7.3/TarmacTrace.so')
+ else:
+ raise Exception("tarmac trace: This feature is not currently supported on" + sys.platform)
+
+ if tarmac_trace_plugin.exists():
+ print("Tarmac trace will be created");
+ basename = [ e for e in args.args if e.endswith('.elf')][0][:-4]
+ cmd += ['--plugin', str(tarmac_trace_plugin)]
+ cmd += ['-C', f'TRACE.TarmacTrace.trace-file={basename}.trace']
+ else:
+ raise Exception("tarmac trace: Can't find TarmacTrace plugin in " + pvlib_home)
+
cmd += args.args
return run_fvp(cmd)
@@ -129,6 +150,8 @@ if __name__ == '__main__':
parser.add_argument('-t', '--target', choices=['corstone-300', 'corstone-polaris'], required=True, help='FVP target.')
parser.add_argument('-a', '--arch', choices=['ethos-u55', 'ethos-u65'], help='NPU architecture.')
parser.add_argument('-m', '--macs', type=int, choices=[32, 64, 128, 256, 512], default=128, help='NPU number of MACs.')
+ parser.add_argument('-c', '--tarmac', dest='tarmac', action='store_true', help='Collect tarmac traces when running FVP.')
+
parser.add_argument('args', nargs='+', help='Arguments.')
args = parser.parse_args()