콘텐츠로 이동

mbltml.mbltml

Attributes

Name Description
MBLTML_DRIVER_VERSION_BUFFER_SIZE Buffer size (bytes) guaranteed sufficient for mbltmlGetDriverVersion().
MBLTML_ON_DEVICE_DRIVER_VERSION_BUFFER_SIZE Buffer size (bytes) guaranteed sufficient for mbltmlGetOnDeviceDriverVersion().
MBLTML_FIRMWARE_VERSION_BUFFER_SIZE Buffer size (bytes) guaranteed sufficient for mbltmlGetFirmwareVersion().
MBLTML_NODE_NAME_BUFFER_SIZE Buffer size (bytes) guaranteed sufficient for mbltmlGetNodeName().
mbltmlDriverType_t Identifier of a Mobilint NPU driver. Used to select a driver when calling family-scoped APIs such as mbltmlGetDriverVersion(), and to describe the family of an individual device returned by mbltmlGetDriverType().
MBLTML_DRIVER_ERROR Invalid or uninitialized value.
MBLTML_DRIVER_ARIES ARIES Driver.
MBLTML_DRIVER_REGULUS REGULUS (SoC) Driver.
MBLTML_DRIVER_REGULUS_USB REGULUS (USB) Driver.
mbltmlTargetDeviceType_t Specific target device type of a Mobilint NPU.
MBLTML_TARGET_DEVICE_ARIES_RA aries-ra.
MBLTML_TARGET_DEVICE_REGULUS_RA regulus-ra.
MBLTML_TARGET_DEVICE_ARIES_RB aries-rb.
MBLTML_TARGET_DEVICE_REGULUS_RB regulus-rb.
MBLTML_TARGET_DEVICE_REGULUS_RA_USB regulus-ra-usb.
MBLTML_TARGET_DEVICE_REGULUS_RB_USB regulus-rb-usb.
MBLTML_TARGET_DEVICE_ERROR Invalid or uninitialized.
mbltmlStatusCode_t Status code returned by mbltml C APIs. In this Python binding, non-success codes are translated into MBLTMLError subclasses raised by the wrapper functions.
MBLTML_SUCCESS Operation completed successfully.
MBLTML_DRIVER_NOT_FOUND Required driver could not be located.
MBLTML_INVALID_ARGUMENT Invalid argument (NULL or out-of-range index).
MBLTML_UNINITIALIZED API used before initialization.
MBLTML_NOT_SUPPORTED Feature not supported on the target device.
MBLTML_INSUFFICIENT_LENGTH Output buffer is too small.
MBLTML_DEVICE_NOT_FOUND Requested device could not be located.
mbltmlExtraPmicId_t Identifier of an extra PMIC rail. Selects which auxiliary PMIC rail is reported by mbltmlGetExtraPmic*(). The active selection is changed with mbltmlSetExtraPmicID() and can be queried via mbltmlGetExtraPmicId().
MBLTML_EXTRA_PMIC_ID_NPU NPU rail.
MBLTML_EXTRA_PMIC_ID_DDR DDR rail.
MBLTML_EXTRA_PMIC_ID_PMIC PMIC rail.
MBLTML_EXTRA_PMIC_ID_GOLDFINGER Goldfinger rail.
mbltmlCluster_t NPU cluster identifier within a device.
MBLTML_CLUSTER_0 Cluster 0.
MBLTML_CLUSTER_1 Cluster 1.
MBLTML_CLUSTER_ERROR Represents an invalid or uninitialized state.
mbltmlCore_t NPU core identifier within a cluster.
MBLTML_CORE_0 Local core 0.
MBLTML_CORE_1 Local core 1.
MBLTML_CORE_2 Local core 2.
MBLTML_CORE_3 Local core 3.
MBLTML_CORE_GLOBAL Global (all cores aggregated).
MBLTML_CORE_ERROR Represents an invalid or uninitialized state.

MBLTML_DRIVER_VERSION_BUFFER_SIZE

MBLTML_DRIVER_VERSION_BUFFER_SIZE = 80

Buffer size (bytes) guaranteed sufficient for mbltmlGetDriverVersion().

MBLTML_ON_DEVICE_DRIVER_VERSION_BUFFER_SIZE

MBLTML_ON_DEVICE_DRIVER_VERSION_BUFFER_SIZE = 80

Buffer size (bytes) guaranteed sufficient for mbltmlGetOnDeviceDriverVersion().

MBLTML_FIRMWARE_VERSION_BUFFER_SIZE

