|
SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
|
Functions | |
| uint32_t | ai_engine_feeds (void) |
| Samples accepted by the model; take the delta over at least 1 s. | |
| uint32_t | ai_engine_dq_ok (void) |
| Successful dequeues; frozen while dq_calls climbs = NPU stall. | |
| uint32_t | ai_engine_dq_calls (void) |
| Dequeue attempts; pair with ai_engine_dq_ok() for stall detection. | |
| uint32_t | ai_engine_inits (void) |
| Successful model initialisations; a packed nibble in the heartbeat word. | |
| uint32_t | ai_engine_init_calls (void) |
| Model init() calls entered; read together with ai_engine_init_returns(). | |
| uint32_t | ai_engine_init_returns (void) |
| Model init() calls that RETURNED; always read as the pair. | |
| int32_t | ai_engine_last_init_rc (void) |
| Return code of the last model init(): 0x7FFFFFFF = never called; 0 = ok. | |
| uint32_t | ai_engine_stale_drops (void) |
| Verdicts discarded past the Ethos-U wait bound; must stay flat while npu_cycles advances. | |
| uint64_t | ai_engine_npu_cycles (void) |
| NPU cycles accumulated so far; not proof any inference completed. | |
Nine plain counter reads. All are cumulative for the boot unless stated; deltas over an interval are the signal, not totals. Every one is vacuous while ai_engine_stack_words() is 0. On-core they feed the page's once-a-second stats line (page_edge_ai.c:1455-1479: push/s feed/s flush/s … init N/M rc R stale S); off-core they ride the heartbeat word (packed nibbles, deepcraft_task.c:913-919, decision table :886-912) and the Q_DIAG pull that becomes edge_ai.diag(). The stated pass condition for a healthy engine (modedgeai.c:432-437): ai_engine_npu_cycles() advancing while ai_engine_stale_drops() stays flat — ml_state alone is untrustworthy. Only the diag "feed" field reports model intake.
| uint32_t ai_engine_feeds | ( | void | ) |
Samples accepted by the model; take the delta over at least 1 s.
Samples accepted by the model, and successful model initialisations. Shown on the page while no verdict exists yet, so a stall is legible.
| uint32_t ai_engine_dq_ok | ( | void | ) |
Successful dequeues; frozen while dq_calls climbs = NPU stall.
| uint32_t ai_engine_dq_calls | ( | void | ) |
Dequeue attempts; pair with ai_engine_dq_ok() for stall detection.
| uint32_t ai_engine_inits | ( | void | ) |
Successful model initialisations; a packed nibble in the heartbeat word.
| uint32_t ai_engine_init_calls | ( | void | ) |
Model init() calls entered; read together with ai_engine_init_returns().
MODEL_INIT_RECOVERY diagnostics. init_calls == 0 means the inference task never reached the cold-load (task absent, or no select/start landed); init_calls > 0 with last_init_rc != 0 means the model's own init() failed with that code; last_init_rc == 0x7FFFFFFF means init() was never called.
| uint32_t ai_engine_init_returns | ( | void | ) |
Model init() calls that RETURNED; always read as the pair.
How many model init() calls RETURNED. Less than ai_engine_init_calls() means the inference task went into one and did not come out.
| int32_t ai_engine_last_init_rc | ( | void | ) |
Return code of the last model init(): 0x7FFFFFFF = never called; 0 = ok.
| uint32_t ai_engine_stale_drops | ( | void | ) |
Verdicts discarded past the Ethos-U wait bound; must stay flat while npu_cycles advances.
Verdicts discarded because their dequeue ran past the Ethos-U wait bound and so could only be carrying the previous frame's output tensor.
Read it as "how often a verdict was withheld", not as an NPU health meter. The measurement is wall clock, which cannot separate "the NPU did not answer" from "this task did not run": ai_task sits below the GFX task, and a long render frame or an XIP stall on the shared SMIF can push a perfectly good dequeue past the threshold. It also stops counting once a stall wedges the driver, because dequeue then fails outright and never reaches the check.
The signature of a stalling NPU remains ai_engine_dq_ok() frozen while ai_engine_dq_calls() climbs. Cumulative for the boot — deliberately not cleared on a model switch, unlike the pipeline counters.
| uint64_t ai_engine_npu_cycles | ( | void | ) |
NPU cycles accumulated so far; not proof any inference completed.
NPU cycles accumulated so far. A coarse "is the NPU working" reading only — the middleware adds to it on the timeout path as well, so it does NOT prove any particular inference completed. Use ai_engine_stale_drops() for that.