-
Notifications
You must be signed in to change notification settings - Fork 1
/
stdf_V3.py
executable file
·396 lines (365 loc) · 10.7 KB
/
stdf_V3.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
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
"""
The main object should be used from this module is:
Rec_Dict3
which is a dictionary with (typ,sub) tuple as its keys
and a record instance as its value. For each record instance,
there's is a field: fieldMap to define the record binary structure.
"""
from stdf_V4 import RecordMeta
class Far:
__metaclass__ = RecordMeta
typ = 0
sub = 10
fieldMap = ( ('CPU_TYPE', 'U1'),
('STDF_VER', 'U1') )
class Mir:
__metaclass__ = RecordMeta
typ = 1
sub = 10
fieldMap = ( ('CPU_TYPE', 'U1'),
('STDF_VER', 'U1'),
('MODE_COD', 'C1'),
('STAT_NUM', 'U1'),
('TEST_COD', 'C3'),
('RTST_COD', 'C1'),
('PROT_COD', 'C1'),
('CMOD_COD', 'C1'),
('SETUP_T', 'U4'),
('START_T', 'U4'),
('LOT_ID', 'Cn'),
('PART_TYP', 'Cn'),
('JOB_NAM', 'Cn'),
('OPER_NAM', 'Cn'),
('NODE_NAM', 'Cn'),
('TSTR_TYP', 'Cn'),
('EXEC_TYP', 'Cn'),
('SUPR_NAM', 'Cn'),
('HAND_ID', 'Cn'),
('SBLOT_ID', 'Cn'),
('JOB_REV', 'Cn'),
('PROC_ID', 'Cn'),
('PRB_CARD', 'Cn') )
class Mrr:
__metaclass__ = RecordMeta
typ = 1
sub = 20
fieldMap = ( ('FINISH_T', 'U4'),
('PART_CNT', 'U4'),
('RTST_CNT', 'I4'),
('ABRT_CNT', 'I4'),
('GOOD_CNT', 'I4'),
('FUNC_CNT', 'I4'),
('DISP_COD', 'C1'),
('USR_DESC', 'Cn'),
('EXC_DESC', 'Cn') )
class Wir:
__metaclass__ = RecordMeta
typ = 2
sub = 10
fieldMap = ( ('HEAD_NUM', 'U1'),
('PAD_BYTE', 'B1'),
('START_T', 'U4'),
('WAFER_ID', 'Cn') )
class Wrr:
__metaclass__ = RecordMeta
typ = 2
sub = 20
fieldMap = ( ('FINISH_T', 'U4'),
('HEAD_NUM', 'U1'),
('PAD_BYTE', 'B1'),
('PART_CNT', 'U4'),
('RTST_CNT', 'I4'),
('ABRT_CNT', 'I4'),
('GOOD_CNT', 'I4'),
('FUNC_CNT', 'I4'),
('WAFER_ID', 'Cn'),
('HAND_ID', 'Cn'),
('PRB_CARD', 'Cn'),
('USR_DESC', 'Cn'),
('EXC_DESC', 'Cn') )
class Hbr:
__metaclass__ = RecordMeta
typ = 1
sub = 40
fieldMap = ( ('HBIN_NUM', 'U2'),
('HBIN_CNT', 'U4'),
('HBIN_NAM', 'Cn') )
class Sbr:
__metaclass__ = RecordMeta
typ = 1
sub = 50
fieldMap = ( ('SBIN_NUM', 'U2'),
('SBIN_CNT', 'U4'),
('SBIN_NAM', 'Cn') )
class Tsr:
__metaclass__ = RecordMeta
typ = 10
sub = 30
fieldMap = ( ('TEST_NUM', 'U4'),
('EXEC_CNT', 'I4'),
('FAIL_CNT', 'I4'),
('ALRM_CNT', 'I4'),
('OPT_FLAG', 'B1'),
('PAD_BYTE', 'B1'),
('TEST_MIN', 'R4'),
('TEST_MAX', 'R4'),
('TST_MEAN', 'R4'),
('TST_SDEV', 'R4'),
('TST_SUMS', 'R4'),
('TST_SQRS', 'R4'),
('TEST_NAM', 'Cn'),
('SEQ_NAME', 'Cn') )
class Pir:
__metaclass__ = RecordMeta
typ = 5
sub = 10
fieldMap = ( ('HEAD_NUM', 'U1'),
('SITE_NUM', 'U1'),
('X_COORD', 'I2'),
('Y_COORD', 'I2'),
('PART_ID', 'Cn') )
class Prr:
__metaclass__ = RecordMeta
typ = 5
sub = 20
fieldMap = ( ('HEAD_NUM', 'U1'),
('SITE_NUM', 'U1'),
('NUM_TEST', 'U2'),
('HARD_BIN', 'U2'),
('SOFT_BIN', 'U2'),
('PART_FLG', 'B1'),
('PAD_BYTE', 'B1'),
('X_COORD', 'I2'),
('Y_COORD', 'I2'),
('PART_ID', 'Cn'),
('PART_TXT', 'Cn'),
('PART_FIX', 'Bn') )
class Fdr:
__metaclass__ = RecordMeta
typ = 10
sub = 20
fieldMap = ( ('TEST_NUM', 'U4'),
('DESC_FLG', 'B1'),
('TEST_NAM', 'Cn'),
('SEQ_NAME', 'Cn') )
class Ftr:
__metaclass__ = RecordMeta
typ = 15
sub = 20
fieldMap = ( ('TEST_NUM', 'U4'),
('HEAD_NUM', 'U1'),
('SITE_NUM', 'U1'),
('TEST_FLG', 'B1'),
('DESC_FLG', 'B1'),
('OPT_FLAG', 'B1'),
('TIME_SET', 'U1'),
('VECT_ADR', 'U4'),
('CYCL_CNT', 'U4'),
('REPT_CNT', 'U2'),
('PCP_ADR', 'U2'),
('NUM_FAIL', 'U4'),
('FAIL_PIN', 'Bn'),
('VECT_DAT', 'Bn'),
('DEV_DAT', 'Bn'),
('RPIN_MAP', 'Bn'),
('TEST_NAM', 'Cn'),
('SEQ_NAME', 'Cn'),
('TEST_TXT', 'Cn') )
class Pdr:
__metaclass__ = RecordMeta
typ = 10
sub = 10
fieldMap = ( ('TEST_NUM', 'U4'),
('DESC_FLG', 'B1'),
('OPT_FLAG', 'B1'),
('RES_SCAL', 'I1'),
('UNITS', 'C7'),
('RES_LDIG', 'U1'),
('RES_RDIG', 'U1'),
('LLM_SCAL', 'I1'),
('HLM_SCAL', 'I1'),
('LLM_LDIG', 'U1'),
('LLM_RDIG', 'U1'),
('HLM_LDIG', 'U1'),
('HLM_RDIG', 'U1'),
('LO_LIMIT', 'R4'),
('HI_LIMIT', 'R4'),
('TEST_NAM', 'Cn'),
('SEQ_NAME', 'Cn') )
class Ptr:
__metaclass__ = RecordMeta
typ = 15
sub = 10
fieldMap = ( ('TEST_NUM', 'U4'),
('HEAD_NUM', 'U1'),
('SITE_NUM', 'U1'),
('TEST_FLG', 'B1'),
('PARM_FLG', 'B1'),
('RESULT', 'R4'),
('OPT_FLAG', 'B1'),
('RES_SCAL', 'I1'),
('RES_LDIG', 'U1'),
('RES_RDIG', 'U1'),
('DESC_FLG', 'B1'),
('UNITS', 'C7'),
('LLM_SCAL', 'I1'),
('HLM_SCAL', 'I1'),
('LLM_LDIG', 'U1'),
('LLM_RDIG', 'U1'),
('HLM_LDIG', 'U1'),
('HLM_RDIG', 'U1'),
('LO_LIMIT', 'R4'),
('HI_LIMIT', 'R4'),
('TEST_NAM', 'Cn'),
('SEQ_NAME', 'Cn'),
('TEST_TXT', 'Cn') )
# The following records are STDF+ specific and
# additional defined to the STDF (standard Teradyne format)
class Brr:
__metaclass__ = RecordMeta
typ = 220
sub = 201
fieldMap = ( ('RTST_COD', 'C1'),
('BIN_CNT', 'U2'),
('BIN_NUM', 'U2') )
class Wtr:
__metaclass__ = RecordMeta
typ = 220
sub = 202
fieldMap = ( ('TEST_TYPE', 'C1') )
class Etsr:
__metaclass__ = RecordMeta
typ = 220
sub = 203
fieldMap = ( ('TEST_NUM', 'U4'),
('EXEC_CNT', 'I4'),
('FAIL_CNT', 'I4'),
('ALRM_CNT', 'I4'),
('TEST_10', 'R4'),
('TEST_90', 'R4'),
('OPT_FLAG', 'B1'),
('PAD_BYTE', 'B1'),
('TEST_MIN', 'R4'),
('TEST_MAX', 'R4'),
('TST_MEAN', 'R4'),
('TST_SDEV', 'R4'),
('TST_SUMS', 'R4'),
('TST_SQRS', 'R4'),
('TEST_NAM', 'Cn'),
('SEQ_NAME', 'Cn') )
class EtsrV3:
__metaclass__ = RecordMeta
typ = 220
sub = 203
fieldMap = ( ('TEST_NUM', 'U4'),
('EXEC_CNT', 'I4'),
('FAIL_CNT', 'I4'),
('ALRM_CNT', 'I4'),
('OPT_FLAG_QU', 'B1'),
('TEST_05', 'R4'),
('TEST_10', 'R4'),
('TEST_50', 'R4'),
('TEST_90', 'R4'),
('TEST_95', 'R4'),
('OPT_FLAG', 'B1'),
# ('PAD_BYTE', 'B1'),
('TEST_MIN', 'R4'),
('TEST_MAX', 'R4'),
('TST_MEAN', 'R4'),
('TST_SDEV', 'R4'),
('TST_SUMS', 'R4'),
('TST_SQRS', 'R4'),
('TEST_NAM', 'Cn'),
('SEQ_NAME', 'Cn') )
class Gtr:
__metaclass__ = RecordMeta
typ = 220
sub = 204
fieldMap = ( ('TEXT_NAME', 'C16'),
('TEXT_VAL', 'Cn') )
class Adr:
__metaclass__ = RecordMeta
typ = 220
sub = 205
fieldMap = ( ('CPU_TYPE', 'U1'),
('STDF_VER', 'Cn'),
('DB_ID', 'U1'),
('PARA_CNT', 'U2'),
('LOT_FLG', 'U1'),
('RTST_CNT', 'U2'),
('LOT_TYPE', 'C1'),
('RTST_WAF', 'K5Cn'),
('RTST_BIN', 'K5U4') )
class Epdr:
__metaclass__ = RecordMeta
typ = 220
sub = 206
fieldMap = ( ('TEST_NUM', 'U4'),
('OPT_FLAG', 'B1'),
('CAT', 'C2'),
('TARGET', 'R4'),
('SPC_FLAG', 'C2'),
('LVL', 'R4'),
('HVL', 'R4'),
('TEST_NAM', 'Cn') )
class Gdr:
__metaclass__ = RecordMeta
typ = 50
sub = 10
fieldMap = ( ('FLD_CNT', 'U2'),
('GEN_DATA', 'K0Vn') )
class Shb:
"""SiteSpecificHardwareBinRecord (STDF_V3+ only)
"""
__metaclass__ = RecordMeta
typ = 25
sub = 10
fieldMap = ()
class Ssb:
""" SiteSpecificSoftwareBinRecord (STDF_V3+ only)
"""
__metaclass__ = RecordMeta
typ = 25
sub = 20
fieldMap = ()
class Sts:
""" SiteSpecificTestSynopsisRecord (STDF_V3+ only)
"""
__metaclass__ = RecordMeta
typ = 25
sub = 30
fieldMap = ()
class Scr:
""" SiteSpecificPartCountRecord (STDF_V3+ only)
"""
__metaclass__ = RecordMeta
typ = 25
sub = 40
fieldMap = ()
class Bps:
__metaclass__ = RecordMeta
typ = 20
sub = 10
fieldMap = (
('SEQ_NAME','Cn'),
)
class Eps:
__metaclass__ = RecordMeta
typ = 20
sub = 20
fieldMap = ()
class Dtr:
__metaclass__ = RecordMeta
typ = 50
sub = 30
fieldMap = (
('TEXT_DAT', 'Cn'),
)
Records = [Far(), Mir(), Mrr(), Wir(), Wrr(), Hbr(), Sbr(),
Tsr(), Pir(), Prr(), Fdr(), Ftr(), Pdr(), Ptr(),
Brr(), Wtr(), EtsrV3(), Gtr(), Adr(), Epdr(),
Gdr(), Shb(), Ssb(), Sts(), Scr(), Bps(), Eps(),
Dtr()]
Rec_Dict3 = {}
for r in Records:
Rec_Dict3[(r.typ, r.sub)] = r