-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
55 lines (42 loc) · 1.39 KB
/
main.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
from Z3Log.utils import setup_folder_structure
from Z3Log.config import path as z3logpath
from sxpat.specifications import Specifications
from sxpat.config import paths as sxpatpaths
from sxpat.xplore import explore_grid
from sxpat.stats import Stats
from z_marco.utils import pprint
from sxpat.utils.filesystem import FS
def main():
specs_obj = Specifications.parse_args()
print(f'{specs_obj = }')
if specs_obj.plot:
pprint.info2('Plotting...')
stats_obj = Stats(specs_obj)
stats_obj.gather_results()
else:
if specs_obj.clean:
pprint.info2('cleaning...')
clean_all()
# prepare folders
setup_folder_structure()
for (directory, _) in sxpatpaths.OUTPUT_PATH.values():
FS.mkdir(directory)
# run system
stats_obj = explore_grid(specs_obj)
def clean_all():
for (directory, _) in [
z3logpath.OUTPUT_PATH['ver'],
z3logpath.OUTPUT_PATH['gv'],
z3logpath.OUTPUT_PATH['aig'],
z3logpath.OUTPUT_PATH['z3'],
z3logpath.OUTPUT_PATH['report'],
z3logpath.OUTPUT_PATH['figure'],
z3logpath.TEST_PATH['tb'],
sxpatpaths.OUTPUT_PATH['area'],
sxpatpaths.OUTPUT_PATH['power'],
sxpatpaths.OUTPUT_PATH['delay'],
sxpatpaths.OUTPUT_PATH['json']
]:
FS.cleandir(directory)
if __name__ == "__main__":
main()