MBLTML_FIRMWARE_VERSION_BUFFER_SIZE = 80

Buffer size (bytes) guaranteed sufficient for mbltmlGetFirmwareVersion().

MBLTML_NODE_NAME_BUFFER_SIZE

MBLTML_NODE_NAME_BUFFER_SIZE = 80

Buffer size (bytes) guaranteed sufficient for mbltmlGetNodeName().

mbltmlDriverType_t

mbltmlDriverType_t = c_uint

Identifier of a Mobilint NPU driver. Used to select a driver when calling family-scoped APIs such as mbltmlGetDriverVersion(), and to describe the family of an individual device returned by mbltmlGetDriverType().

MBLTML_DRIVER_ERROR

MBLTML_DRIVER_ERROR = 0x0

Invalid or uninitialized value.

MBLTML_DRIVER_ARIES

MBLTML_DRIVER_ARIES = 0x1

ARIES Driver.

MBLTML_DRIVER_REGULUS

MBLTML_DRIVER_REGULUS = 0x2

REGULUS (SoC) Driver.

MBLTML_DRIVER_REGULUS_USB

MBLTML_DRIVER_REGULUS_USB = 0x4

REGULUS (USB) Driver.

mbltmlTargetDeviceType_t

mbltmlTargetDeviceType_t = c_uint

Specific target device type of a Mobilint NPU.

MBLTML_TARGET_DEVICE_ARIES_RA

MBLTML_TARGET_DEVICE_ARIES_RA = 0x00000001

aries-ra.

MBLTML_TARGET_DEVICE_REGULUS_RA

MBLTML_TARGET_DEVICE_REGULUS_RA = 0x00000002

regulus-ra.

MBLTML_TARGET_DEVICE_ARIES_RB

MBLTML_TARGET_DEVICE_ARIES_RB = 0x00000003

aries-rb.

MBLTML_TARGET_DEVICE_REGULUS_RB

MBLTML_TARGET_DEVICE_REGULUS_RB = 0x00000004

regulus-rb.

MBLTML_TARGET_DEVICE_REGULUS_RA_USB

MBLTML_TARGET_DEVICE_REGULUS_RA_USB = 0x00000005

regulus-ra-usb.

MBLTML_TARGET_DEVICE_REGULUS_RB_USB

MBLTML_TARGET_DEVICE_REGULUS_RB_USB = 0x00000006

regulus-rb-usb.

MBLTML_TARGET_DEVICE_ERROR

MBLTML_TARGET_DEVICE_ERROR = 0x7FFFFFFF

Invalid or uninitialized.

mbltmlStatusCode_t

mbltmlStatusCode_t = c_uint

Status code returned by mbltml C APIs. In this Python binding, non-success codes are translated into MBLTMLError subclasses raised by the wrapper functions.

MBLTML_SUCCESS

MBLTML_SUCCESS = 0

Operation completed successfully.

MBLTML_DRIVER_NOT_FOUND

MBLTML_DRIVER_NOT_FOUND = 2

Required driver could not be located.

MBLTML_INVALID_ARGUMENT

MBLTML_INVALID_ARGUMENT = 3

Invalid argument (NULL or out-of-range index).

MBLTML_UNINITIALIZED

MBLTML_UNINITIALIZED = 1

API used before initialization.

MBLTML_NOT_SUPPORTED

MBLTML_NOT_SUPPORTED = 4

Feature not supported on the target device.

MBLTML_INSUFFICIENT_LENGTH

MBLTML_INSUFFICIENT_LENGTH = 5

Output buffer is too small.

MBLTML_DEVICE_NOT_FOUND

MBLTML_DEVICE_NOT_FOUND = 6

Requested device could not be located.

mbltmlExtraPmicId_t

mbltmlExtraPmicId_t = c_uint

Identifier of an extra PMIC rail. Selects which auxiliary PMIC rail is reported by mbltmlGetExtraPmic*(). The active selection is changed with mbltmlSetExtraPmicID() and can be queried via mbltmlGetExtraPmicId().

MBLTML_EXTRA_PMIC_ID_NPU

MBLTML_EXTRA_PMIC_ID_NPU = 0

NPU rail.

MBLTML_EXTRA_PMIC_ID_DDR

MBLTML_EXTRA_PMIC_ID_DDR = 1

DDR rail.

MBLTML_EXTRA_PMIC_ID_PMIC

MBLTML_EXTRA_PMIC_ID_PMIC = 2

PMIC rail.

MBLTML_EXTRA_PMIC_ID_GOLDFINGER

