Serial Number

Utilities for parsing and handling chip serial numbers.

TROPIC01 Serial Number structure parser

This module provides the SerialNumber class for parsing and representing the serial number structure embedded in TROPIC01 chip ID.

Based on lt_ser_num_t structure from libtropic.

class tropicsquare.chip_id.serial_number.SerialNumber(data)[source]

Bases: object

Serial number structure parser for TROPIC01 chip

This class parses the 16-byte serial number structure that contains chip manufacturing information including fabrication facility, wafer coordinates, and unique identifiers.

Structure layout (16 bytes total):

  • Byte 0: Serial number (8 bits)

  • Bytes 1-3: fab_data containing:

    • Fab ID (12 bits, bits 12-23)

    • Part number ID (12 bits, bits 0-11)

  • Bytes 4-5: Fabrication date (16 bits, little-endian)

  • Bytes 6-10: Lot ID (40 bits)

  • Byte 11: Wafer ID (8 bits)

  • Bytes 12-13: X coordinate on wafer (16 bits, little-endian)

  • Bytes 14-15: Y coordinate on wafer (16 bits, little-endian)

Parameters:

data (bytes)

raw

Original raw serial number data (16 bytes)

Type:

bytes

sn

Serial number (8-bit)

Type:

int

fab_id

Fabrication facility ID (12-bit)

Type:

int

part_number_id

Part number identifier (12-bit)

Type:

int

fab_date

Fabrication date as integer

Type:

int

lot_id

Manufacturing lot identifier (5 bytes)

Type:

bytes

wafer_id

Wafer identifier (8-bit)

Type:

int

x_coord

X coordinate on wafer (16-bit)

Type:

int

y_coord

Y coordinate on wafer (16-bit)

Type:

int

__init__(data)[source]

Parse serial number from raw bytes

Parameters:

data (bytes) – Raw serial number bytes (must be exactly 16 bytes)

Raises:

ValueError – If data length is not 16 bytes

__str__()[source]

Get human-readable string representation

Returns:

Compact string representation with key serial number fields

Return type:

str

__repr__()[source]

Get detailed string representation for debugging

Returns:

Detailed representation including all fields

Return type:

str

to_dict()[source]

Convert serial number to dictionary representation

Returns:

Dictionary containing all serial number fields with hex-encoded bytes

Return type:

dict

See Also