-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstatus_vivado.py
More file actions
42 lines (30 loc) · 933 Bytes
/
status_vivado.py
File metadata and controls
42 lines (30 loc) · 933 Bytes
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
34
35
36
37
38
39
40
41
42
# This script is used to generate the lib_tuples.cpp file
import gzip
import json
import uuid
import argparse
from autoax import Config
import os
import tqdm
def main():
p = argparse.ArgumentParser()
p.add_argument('config', help='Config file (yaml)')
p.add_argument('dataset', help='Dataset file form results (e.g. random)')
args = p.parse_args()
c = Config(args.config)
res_dir = os.path.join(c.cwd, "synth")
os.path.exists(res_dir) or os.makedirs(res_dir)
fn = c.result_path(args.dataset + ".json.gz")
print(f"# Reading {fn}")
data = json.load(gzip.open(fn))
tmp_path = c.temporary_path(f"vivado/{args.dataset}/synth")
tot = 0
valid = 0
for i in data:
ex = os.path.exists(os.path.join(tmp_path, i, "results_resource.txt"))
if ex:
valid += 1
tot += 1
print(f"Valid: {valid}/{tot}")
if __name__ == "__main__":
main()