#
# PySTDF - The Pythonic STDF Parser
# Copyright (C) 2006 Casey Marshall
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""
STDF Record Types
-----------------
====== ==================================== ============
Record Type PySTDF Class
====== ==================================== ============
ATR Audit Trail Record :class:`pystdf.V4.Atr`
BPS Begin Program Section Record :class:`pystdf.V4.Bps`
DTR Datalog Text Record :class:`pystdf.V4.Dtr`
EPS End Program Section Record :class:`pystdf.V4.Eps`
FAR File Attributes Record :class:`pystdf.V4.Far`
FTR Functional Test Record :class:`pystdf.V4.Ftr`
GDR Generic Data Record :class:`pystdf.V4.Gdr`
HBR Hardware Bin Record :class:`pystdf.V4.Hbr`
MIR Master Information Record :class:`pystdf.V4.Mir`
MPR Multiple-Result Parametric Record :class:`pystdf.V4.Mpr`
MRR Master Results Record :class:`pystdf.V4.Mrr`
PCR Part Count Record :class:`pystdf.V4.Pcr`
PGR Pin Group Record :class:`pystdf.V4.Pgr`
PIR Part Information Record :class:`pystdf.V4.Pir`
PLR Pin List Record :class:`pystdf.V4.Plr`
PMR Pin Map Record :class:`pystdf.V4.Pmr`
PRR Part Results Record :class:`pystdf.V4.Prr`
PTR Parametric Test Record :class:`pystdf.V4.Ptr`
RDR Retest Data Record :class:`pystdf.V4.Rdr`
SBR Software Bin Record :class:`pystdf.V4.Sbr`
SDR Site Description Record :class:`pystdf.V4.Sdr`
TSR Test Synopsis Record :class:`pystdf.V4.Tsr`
WCR Wafer Configuration Record :class:`pystdf.V4.Wcr`
WIR Wafer Information Record :class:`pystdf.V4.Wir`
WRR Wafer Results Record :class:`pystdf.V4.Wrr`
====== ==================================== ============
Data Type Codes and Representation
----------------------------------
====== =================================================== ===================
Code Description C Type Specifier
====== =================================================== ===================
C*12 Fixed length character string: char[12]
If a fixed length character string does not fill
the entire field, it must be left-justified and
padded with spaces.
C*n Variable length character string: char[]
first byte = unsigned count of bytes to follow
(maximum of 255 bytes)
C*f Variable length character string: char[]
string length is stored in another field
U*1 One byte unsigned integer unsigned char
U*2 Two byte unsigned integer unsigned short
U*4 Four byte unsigned integer unsigned long
I*1 One byte signed integer char
I*2 Two byte signed integer short
I*4 Four byte signed integer long
R*4 Four byte floating point number float
R*8 Eight byte floating point number long float (double)
B*6 Fixed length bit-encoded data char[6]
V*n Variable data type field:
The data type is specified by a code in the
first byte, and the data follows
(maximum of 255 bytes)
B*n Variable length bit-encoded field: char[]
First byte = unsigned count of bytes to follow
(maximum of 255 bytes).
First data item in least significant bit of the
second byte of the array (first byte is count.)
D*n Variable length bit-encoded field: char[]
First two bytes = unsigned count of bits to
follow (maximum of 65,535 bits).
First data item in least significant bit of the
third byte of the array (first two bytes are
count).
Unused bits at the high order end of the last
byte must be zero.
N*1 Unsigned integer data stored in a nibble. char
First item in low 4 bits, second item in high
4 bits. If an odd number of nibbles is indicated,
the high nibble of the byte will be zero. Only
whole bytes can be written to the STDF file.
kxTYPE Array of data of the type specified. TYPE[]
The value of *k* (the number of elements in the
array) is defined in an earlier field in the
record. For example, an array of short unsigned
integers is defined as kxU*2.
====== =================================================== ===================
"""
import sys
from pystdf.Types import StdfRecordMeta, RecordType, stdfToLogicalType
from pystdf import TableTemplate
import pdb
class Far(RecordType, metaclass=StdfRecordMeta):
"""
**File Attributes Record (FAR)**
Function:
Contains the information necessary to determine how to decode
the STDF data contained in the file.
Data Fields:
======== ==== ========================================= ====================
Name Type Description Missing/Invalid Flag
======== ==== ========================================= ====================
REC_LEN U*2 Bytes of data following header
REC_TYP U*1 Record type(0)
REC_SUB U*1 Record sub-type (10)
CPU_TYPE U*1 CPU type that wrote this file
STDF_VER U*1 STDF version number
======== ==== ========================================= ====================
Notes on Specific Fields:
CPU_TYPE:
Indicates which type of CPU wrote this STDF file. This information is
useful for determining the CPU-dependent data representation of the
integer and floating point fields in the file's records. The valid values
are:
- 0: DEC PDP-11 and VAX processors. F and D floating point formats
will be used. G and H floating point formats will not be used.
- 1: Sun1,2,3, and 4computers.
- 2: Sun 386i computers, and IBM PC, IBM PC-AT, and IBM PC-XT
computers.
- 3-127: Reserved for future use by Teradyne.
- 128-255: Reserved for use by customers.
A code defined here may also be valid for other CPU types whose data
formats are fully compatible with that of the type listed here. Before
using one of these codes for a CPU type not listed here, please check
with the Teradyne hotline, which can provide additional information on CPU
compatibility.
STDF_VER:
Identifies the version number of the STDF specification used in generating
the data. This allows data analysis programs to handle STDF specification
enhancements.
Location:
Required as the first record of the file.
"""
typ = 0
sub = 10
fieldMap = (
('CPU_TYPE', 'U1'),
('STDF_VER', 'U1')
)
class Atr(RecordType, met
一个平平无奇的解析code
需积分: 0 157 浏览量
2023-03-23
09:38:48
上传
评论
收藏 90KB ZIP 举报
代码搬运工99号
- 粉丝: 0
- 资源: 3
最新资源
- Music-Player +PlayerActivity+ rockplayer+ SeeJoPlayer 播放器JAVA源码
- vscode-1.46.0.tar源码文件
- 最近很火植物大战僵尸杂交版2.08苹果+安卓+PC+防闪退工具V2+修改工具+高清工具+通关存档整合包更新
- 超级好用的截图工具PixPin,可录制Gif图
- Screenshot_2024-05-21-17-06-42-64_2332cb9b27b851b548ba47a91682926c.jpg
- 毕业设计参考 - 基于树莓派、OpenCV及Python的人脸识别
- node-v18.20.2-linux-arm64
- 222222222222
- 16张相机标定图片,可复现本文畸变矫正
- dbeaver-ce-23.3.1-x86_64-setup.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