-
Notifications
You must be signed in to change notification settings - Fork 0
/
pstemplate.h
320 lines (315 loc) · 8.65 KB
/
pstemplate.h
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
const char ps_templ_prolog_begin[] =
{
"%!PS-Adobe-3.0\n"
"%%BoundingBox: 0 0 590 840\n"
"%%Pages: (atend)\n"
"%%DocumentPaperSizes: a4\n"
"%%EndComments\n"
"\n"
"%%BeginProlog\n"
"/LOCAL 10 dict def\n"
"/fontSize { /Helvetica findfont exch scalefont setfont }def\n"
"/colorText { 0 setgray }def\n"
"/colorLine { 0 setgray }def\n"
"/colorBgd { 0.95 setgray }def\n"
"/colorBar { 1.0 0.8 0.0 setrgbcolor}def\n"
};
const char ps_templ_logo[] =
{
"/logo\n"
"{\n"
" newpath 72 20 20 0 360 arc closepath 0.8 setgray fill\n"
" newpath 52 20 20 0 360 arc closepath 0.7 setgray fill\n"
" /Helvetica-Bold findfont [41 0 8 16 0 0] makefont setfont\n"
" 0 setgray\n"
" newpath 0 11 moveto (WMap) true charpath\n"
" gsave 1 setgray fill grestore\n"
" 0.3 setlinewidth stroke\n"
"\n"
" /Helvetica findfont [10 0 4 8 0 0] makefont setfont\n"
" 0 setgray\n"
" 5 0 moveto (Beat Meier) show\n"
"\n"
" /Helvetica-Bold findfont [16 0 4 8 0 0] makefont setfont\n"
" 3 0 rmoveto (PSI LTP) show\n"
"\n"
" /Helvetica findfont [10 0 0 12 0 0] makefont setfont\n"
" 5 -15 moveto (Version %s) show\n"
"} bind def\n"
"\n"
};
const char ps_templ_wmap[] =
{
"% wafer map -----------------------------------------------\n"
"\n"
"% periodicity (notch right)\n"
"/pitchX 17.658 def\n"
"/pitchY 21.338 def\n"
"\n"
"/colorWafer { 0.9 setgray }def\n"
"/colorRect { 0.7 setgray }def\n"
"\n"
"/colorBinTable\n"
"[\n"
"[ 0.00 0.00 0.00 ] % 0\n"
"[ 0.50 0.50 0.50 ] % 1\n"
"[ 0.78 0.78 0.78 ] % 2\n"
"[ 1.00 1.00 1.00 ] % 3\n"
"[ 0.59 0.00 0.00 ] % 4\n"
"[ 1.00 0.00 0.00 ] % 5\n"
"[ 1.00 0.35 0.39 ] % 6\n"
"[ 1.00 0.55 0.51 ] % 7\n"
"[ 1.00 0.78 0.75 ] % 8\n"
"[ 1.00 0.47 0.28 ] % 9\n"
"[ 0.71 0.39 0.00 ] % 10\n"
"[ 0.78 0.55 0.00 ] % 11\n"
"[ 1.00 0.71 0.00 ] % 12\n"
"[ 1.00 0.82 0.39 ] % 13\n"
"[ 0.40 0.36 0.125 ] % 14\n"
"[ 0.61 0.61 0.125 ] % 15\n"
"[ 1.00 1.00 0.00 ] % 16\n"
"[ 0.90 1.00 0.71 ] % 17\n"
"[ 0.00 0.00 1.00 ] % 18\n"
"[ 0.00 0.39 1.00 ] % 19\n"
"[ 0.00 0.71 1.00 ] % 20\n"
"[ 0.00 1.00 1.00 ] % 21\n"
"[ 0.55 1.00 1.00 ] % 22\n"
"[ 0.44 0.00 0.63 ] % 23\n"
"[ 1.00 0.00 1.00 ] % 24\n"
"[ 0.71 0.43 1.00 ] % 25\n"
"[ 1.00 0.70 1.00 ] % 26\n"
"[ 0.00 0.39 0.00 ] % 27\n"
"[ 0.00 0.78 0.00 ] % 28\n"
"[ 0.47 1.00 0.16 ] % 29\n"
"[ 0.71 1.00 0.51 ] % 30\n"
"[ 0.16 1.00 0.63 ] % 31\n"
"] def\n"
"\n"
"/colorBin\n"
"{\n"
" colorBinTable exch get aload pop setrgbcolor\n"
"} bind def\n"
"\n"
"/legendEntry\n"
"{\n"
" gsave\n"
" translate\n"
" newpath\n"
" 0 0 moveto 6 0 lineto 6 4 lineto 0 4 lineto closepath\n"
" colorBin fill\n"
" newpath\n"
" 0 0 moveto 6 0 lineto 6 4 lineto 0 4 lineto closepath\n"
" 0 setgray 0.2 setlinewidth stroke\n"
" 8 0.5 moveto show\n"
" 10 string cvs dup stringwidth pop neg -2 add 0.5 moveto show\n"
" grestore\n"
"}bind def\n"
"\n"
"/legend_bin\n"
"{\n"
" 5 fontSize\n"
" yield 0 get (ok) 28 -95 -110 legendEntry\n"
" yield 1 get (shortcut) 5 -95 -116 legendEntry\n"
" yield 2 get (I < 5mA) 16 -95 -122 legendEntry\n"
" yield 3 get (missing token) 9 -95 -128 legendEntry\n"
" yield 4 get (i2c error) 17 -95 -134 legendEntry\n"
" \n"
" yield 5 get (>= 5 dcol defect) 23 -25 -110 legendEntry\n"
" yield 6 get (2...4 dcol defect) 24 -25 -116 legendEntry\n"
" yield 7 get (1 dcol defect) 26 -25 -122 legendEntry\n"
"\n"
" yield 8 get (>= 30 pixel defect) 14 45 -110 legendEntry\n"
" yield 9 get (10...29 pixel defect)18 45 -116 legendEntry\n"
" yield 10 get (3...9 pixel defect) 19 45 -122 legendEntry\n"
" yield 11 get (2 pixel defect) 21 45 -128 legendEntry\n"
" yield 12 get (1 pixel defect) 30 45 -134 legendEntry\n"
"}def\n"
"\n"
"/legend_fail\n"
"{\n"
" 5 fontSize\n"
" yield 0 get (CL5: shortcut) 5 -110 -110 legendEntry\n"
" yield 1 get (CL5: IdigOn <5mA) 4 -110 -116 legendEntry\n"
" yield 2 get (CL5: missing token) 7 -110 -122 legendEntry\n"
" yield 3 get (CL5: i2c error) 8 -110 -128 legendEntry\n"
" yield 4 get (CL5: >4000 pix def) 9 -110 -134 legendEntry\n"
" yield 6 get (CL4: >40 pix def) 16 -110 -140 legendEntry\n"
" yield 7 get (CL4: mask def) 10 -110 -146 legendEntry\n"
" yield 8 get (CL4: address def) 12 -110 -152 legendEntry\n"
" \n"
" yield 9 get (CL4: IdigOn >45mA) 14 -40 -110 legendEntry\n"
" yield 10 get (CL4: IanaOn >10mA) 15 -40 -116 legendEntry\n"
" yield 11 get (CL4: IdigInit) 17 -40 -122 legendEntry\n"
" yield 12 get (CL4: IanaInit) 3 -40 -128 legendEntry\n"
" yield 13 get (CL3: >4 pix def) 26 -40 -134 legendEntry\n"
" yield 14 get (CL3: Thr mean) 23 -40 -140 legendEntry\n"
" yield 15 get (CL3: Thr stdev) 24 -40 -146 legendEntry\n"
" yield 16 get (CL3: Thr col diff) 25 -40 -152 legendEntry\n"
" \n"
" yield 17 get (CL3: Ph Offset) 31 45 -110 legendEntry\n"
" yield 18 get (CL3: Ph Gain) 20 45 -116 legendEntry\n"
" yield 19 get (CL3: Ph col diff) 22 45 -122 legendEntry\n"
" yield 20 get (CL3: ID tolerance) 1 45 -128 legendEntry\n"
" yield 21 get (CL3: IA tolerance) 2 45 -134 legendEntry\n"
" yield 22 get (CL2: 1..4 pix def) 18 45 -140 legendEntry\n"
" yield 23 get (CL1: good) 28 45 -146 legendEntry\n"
"}def\n"
"\n"
"/legend_class\n"
"{\n"
" 5 fontSize\n"
" yield 0 get (Class 1) 28 -95 -110 legendEntry\n"
" yield 1 get (Class 2) 18 -95 -116 legendEntry\n"
" yield 2 get (Class 3) 23 -25 -110 legendEntry\n"
" yield 3 get (Class 4) 16 -25 -116 legendEntry\n"
" yield 4 get (Class 5) 5 45 -113 legendEntry\n"
"}def\n"
"\n"
"/waferCoords\n"
"{\n"
" gsave\n"
" pitchX pitchY scale\n"
" -4.97 -4.12 translate\n"
" newpath\n"
" 0 1 10 { 0 moveto 0 9.08 rlineto }for\n"
" 0 1 8 { -1.1 exch moveto 11.1 0 rlineto }for\n"
" 0.005 setlinewidth stroke\n"
" newpath\n"
" 0.5 0 moveto 0.5 1 lineto\n"
" 0 0.5 moveto 1 0.5 lineto\n"
" stroke\n"
" 0.4 fontSize\n"
" 0.09 0.08 moveto (C)show\n"
" 0.59 0.08 moveto (D)show\n"
" 0.09 0.58 moveto (A)show\n"
" 0.59 0.58 moveto (B)show \n"
"\n"
" 0.25 fontSize\n"
" 0.33 8.9 moveto (Y0) show\n"
" 1.33 8.9 moveto (Y1) show\n"
" 2.33 8.9 moveto (Y2) show\n"
" 3.33 8.9 moveto (Y3) show\n"
" 4.33 8.9 moveto (Y4) show\n"
" 5.33 8.9 moveto (Y5) show\n"
" 6.33 8.9 moveto (Y6) show\n"
" 7.33 8.9 moveto (Y7) show\n"
" 8.33 8.9 moveto (Y8) show\n"
" 9.33 8.9 moveto (Y9) show\n"
" -1.1 7.42 moveto (0X) show\n"
" -1.1 6.42 moveto (1X) show\n"
" -1.1 5.42 moveto (2X) show\n"
" -1.1 4.42 moveto (3X) show\n"
" -1.1 3.42 moveto (4X) show\n"
" -1.1 2.42 moveto (5X) show\n"
" -1.1 1.42 moveto (6X) show\n"
" -1.1 0.42 moveto (7X) show\n"
" grestore\n"
"}bind def\n"
"\n"
"/waferOutline\n"
"{\n"
" newpath\n"
" 0 0 100 8 352 arc\n"
" closepath\n"
"} bind def\n"
"\n"
"/rectOutline\n"
"{\n"
" newpath\n"
" 0 0 moveto\n"
" 16.9 0 lineto\n"
" 16.9 20.6 lineto\n"
" 0 20.6 lineto\n"
" closepath\n"
"} bind def\n"
"\n"
"/chipPos\n"
"{ % ABCD\n"
" [0.05 0.1 8.48 0.1 0.05 10.32 8.45 10.32]\n"
" exch 2 mul 2 getinterval aload pop translate\n"
"} bind def\n"
"\n"
"/chipOutline\n"
"{\n"
" newpath\n"
" 0 0 moveto\n"
" 8.35 0 rlineto\n"
" 0 10.2 rlineto\n"
" -8.35 0 rlineto\n"
" closepath\n"
"} bind def\n"
"\n"
"/rectPos\n"
"{\n"
" pitchY neg mul exch pitchX mul exch translate\n"
" -87.316 62.0 translate\n"
"% /pitchX 17.658 def\n"
"% /pitchY 21.338 def\n"
"% -52.0 62.0 translate\n"
"} bind def\n"
"\n"
"/chip\n"
"{\n"
" gsave\n"
" rectPos\n"
" chipPos\n"
" colorBin\n"
" chipOutline fill\n"
" chipOutline 0.2 setlinewidth colorLine stroke\n"
" grestore\n"
"} bind def\n"
"\n"
"/rect\n"
"{\n"
" gsave\n"
" rectPos\n"
" rectOutline colorRect fill\n"
" grestore\n"
"} bind def\n"
"\n"
"/waferMap\n"
"{\n"
" waferCoords\n"
" legend\n"
" 0.3 setlinewidth\n"
" waferOutline colorWafer fill\n"
" gsave\n"
" waferOutline clip\n"
" -1 1 8 { 0 1 10 { 1 index rect } for pop } for\n"
" -1 1 rect -1 2 rect -1 5 rect -1 6 rect \n"
" { aload pop chip } forall\n"
" \n"
" 6 fontSize colorText\n"
" -90 0 translate 90 rotate\n"
" waferId\n"
" dup stringwidth pop -2 div 0 moveto \n"
" show\n"
"\n"
" grestore\n"
" waferOutline colorLine stroke\n"
"} bind def\n"
"\n"
"/wafermapPage\n"
"{\n"
" 18 fontSize colorText\n"
" 62 780 moveto (Wafer ID:) show\n"
" 180 780 moveto waferId show\n"
" 62 760 moveto (ROC type:) show\n"
" 180 760 moveto productId show\n"
" 62 740 moveto (Tested:) show\n"
" 180 740 moveto testDate show\n"
" 62 720 moveto (Test center:) show\n"
" 180 720 moveto center show\n"
" 62 700 moveto (Yield (CL1):) show\n"
" 180 700 moveto Result show\n"
" 62 680 moveto (Plot type:) show\n"
" 180 680 moveto plotType show\n"
"\n"
" gsave 450 40 translate 0.7 0.7 scale logo grestore\n"
" gsave\n"
" 314 420 translate\n"
" 2.3 2.3 scale\n"
" waferMap\n"
" grestore\n"
"} def\n"
};