Skip to content

Commit

Permalink
Merge pull request #12 from Semi-ATE/seimit_issue_11
Browse files Browse the repository at this point in the history
Fix for issue #11
  • Loading branch information
seimit authored Nov 25, 2021
2 parents eec9c26 + a23820d commit 0d1fb93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Metis/tools/STDFHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def is_plain_stdf(stdf_file):
if rec_sub != b'\x0A':
return False

if bo == 1:
if bo == b'\x01':
byteorder = 'big'
elif bo == 2:
elif bo == b'\x02':
byteorder = 'little'
else:
byteorder = sys.byteorder
Expand Down Expand Up @@ -107,9 +107,9 @@ def get_byteorder(stdf_file):
# Skip the first 4 bytes
f.read(4)
bo = f.read(1)
if bo == 1:
if bo == b'\x01':
byteorder = 'big'
elif bo == 2:
elif bo == b'\x02':
byteorder = 'little'
else:
byteorder = sys.byteorder
Expand Down
6 changes: 6 additions & 0 deletions Metis/tools/stdf2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ def convert(self, input_stdf_file, output_folder):
progress.update(1)

stdf_record = STDFHelper.get_stdf_record(ver, byteorder, rec_len, rec_typ, rec_sub, rec)

if stdf_record == None:
rt = int.from_bytes(rec_typ, byteorder)
rs = int.from_bytes(rec_sub, byteorder)
print(f"Unknown STDF record with record type {rt} and sub-type {rs}.")
continue

rec_name = type(stdf_record).__name__

Expand Down

0 comments on commit 0d1fb93

Please sign in to comment.