-
Notifications
You must be signed in to change notification settings - Fork 0
/
smg
executable file
·33 lines (28 loc) · 1.25 KB
/
smg
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
28
29
30
31
32
33
#!/usr/bin/env python3
import argparse
from schedgen import schedgen
from schedver import schedver
def parse_command_line():
parser = argparse.ArgumentParser(
description='llvm schedule model generator.')
subparsers = parser.add_subparsers(dest='command')
generator_parser = subparsers.add_parser('gen',
description='generate schedmodel')
generator_parser.add_argument('--target-cpu',
required=True,
help='target cpu')
generator_parser.add_argument('-o', default='-', help='output file')
generator_parser.add_argument('jf', help='instruction uops info json file')
verifier_parser = subparsers.add_parser('verify',
description='verify schedmodel')
verifier_parser.add_argument('--target-cpu',
required=True,
help='target cpu')
verifier_parser.add_argument('jf', help='instruction uops info json file')
return parser.parse_args()
if __name__ == '__main__':
args = parse_command_line()
if args.command == 'gen':
schedgen.main(args)
elif args.command == 'verify':
schedver.main(args)