aboutsummaryrefslogtreecommitdiff
path: root/scripts/run_ctest.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/run_ctest.py')
-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()