Add Corstone-310 target

Change-Id: Idcb2238895668ee4858c2e858c02c6765f4b1702
diff --git a/scripts/run_ctest.py b/scripts/run_ctest.py
index 93a5427..c2ba672 100755
--- a/scripts/run_ctest.py
+++ b/scripts/run_ctest.py
@@ -114,6 +114,31 @@
 
     return run_fvp(cmd)
 
+def run_corstone_310(args):
+    # Verify supported FVP version
+    version = subprocess.check_output(['FVP_Corstone_SSE-310', '--version']).decode()
+    supported_version = ['11.17']
+
+    if not [s for s in supported_version if s in version]:
+        raise Exception("Incorrect FVP version. Supported versions are '{}'.".format(supported_version))
+
+    # FVP executable
+    cmd = ['FVP_Corstone_SSE-310']
+
+    # NPU configuration
+    cmd += ['-C', 'ethosu.num_macs=' + str(args.macs)]
+
+    # Output parameters
+    cmd += ['-C', 'mps3_board.visualisation.disable-visualisation=1',
+            '-C', 'mps3_board.telnetterminal0.start_telnet=0',
+            '-C', 'mps3_board.uart0.out_file="-"',
+            '-C', 'mps3_board.uart0.unbuffered_output=1',
+            '-C', 'mps3_board.uart0.shutdown_on_eot=1']
+
+    cmd += args.args
+
+    return run_fvp(cmd)
+
 def run_corstone_polaris(args):
     # Verify supported FVP version
     version = subprocess.check_output(['FVP_Corstone-Polaris', '--version']).decode()
@@ -147,7 +172,7 @@
 
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description='Run a test with given test command and test binary.')
-    parser.add_argument('-t', '--target', choices=['corstone-300', 'corstone-polaris'], required=True, help='FVP target.')
+    parser.add_argument('-t', '--target', choices=['corstone-300', 'corstone-310', '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.')
@@ -157,5 +182,7 @@
 
     if args.target == 'corstone-300':
         sys.exit(run_corstone_300(args))
+    elif args.target == 'corstone-310':
+        sys.exit(run_corstone_310(args))
     elif args.target == 'corstone-polaris':
         sys.exit(run_corstone_polaris(args))