Semi-ATE / STDF

STDF Library
MIT License
40 stars 19 forks source link

JSON input/output support #23

Open seimit opened 3 years ago

seimit commented 3 years ago

Requested by Tom : STDF should be able to save and load STDF records in JSON file format. The format should be specified in this issue and approved before implementation.

seimit commented 3 years ago

Here is the proposal for the JSON file format:

  1. Every STDF record will be represented as JSON object: { "RECORD_NAME" { STDF_DATA } }
  2. STDF_DATA is a sequence of STDF field name as in the STDF standard and value formatted according ATDF specification. This will be represent in the JSON file as a list of JSON members: STDF_DATA is "RECORD_FIELD_NAME_1":"VALUE", . . . . "RECORD_FIELD_NAME_X":"VALUE" Example: { "FAR":{ "CPU_TYPE":"2", "STDF_VER":"4" }, "MIR":{ "LOT_ID":"NAS_2314", "PART_TYP":"KLS_21098", "JOB_NAM":"1", "NODE_NAM":"ST_121", "TSTR_TYP":"TMN_333", "SETUP_T":"1:1:1 1-JAN-2021", "START_T":"1:2:41 1-JAN-2021", "OPER_NAM":"312", "MODE_COD":"PROD", "STAT_NUM":"333", "SBLOT_ID":"2314_11", "TEST_COD":"PROB", "RTST_COD":"PROB", "JOB_REV":"4" } }
  3. The fields REC_LEN, REC_TYP and REC_SUB will be not used, because they are related to the binary STDF records information and record identification.
  4. Empty fields (those which are not set) will not be exported into the JSON file.
  5. STDF records which occurred multiple times in the STDF file will be encoded as JSON arrays: "RECORD_FIELD_NAME" : [ { "FIELD_1":"DATA_1" "FIELD_X":"DATA_X" } , . . . . , {"FIELD_1":"DATA_1" "FIELD_X":"DATA_X"}] Example: { "FAR":{ "CPU_TYPE":"2", "STDF_VER":"4" }, "MPR":[ { "TEST_NUM":"1", "HEAD_NUM":"1", "SITE_NUM":"1", "TEST_FLG":"1", "PARM_FLG":"1" }, { "TEST_NUM":"2", "HEAD_NUM":"1", "SITE_NUM":"1", "TEST_FLG":"1", "PARM_FLG":"1" } ]

}

  1. String data (CxLENGTH, Cn, Cf) will be represented as ASCII data. Unicode data is not allowed.
  2. Integer data (I1, I2, I4, U1, U2, U4) will be represent as numbers.
  3. Floating point data (R4, R8) will be represented in decimal notation (for example, 93.2) or floating point notation (for example, 3.2E-7) (taken from ATDF standard, page 8, 1-7).
  4. Time and Data fields will be represent as ASCII text according the ATDF standard (page 8, 1-7).
  5. Fixed length bit-encoded data (B*LENGTH) will be encoded as ASCII string of "0" or "1" values for each bit, starting from the most significant bit. For example : binary value 10111 (decimal 23) will be encoded as "10111".
  6. Variable length bit-encoded (Bn and Dn) data will be encoded as hexadecimal data starting with "0x" prefix. For example: 3 bytes binary value 10111111 01010101 00001111 will be encoded as 0xBF550F.
  7. Variable data type (V*n) will be represented as an JSON object with the key taken from STDF standard page 62. For example: "GEN_DATA":{"7":"1.234E-8"}
  8. Nibble data (N*1) will be encoded as hexadecimal data starting with "0x" prefix. Each nibble (4 bits) will be written with single hexadecimal value.
  9. Array of data of the type specified (kxTYPE) will be represented as an JSON array. Example for array of nibbles: "RTN_STAT":["0xA", "0xB", "0xC"] Example for array of floats : "RTN_RSLT":["4.21321","0.01E-3","1.12E6"]
nerohmot commented 3 years ago

OK