MBLTML_EXTRA_PMIC_ID_GOLDFINGER = 3

Goldfinger rail.

mbltmlCluster_t

mbltmlCluster_t = c_uint

NPU cluster identifier within a device.

MBLTML_CLUSTER_0

MBLTML_CLUSTER_0 = 0x00010000

Cluster 0.

MBLTML_CLUSTER_1

MBLTML_CLUSTER_1 = 0x00020000

Cluster 1.

MBLTML_CLUSTER_ERROR

MBLTML_CLUSTER_ERROR = 0x7FFF0000

Represents an invalid or uninitialized state.

mbltmlCore_t

mbltmlCore_t = c_uint

NPU core identifier within a cluster.

MBLTML_CORE_0

MBLTML_CORE_0 = 1

Local core 0.

MBLTML_CORE_1

MBLTML_CORE_1 = 2

Local core 1.

MBLTML_CORE_2

MBLTML_CORE_2 = 3

Local core 2.

MBLTML_CORE_3

MBLTML_CORE_3 = 4

Local core 3.

MBLTML_CORE_GLOBAL

MBLTML_CORE_GLOBAL = 0x0000FFFE

Global (all cores aggregated).

MBLTML_CORE_ERROR

MBLTML_CORE_ERROR = 0x0000FFFF

Represents an invalid or uninitialized state.

mbltmlCoreId_t

class mbltmlCoreId_t(Structure)

Composite identifier of an NPU core (cluster + core).

Parameters

  • cluster — Cluster to which the core belongs (mbltmlCluster_t).
  • core — Core within the cluster (mbltmlCore_t).

Attributes

Name Description
cluster
core

cluster

cluster: mbltmlCluster_t

core

core: mbltmlCore_t

Methods

Name Description
__repr__

__repr__

def __repr__(self)

mbltmlCoreInfo_t

class mbltmlCoreInfo_t(Structure)

Per-core usage record returned by mbltmlGetCoreInfos().

Utilization for the core can be computed as npu_time / interval when interval is non-zero.

Parameters

  • core_id — Identifier of the core (mbltmlCoreId_t).
  • npu_time — Accumulated NPU active time on the core, in microseconds.
  • interval — Sampling interval covered by npu_time, in microseconds.

Attributes

Name Description
core_id
npu_time
interval

core_id

core_id: mbltmlCoreId_t

npu_time

npu_time: c_int64

interval

interval: c_int64

Methods

Name Description
__repr__

__repr__

def __repr__(self)

mbltmlProcessInfo_t

class mbltmlProcessInfo_t(Structure)

Per-process usage record returned by mbltmlGetProcessInfos().

Utilization for the process can be computed as total_npu_time_us / total_interval_us when total_interval_us is non-zero.

Parameters

  • pid — Process ID.
  • counts — Number of NPU samples attributed to the process.
  • npu_memory_usage — Device memory currently used by the process, in bytes.
  • total_interval_us — Total sampling interval, in microseconds.
  • total_npu_time_us — Total NPU active time used by the process, in microseconds.

Attributes

Name Description
pid
counts
npu_memory_usage
total_interval_us
total_npu_time_us

pid

pid: c_int

counts

counts: c_int

npu_memory_usage

npu_memory_usage: c_int64

total_interval_us

total_interval_us: c_int64

total_npu_time_us

total_npu_time_us: c_int64

Methods

Name Description
__repr__

__repr__

def __repr__(self)

MBLTMLError

class MBLTMLError(Exception)

Base exception raised by the mbltml Python binding.

Wraps a non-success mbltmlStatusCode_t returned by the underlying C library. Instantiating MBLTMLError with a known status code yields the matching subclass (e.g., MBLTMLInvalidArgumentError).

Parameters

  • code — The mbltmlStatusCode_t value associated with this exception.

Methods

Name Description
__new__
__str__
__eq__

__new__

def __new__(cls, code: mbltmlStatusCode_t)

__str__

def __str__(self)

__eq__

def __eq__(self, other)

MBLTMLDriverNotFoundError

class MBLTMLDriverNotFoundError(MBLTMLError)

Raised when the required driver cannot be located.

Wraps MBLTML_DRIVER_NOT_FOUND.

MBLTMLInvalidArgumentError

class MBLTMLInvalidArgumentError(MBLTMLError)

Raised when one or more arguments are invalid.

Wraps MBLTML_INVALID_ARGUMENT. Typical causes include a NULL pointer or a dev_no that is out of range of the target device type's device count.

