-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrun_90nm.py
More file actions
105 lines (58 loc) · 2.78 KB
/
run_90nm.py
File metadata and controls
105 lines (58 loc) · 2.78 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/env python3
import sys
import time
from chipsuite import GDSLoader, StitchingInfo, BboxGenerator, PowerLineDetector2, Algorithm, Algorithm2, Algorithm3_4, CellIdentifier
BENCHMARK = True
if sys.argv[1] == "fill":
ALGORITHM = 2
elif sys.argv[1] == "std":
ALGORITHM = 3
else:
print('Unsupported algorithm argument. Possible options are: "fill", "std".', file=sys.stderr)
sys.exit(1)
t = time.process_time()
t2 = time.monotonic()
print(f"It is now: {time.strftime('%c')}")
starttime = time.strftime('%c')
IMAGE_EDGES = [[23118, 27288], [141220, 27474], [141051, 145519], [22950, 145322]] # 4-edge transformation
gdsloader = GDSLoader()
gdsloader.load_gds("data/90nm/90nm.gds", IMAGE_EDGES, "R90", not BENCHMARK)
stitching_info = StitchingInfo()
stitching_info.load_mist_file("data/90nm/img-global-positions-0.txt")
stitching_info.set_image_folder("data/90nm/tiles")
stitching_info.parse_stitching_info()
bbox_generator = BboxGenerator(gdsloader.bboxes, stitching_info)
bbox_generator.set_corr_x(lambda x, y, px: round(px - (stitching_info.t_width - x) * y * 170 / (stitching_info.t_width*stitching_info.t_height)))
powerline_detector = PowerLineDetector2()
powerline_detector.set_values(2, 1, 120, 0.9, 0.8)
if ALGORITHM == 2:
algorithm = Algorithm2(bbox_generator, stitching_info, powerline_detector)
algorithm.set_html_output("90nm_fill_to_std.html")
algorithm.set_filler_optimal_repeat(27)
algorithm.set_filler_score_threshold(0.98)
algorithm.set_blur_values(11, 11, True)
algorithm.set_adaptive_threshold_values(11, -4)
algorithm.set_erode_dilate_values(2, 3)
algorithm.set_via_values(4, 15, 202, 0.6, 1)
algorithm.set_cell_crop(35, 30, 35, 20)
elif ALGORITHM == 3:
algorithm = Algorithm3_4(bbox_generator, stitching_info, powerline_detector)
algorithm.set_html_output("90nm_std_to_std.html")
algorithm.set_correlation_value(0.123)
algorithm.set_via_correlation_value(0.006)
algorithm.set_bsz(10)
algorithm.set_blur_values(11, 11, True)
algorithm.set_adaptive_threshold_values(11, -4)
algorithm.set_erode_dilate_values(2, 3)
algorithm.set_via_values(4, 15, 202, 0.6, 1)
algorithm.set_cell_identifier(CellIdentifier(algorithm))
algorithm.prepare()
algorithm.bboxes_on_edge = False
algorithm.set_cell_crop(15, -30, 5, -30)
algorithm.set_fract(8) # 1/n for the fused image
algorithm.set_interactive_mode(not BENCHMARK, 0)
algorithm.set_output_folder("output")
algorithm.analyze(Algorithm.MODE_ONLY_CELLS+1 if ALGORITHM >= 3 else Algorithm.MODE_DEFAULT, starttime, (10, 10))
print(f"Completed. Benchmark time of 90nm Algorithm {ALGORITHM}: {time.process_time() - t}")
print(f"Real time of 90nm Algorithm {ALGORITHM}: {time.monotonic() - t2}")
print(f"It is now: {time.strftime('%c')}")