aboutsummaryrefslogtreecommitdiffstats
path: root/tests/rpc/frontend.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rpc/frontend.py')
-rw-r--r--tests/rpc/frontend.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/rpc/frontend.py b/tests/rpc/frontend.py
index eff41738a..eace07bf9 100644
--- a/tests/rpc/frontend.py
+++ b/tests/rpc/frontend.py
@@ -31,7 +31,7 @@ end
import json
import argparse
-import sys, socket, os
+import sys, socket, os, subprocess
try:
import msvcrt, win32pipe, win32file
except ImportError:
@@ -85,6 +85,7 @@ def main():
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.bind(args.path)
try:
+ ys_proc = subprocess.Popen(["../../yosys", "-ql", "unix.log", "-p", "connect_rpc -path {}; read_verilog design.v; hierarchy -top top; flatten; select -assert-count 1 t:$neg".format(args.path)])
sock.listen(1)
conn, addr = sock.accept()
file = conn.makefile("rw")
@@ -93,7 +94,11 @@ def main():
if not input: break
file.write(call(input) + "\n")
file.flush()
+ ys_proc.wait(timeout=10)
+ if ys_proc.returncode:
+ raise subprocess.CalledProcessError(ys_proc.returncode, ys_proc.args)
finally:
+ ys_proc.kill()
sock.close()
os.unlink(args.path)