Software APIs
Data Fields
status Struct Reference

We use the error category codes from absl_status.h. More...

#include <sw/device/lib/base/status.h>

Data Fields

int32_t value
 

Detailed Description

We use the error category codes from absl_status.h.

OpenTitan's status_t is a single 32-bit word conveying either a result code or an error code.

We build a packed status value that identifies the source of the error (in the form of the module identifier and line number).

By default, the module identifier is the first three letters of the source filename. The identifier can be overridden (per-module) with the DECLARE_MODULE_ID macro.

Our status codes are arranged as a packed bitfield, with the sign bit signifying whether the value represents a result or an error.

All Ok (good) values: 32 31 0 +—+------------------------------------------—+ | | 31 bit | | 0 | Result | +—+------------------------------------------—+

All Error values: 32 31 26 21 16 5 0 +—+----—+----—+----—+----------—+----—+ | | 15 bit | 11 bit | 5 bit | | 1 | Module Identifier | Line Number | code | +—+----—+----—+----—+----------—+----—+

The module identifier value is interpreted as three 5-bit fields representing the characters 0x40..0x5F.

Definition at line 55 of file status.h.

Field Documentation

◆ value

int32_t status::value

Definition at line 56 of file status.h.