Skip to content

Commit 3ec95af

Browse files
nwf-msrmarnovandermaas
authored andcommitted
Add --implementation-[AB]-host to runTestRIG.py
1 parent 473c157 commit 3ec95af

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

utils/scripts/runTestRIG.py

+29-2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ def x_ext(ext_name):
118118
default=None, type=auto_write_fd,
119119
#nargs='?', const=sub.PIPE,
120120
help="Turn on logging for implementation A's rvfi-dii server (optionally specifying a file path)")
121+
parser.add_argument('--implementation-A-host', metavar='HOST',
122+
help="The remote host of implementation A's manual rvfi-dii server")
121123
# implementation args
122124
parser.add_argument('-b', '--implementation-B', metavar='IMP', choices=known_rvfi_dii,
123125
default='sail',
@@ -128,6 +130,8 @@ def x_ext(ext_name):
128130
default=None, type=auto_write_fd,
129131
#nargs='?', const=sub.PIPE,
130132
help="Turn on logging for implementation B's rvfi-dii server (optionally specifying a file path)")
133+
parser.add_argument('--implementation-B-host', metavar='HOST',
134+
help="The remote host of implementation B's manual rvfi-dii server")
131135
# verification engine args
132136
parser.add_argument('-e', '--verification-engine', metavar='VENG', choices=known_vengine,
133137
default='QCVEngine',
@@ -521,7 +525,7 @@ def spawn_rvfi_dii_server(name, port, log, isa_def):
521525
# spawn verification engine #
522526
#############################
523527

524-
def spawn_vengine(name, mport, iport, arch, log):
528+
def spawn_vengine(name, mport, iport, arch, log, more_args=[]):
525529
if name == 'QCVEngine-docker':
526530
cmd = ["docker", "run", "--rm", "-t", "-p", f"{mport}:{mport}", "-p", f"{iport}:{iport}",
527531
"ctsrd/testrig", "./TestRIG/vengines/QuickCheckVEngine/dist/build/QCVEngine/QCVEngine",
@@ -535,6 +539,8 @@ def spawn_vengine(name, mport, iport, arch, log):
535539
cmd = ["false"]
536540
useQCVEngine = False
537541

542+
cmd += more_args
543+
538544
if useQCVEngine:
539545
if args.supported_features is not None:
540546
QCVEngineArch = str(arch) + "_" + args.supported_features
@@ -672,6 +678,20 @@ def handle_SIGINT(sig, frame):
672678
if args.relaxed_comparison and args.strict_comparison:
673679
print('Cannot do both relaxed and strict comparison')
674680
exit(-1)
681+
682+
if args.implementation_A_host and not (args.implementation_A == "manual"):
683+
print("Specifying host A is only possible for manual implementations")
684+
exit(-1)
685+
686+
if args.implementation_B_host and not (args.implementation_B == "manual"):
687+
print("Specifying host B is only possible for manual implementations")
688+
exit(-1)
689+
690+
if (args.implementation_A_host or args.implementation_B_host) \
691+
and not (args.parallel_jobs == 1):
692+
print("Specifying implementation host requires no job parallelism")
693+
exit(-1)
694+
675695
# Allow --verification-archstring to override architecture
676696
vengine_archstring = args.verification_archstring if args.verification_archstring else args.architecture
677697
try:
@@ -729,6 +749,12 @@ def handle_SIGINT(sig, frame):
729749

730750
time.sleep(args.spawn_delay) # small delay to give time to the spawned servers to be ready to listen
731751

752+
extra_vengine_args = []
753+
if args.implementation_A_host:
754+
extra_vengine_args += [ "-A", args.implementation_A_host ]
755+
if args.implementation_B_host:
756+
extra_vengine_args += [ "-B", args.implementation_B_host ]
757+
732758
for job in range(args.parallel_jobs):
733759
if a[job] is not None and a[job].poll() is not None:
734760
print("ERROR: Implementation A failed to start!")
@@ -739,7 +765,8 @@ def handle_SIGINT(sig, frame):
739765
print(" ".join(b[job].args), "failed with exit code", b[job].poll())
740766
exit(1)
741767
e.append(spawn_vengine(args.verification_engine, aports[job], bports[job],
742-
vengine_archstring, logs[job].error_log))
768+
vengine_archstring, logs[job].error_log,
769+
more_args=extra_vengine_args))
743770

744771
# TODO support non-standard generator in parallel builds
745772
generator.append(spawn_generator(args.generator, args.architecture,

0 commit comments

Comments
 (0)