MBLTMLUninitializedError

class MBLTMLUninitializedError(MBLTMLError)

Raised when an API is called before initialization.

Wraps MBLTML_UNINITIALIZED. Call mbltmlInit() first.

MBLTMLNotSupportedError

class MBLTMLNotSupportedError(MBLTMLError)

Raised when the feature is not supported on the target device.

Wraps MBLTML_NOT_SUPPORTED.

MBLTMLInsufficientLengthError

class MBLTMLInsufficientLengthError(MBLTMLError)

Raised when the output buffer is too small to hold the result.

Wraps MBLTML_INSUFFICIENT_LENGTH.

MBLTMLDeviceNotFoundError

class MBLTMLDeviceNotFoundError(MBLTMLError)

Raised when the requested device cannot be located.

Wraps MBLTML_DEVICE_NOT_FOUND.

Functions

Name Description
mbltmlInit Initialize the mbltml library.
mbltmlShutdown Release all resources held by the mbltml library.
mbltmlGetDeviceCount Get the total number of devices detected by the library.
mbltmlGetTargetDeviceCount Get the number of detected devices of a specific target device type.
mbltmlGetDriverVersion Get the driver version string for a specific driver.
mbltmlGetDriverRevision Get the driver revision number for a specific driver.
mbltmlGetNodeName Get the node name of a device.
mbltmlGetDriverType Get the driver type of a device.
mbltmlGetOnDeviceDriverVersion Get the on-device driver version string of a device.
mbltmlGetOnDeviceDriverRevision Get the on-device driver revision number of a device.
mbltmlGetFirmwareVersion Get the firmware version string of a device.
mbltmlGetFirmwareRevision Get the firmware revision number of a device.
mbltmlGetFirmwareCRC Get the CRC of the currently-loaded firmware image.
mbltmlGetTemperature Get the current die temperature of a device.
mbltmlGetSignalType Get the current signal-type indicator reported by the device.
mbltmlGetNPUClock Get the current NPU clock frequency of a device.
mbltmlGetBusClock Get the current bus clock frequency of a device.
mbltmlGetFanDuty Get the current cooling-fan duty cycle of a device.
mbltmlGetVendorId Get the PCIe vendor ID of a device.
mbltmlGetDeviceId Get the PCIe device ID of a device.
mbltmlGetSubVendorId Get the PCIe subsystem vendor ID of a device.
mbltmlGetSubDeviceId Get the PCIe subsystem device ID of a device.
mbltmlGetPcieGen Get the negotiated PCIe link generation of a device.
mbltmlGetPcieLanes Get the negotiated PCIe link width (in lanes) of a device.
mbltmlGetPcieRev Get the PCIe configuration-space revision ID of a device.
mbltmlGetPcieClassCode Get the PCIe configuration-space class code of a device.
mbltmlGetTotalPower Get the total instantaneous power consumption of a device (W).
mbltmlGetTotalCurrent Get the total instantaneous current draw of a device (A).
mbltmlGetTotalVoltage Get the total instantaneous supply voltage of a device (V).
mbltmlGetExtraPmicPower Get the power consumption of the extra PMIC rail currently selected for the device (W).
mbltmlGetExtraPmicCurrent Get the current of the extra PMIC rail currently selected for the device (A).
mbltmlGetExtraPmicVoltage Get the voltage of the extra PMIC rail currently selected for the device (V).
mbltmlGetExtraPmicId Get the extra PMIC rail currently selected for the device.
mbltmlGetTotalUtilization Get the overall NPU utilization of a device.
mbltmlGetMemoryUsage Get the amount of device memory currently in use.
mbltmlGetMemoryTotal Get the total amount of device memory available.
mbltmlGetProcessInfos Get per-process usage information for a device.
mbltmlGetCoreInfos Get per-core usage information for a device.
mbltmlSetExtraPmicID Select which extra PMIC rail subsequent mbltmlGetExtraPmic*() queries refer to.

mbltmlInit

def mbltmlInit() -> None

Initialize the mbltml library.

Throws

mbltmlShutdown

def mbltmlShutdown() -> None

Release all resources held by the mbltml library.

After this call, any further API usage requires re-initialization via mbltmlInit().

Throws

mbltmlGetDeviceCount

def mbltmlGetDeviceCount() -> int

Get the total number of devices detected by the library.

Note

Supported on all driver types.

This returns the number of all detected devices regardless of their target device type, including devices whose target device type could not be identified.

Attention

