Built-In Features to View STDF Content ====================================== There are a couple of built-in methods from the ``Reader``'s object to quickly view the STDF content. * show_known_records * show_header * show_structure * show_pattern * to_atdf Each of the methods here will output to the standard output stream. Keyword arguments provided to these methods will be passed on to the internal ``print`` command. This allow you to route the output to a text file instead of the stdout. For example:: from stdf import Reader std = Reader(stdf_file='input_file.std') with open('text_file.txt', mode='wt') as fout: std.show_known_records(file=fout) # print to file instead of stdout To understand more about the keywords that you can push to ``print``, visit this_. .. _this: https://docs.python.org/3.1/library/functions.html#print Listing Known STDF Records -------------------------- The method ``show_known_records()`` will not actually read the STDF file, but it will list down STDF records known by this library. :: std.show_known_records() By default, it will show the list of STDF V4.2007 records. It will return the 3-char STDF header (e.g. 'FAR') recorded in ``rec_name``, followed by the record fields which are the keys of the ``body`` (e.g. 'CPU TYPE'). :: FAR: CPU_TYPE STDF_VER ATR: MOD_TIM CMD_LINE VUR: UPD_NAM MIR: SETUP_T START_T STAT_NUM MODE_COD RTST_COD PROT_COD BURN_TIM CMOD_COD LOT_ID PART_TYP NODE_NAM TSTR_TYP JOB_NAM JOB_REV SBLOT_ID OPER_NAM EXEC_TYP EXEC_VER TEST_COD TST_TEMP USER_TXT AUX_FILE PKG_TYP FAMLY_ID DATE_COD FACIL_ID FLOOR_ID PROC_ID OPER_FRQ SPEC_NAM SPEC_VER FLOW_ID SETUP_ID DSGN_REV ENG_ID ROM_COD SERL_NUM SUPR_NAM MRR: FINISH_T DISP_COD USR_DESC EXC_DESC PCR: HEAD_NUM SITE_NUM PART_CNT RTST_CNT ABRT_CNT GOOD_CNT FUNC_CNT HBR: HEAD_NUM SITE_NUM HBIN_NUM HBIN_CNT HBIN_PF HBIN_NAM SBR: HEAD_NUM SITE_NUM SBIN_NUM SBIN_CNT SBIN_PF SBIN_NAM PMR: PMR_INDX CHAN_TYP CHAN_NAM PHY_NAM LOG_NAM HEAD_NUM SITE_NUM PGR: GRP_INDX GRP_NAM INDX_CNT PMR_INDX PLR: GRP_CNT GRP_INDX GRP_MODE GRP_RADX PGM_CHAR RTN_CHAR PGM_CHAL RTN_CHAL RDR: NUM_BINS RTST_BIN SDR: HEAD_NUM SITE_GRP SITE_CNT SITE_NUM HAND_TYP HAND_ID CARD_TYP CARD_ID LOAD_TYP LOAD_ID DIB_TYP DIB_ID CABL_TYP CABL_ID CONT_TYP CONT_ID LASR_TYP LASR_ID EXTR_TYP EXTR_ID PSR: CONT_FLG PSR_INDX PSR_NAM OPT_FLG TOTP_CNT LOCP_CNT PAT_BGN PAT_END PAT_FILE PAT_FILE PAT_LBL FILE_UID ATPG_DSC SRC_ID NMR: CONT_FLG NMR_INDX TOTM_CNT LOCM_CNT PMR_INDX ATPG_NAM CNR: CHN_NUM BIT_POS CELL_NAM SSR: SSR_NAM CHN_CNT CHN_LIST CDR: CONT_FLG CDR_INDX CHN_NAM CHN_LEN SIN_PIN SOUT_PIN MSTR_CNT M_CLKS SLAV_CNT S_CLKS INV_VAL LST_CNT CELL_LST WIR: HEAD_NUM SITE_GRP START_T WAFER_ID WRR: HEAD_NUM SITE_GRP FINISH_T PART_CNT RTST_CNT ABRT_CNT GOOD_CNT FUNC_CNT WAFER_ID FABWF_ID FRAME_ID MASK_ID USR_DESC EXC_DESC WCR: WAFR_SIZ DIE_HT DIE_WID WF_UNITS WF_FLAT CENTER_X CENTER_Y POS_X POS_Y PIR: HEAD_NUM SITE_NUM PRR: HEAD_NUM SITE_NUM PART_FLG NUM_TEST HARD_BIN SOFT_BIN X_COORD Y_COORD TEST_T PART_ID PART_TXT PART_FIX TSR: HEAD_NUM SITE_NUM TEST_TYP TEST_NUM EXEC_CNT FAIL_CNT ALRM_CNT TEST_NAM SEQ_NAME TEST_LBL OPT_FLAG TEST_TIM TEST_MIN TEST_MAX TST_SUMS TST_SQRS PTR: TEST_NUM HEAD_NUM SITE_NUM TEST_FLG PARM_FLG RESULT TEST_TXT ALARM_ID OPT_FLAG RES_SCAL LLM_SCAL HLM_SCAL LO_LIMIT HI_LIMIT UNITS C_RESFMT C_LLMFMT C_HLMFMT LO_SPEC HI_SPEC MPR: TEST_NUM HEAD_NUM SITE_NUM TEST_FLG PARM_FLG RTN_ICNT RSLT_CNT RTN_STAT RTN_RSLT TEST_TXT ALARM_ID OPT_FLAG RES_SCAL LLM_SCAL HLM_SCAL LO_LIMIT HI_LIMIT START_IN INCR_IN RTN_INDX UNITS UNITS_IN C_RESFMT C_LLMFMT C_HLMFMT LO_SPEC HI_SPEC FTR: TEST_NUM HEAD_NUM SITE_NUM TEST_FLG OPT_FLAG CYCL_CNT REL_VADR REPT_CNT NUM_FAIL XFAIL_AD YFAIL_AD VECT_OFF RTN_ICNT PGM_ICNT RTN_INDX RTN_STAT PGM_INDX PGM_STAT FAIL_PIN VECT_NAM TIME_SET OP_CODE TEST_TXT ALARM_ID PROG_TXT RSLT_TXT PATG_NUM SPIN_MAP STR: HEAD_NUM SITE_NUM TEST_TYP TEST_NUM EXEC_CNT FAIL_CNT ALRM_CNT TEST_NAM SEQ_NAME TEST_LBL OPT_FLAG TEST_TIM TEST_MIN TEST_MAX TST_SUMS TST_SQRS BPS: SEQ_NAME EPS: GDR: GEN_DATA DTR: TEXT_DAT Accessing STDF Header Content ----------------------------- The method ``show_header()`` will return the file's header records. :: std.show_header() Output example:: >>> FAR: STDF_VER = 4 FAR: CPU_TYPE = 2 VUR: UPD_NAM = MIR: TSTR_TYP = Jaguar MIR: MODE_COD = P MIR: PART_TYP = MPN-1234-5678 MIR: AUX_FILE = 0 MIR: DATE_COD = 0 MIR: RTST_COD = MIR: JOB_REV = JOB099 MIR: NODE_NAM = TESTER001 MIR: OPER_NAM = your_name MIR: USER_TXT = 0 MIR: FAMLY_ID = 0 MIR: PKG_TYP = 0 MIR: JOB_NAM = custom_job_name MIR: SBLOT_ID = 0 MIR: STAT_NUM = 1 MIR: EXEC_TYP = IG-XL MIR: PROT_COD = MIR: EXEC_VER = 8.10.30_uflx MIR: FACIL_ID = YOUR_FACIL MIR: LOT_ID = ABC1234.XYZ MIR: START_T = 1431565397 MIR: SETUP_T = 1431565385 MIR: TEST_COD = PRN MIR: TST_TEMP = 25C MIR: BURN_TIM = 65535 MIR: CMOD_COD = SDR: HEAD_NUM = 1 SDR: SITE_CNT = 2 SDR: SITE_NUM = [0, 1] SDR: SITE_GRP = 255 Actual STDF Records ------------------- Every STDF files always starts with 'FAR' record and ends with 'MRR'. In between, there are plenty of optional records that might or might not exist. ``show_structure()`` is useful to get a quick look of what records available in the file. :: std.show_structure() will return something like this. :: FAR :1x MIR :1x SDR :1x PMR :1x PGR :1x PLR :1x PIR :8x BPS :1x PTR/MPR/FTR/PSR/STR/DTR :100x EPS :1x PRR :8x PIR :8x BPS :1x PTR/MPR/FTR/PSR/STR/DTR :100x EPS :1x PRR :8x PIR :8x BPS :1x PTR/MPR/FTR/PSR/STR/DTR :100x EPS :1x PRR :8x PIR :8x BPS :1x PTR/MPR/FTR/PSR/STR/DTR :100x EPS :1x PRR :8x PIR :8x BPS :1x PTR/MPR/FTR/PSR/STR/DTR :100x EPS :1x PRR :8x TSR :1x HBR :1x SBR :1x PCR :1x the ``:nx`` that follows record name indicates how many consecutive occurrences appeared in the file. For example, ``FAR :1x`` means that the record ``FAR`` appeared only once. ``PIR :8x`` means that there's 8 consecutive ``PIR`` records found before ``BPS`` record is found. ``PTR/MPR/FTR/PSR/STR/DTR :100x`` indicates that between ``BPS`` and ``EPS``, there are 100 occurrences of other records, and any of these 100 records can be a ``PTR``, ``MPR``, ``FTR``, ... , ``DTR``. Visualizing Each STDF Records ----------------------------- This is an experimental function meant to visualize the STDF file better. Calling the following method: :: std.show_pattern() will print out something like this. :: FAR**MIR**************************************SDR********************PMR*******. ................................................................................ ..............................................................................PG R****...............................PLR********PIR**.......BPS*PTR************** ******.......................................................................... ................................................................................ ................................................................................ DTR*........PTR********************............................................. ................................................................................ ................................................................................ ..................................................EPSPRR************.......HBR** ****........SBR******........PCR*******........MRR**** For every STDF records (``FAR``, ``MIR``, ``SDR``, etc) has its own unique fields. Each unique field is represented as ``*``. This means, ``FAR**`` shows what there are 2 fields belong to ``FAR``, and ``MRR****`` shows that there are 4 fields for ``MRR``. Note that ``EPS`` has zero field. Each ``.`` represent repetition of the record before it. ``PIR**.......`` (7 dots) means that there are total 8 consecutive ``PIR`` records, each with 2 fields represented by ``*``. Converting STDF to ATDF Format ------------------------------ When it is easier to convert the whole binary STDF file to ASCII to process it further, run this. :: with open('textfile.txt', mode='wt') as f: stdf.to_atdf(file=f) Running it without ``file=f`` option will write the converted ASCII to your output data stream, which might give a problem given the typical size of an STDF file. Visit this `ATDF spec`_ to see a more detailed ATDF format. .. _`ATDF spec`: https://sourceforge.net/p/freestdf/svn/HEAD/tree/docs/atdf-spec.pdf?format=raw