File size: 482 Bytes
d1be154 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #!/usr/bin/env python3
import os
import subprocess
import sys
import math
import cmpt
# Usage: python shell.py ot-shell benchmark/ circuit
exe=sys.argv[1]
dir=sys.argv[2]
tgt=sys.argv[3]
os.chdir(dir + '/' + tgt)
shell = tgt + ".shell"
golden = tgt + ".output"
output = ".output"
# execute the shell to generate timing report
with open(shell) as f:
subprocess.call([exe, "-o", output], stdin=f)
# compare the output with the golden
cmpt.compare_timing(output, golden)
|