Do not confuse this with mbltmlGetTargetDeviceCount(). Since unidentified devices are not addressable by any (target_device_type, dev_no) pair, this count may exceed the sum over every mbltmlTargetDeviceType_t.

Returns

The number of devices detected.

Throws

mbltmlGetTargetDeviceCount

def mbltmlGetTargetDeviceCount(target_device_type: mbltmlTargetDeviceType_t) -> int

Get the number of detected devices of a specific target device type.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type whose device count is queried.

Returns

The number of devices of target_device_type detected, or 0 if none is detected.

Throws

mbltmlGetDriverVersion

def mbltmlGetDriverVersion(driver_type: mbltmlDriverType_t) -> str

Get the driver version string for a specific driver.

Note

Supported on all driver types.

Parameters

  • driver_type — Driver type whose driver version is queried.

Returns

The driver version string.

Throws

mbltmlGetDriverRevision

def mbltmlGetDriverRevision(driver_type: mbltmlDriverType_t) -> int

Get the driver revision number for a specific driver.

Note

Supported on all driver types.

Parameters

  • driver_type — Driver type whose driver revision is queried.

Returns

The driver revision number.

Throws

mbltmlGetNodeName

def mbltmlGetNodeName(target_device_type: mbltmlTargetDeviceType_t, dev_no: int) -> str

Get the node name of a device.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The node name string.

Throws

mbltmlGetDriverType

