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