def mbltmlGetDriverType(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> mbltmlDriverType_t

Get the driver type of a device.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The mbltmlDriverType_t of the device.

Throws

mbltmlGetOnDeviceDriverVersion

def mbltmlGetOnDeviceDriverVersion(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> str

Get the on-device driver version string of a device.

Note

Supported on MBLTML_DRIVER_REGULUS_USB only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The on-device driver version string.

Throws

mbltmlGetOnDeviceDriverRevision

def mbltmlGetOnDeviceDriverRevision(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the on-device driver revision number of a device.

Note

Supported on MBLTML_DRIVER_REGULUS_USB only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The on-device driver revision.

Throws

mbltmlGetFirmwareVersion

def mbltmlGetFirmwareVersion(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> str

Get the firmware version string of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The firmware version string.

Throws

mbltmlGetFirmwareRevision

def mbltmlGetFirmwareRevision(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the firmware revision number of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The firmware revision.

Throws

mbltmlGetFirmwareCRC

def mbltmlGetFirmwareCRC(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the CRC of the currently-loaded firmware image.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The firmware CRC.

Throws

mbltmlGetTemperature

def mbltmlGetTemperature(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the current die temperature of a device.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The temperature reading.

Throws

mbltmlGetSignalType

def mbltmlGetSignalType(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the current signal-type indicator reported by the device.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The signal-type value.

Throws

mbltmlGetNPUClock

def mbltmlGetNPUClock(target_device_type: mbltmlTargetDeviceType_t, dev_no: int) -> int

Get the current NPU clock frequency of a device.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The NPU clock value.

Throws

mbltmlGetBusClock

def mbltmlGetBusClock(target_device_type: mbltmlTargetDeviceType_t, dev_no: int) -> int

Get the current bus clock frequency of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The bus clock value.

Throws

mbltmlGetFanDuty

def mbltmlGetFanDuty(target_device_type: mbltmlTargetDeviceType_t, dev_no: int) -> int

Get the current cooling-fan duty cycle of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The fan duty value.

Throws

mbltmlGetVendorId

def mbltmlGetVendorId(target_device_type: mbltmlTargetDeviceType_t, dev_no: int) -> int

Get the PCIe vendor ID of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The vendor ID.

Throws

mbltmlGetDeviceId

def mbltmlGetDeviceId(target_device_type: mbltmlTargetDeviceType_t, dev_no: int) -> int

Get the PCIe device ID of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The device ID.

Throws

mbltmlGetSubVendorId

def mbltmlGetSubVendorId(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the PCIe subsystem vendor ID of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The subsystem vendor ID.

Throws

mbltmlGetSubDeviceId

def mbltmlGetSubDeviceId(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the PCIe subsystem device ID of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The subsystem device ID.

Throws

mbltmlGetPcieGen

def mbltmlGetPcieGen(target_device_type: mbltmlTargetDeviceType_t, dev_no: int) -> int

Get the negotiated PCIe link generation of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The PCIe generation.

Throws

mbltmlGetPcieLanes

def mbltmlGetPcieLanes(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the negotiated PCIe link width (in lanes) of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The lane count.

Throws

mbltmlGetPcieRev

def mbltmlGetPcieRev(target_device_type: mbltmlTargetDeviceType_t, dev_no: int) -> int

Get the PCIe configuration-space revision ID of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The revision value.

Throws

mbltmlGetPcieClassCode

def mbltmlGetPcieClassCode(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the PCIe configuration-space class code of a device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The class code.

Throws

mbltmlGetTotalPower

def mbltmlGetTotalPower(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> float

Get the total instantaneous power consumption of a device (W).

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The power reading.

Throws

mbltmlGetTotalCurrent

def mbltmlGetTotalCurrent(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> float

Get the total instantaneous current draw of a device (A).

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The current reading.

Throws

mbltmlGetTotalVoltage

def mbltmlGetTotalVoltage(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> float

Get the total instantaneous supply voltage of a device (V).

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The voltage reading.

Throws

mbltmlGetExtraPmicPower

def mbltmlGetExtraPmicPower(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> float

Get the power consumption of the extra PMIC rail currently selected for the device (W).

Note

Supported on MBLTML_DRIVER_ARIES only.

The selected rail is controlled by mbltmlSetExtraPmicID() and can be queried via mbltmlGetExtraPmicId().

The firmware refreshes this reading once per second. After changing the selected rail with mbltmlSetExtraPmicID(), allow up to 1 second for the new rail's value to be reported.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The power reading.

Throws

mbltmlGetExtraPmicCurrent

def mbltmlGetExtraPmicCurrent(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> float

Get the current of the extra PMIC rail currently selected for the device (A).

Note

Supported on MBLTML_DRIVER_ARIES only.

The firmware refreshes this reading once per second. After changing the selected rail with mbltmlSetExtraPmicID(), allow up to 1 second for the new rail's value to be reported.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The current reading.

Throws

mbltmlGetExtraPmicVoltage

def mbltmlGetExtraPmicVoltage(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> float

Get the voltage of the extra PMIC rail currently selected for the device (V).

Note

Supported on MBLTML_DRIVER_ARIES only.

The firmware refreshes this reading once per second. After changing the selected rail with mbltmlSetExtraPmicID(), allow up to 1 second for the new rail's value to be reported.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The voltage reading.

Throws

mbltmlGetExtraPmicId

def mbltmlGetExtraPmicId(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> mbltmlExtraPmicId_t

Get the extra PMIC rail currently selected for the device.

Note

Supported on MBLTML_DRIVER_ARIES only.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The selected mbltmlExtraPmicId_t value.

Throws

mbltmlGetTotalUtilization

def mbltmlGetTotalUtilization(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> float

Get the overall NPU utilization of a device.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The utilization value (typically a ratio in [0.0, 1.0] or a percentage).

Throws

mbltmlGetMemoryUsage

def mbltmlGetMemoryUsage(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the amount of device memory currently in use.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The in-use memory in bytes.

Throws

mbltmlGetMemoryTotal

def mbltmlGetMemoryTotal(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> int

Get the total amount of device memory available.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

The total memory in bytes.

Throws

mbltmlGetProcessInfos

def mbltmlGetProcessInfos(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> List[mbltmlProcessInfo_t]

Get per-process usage information for a device.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

List of mbltmlProcessInfo_t records; empty if no process is running.

Throws

mbltmlGetCoreInfos

def mbltmlGetCoreInfos(
    target_device_type: mbltmlTargetDeviceType_t, dev_no: int
) -> List[mbltmlCoreInfo_t]

Get per-core usage information for a device.

Note

Supported on all driver types.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().

Returns

List of mbltmlCoreInfo_t records.

Throws

mbltmlSetExtraPmicID

def mbltmlSetExtraPmicID(
    target_device_type: mbltmlTargetDeviceType_t,
    dev_no: int,
    pmic_id: mbltmlExtraPmicId_t,
) -> None

Select which extra PMIC rail subsequent mbltmlGetExtraPmic*() queries refer to.

Note

Supported on aries-rb device (MBLTML_TARGET_DEVICE_ARIES_RB) only.

The underlying readings are refreshed by firmware once per second; allow up to 1 second after this call before mbltmlGetExtraPmicPower(), mbltmlGetExtraPmicCurrent() and mbltmlGetExtraPmicVoltage() reflect the newly selected rail.

Parameters

  • target_device_type — Target device type of the device.
  • dev_no — Device index within target_device_type. Device count is obtained via mbltmlGetTargetDeviceCount().
  • pmic_id — Identifier of the extra PMIC rail to select.

Throws