mhartid

Machine Hart ID

Reports the unique hart-specific ID in the system.

Attributes

Defining Extension

  • Sm, version >= 0

CSR Address

0xf14

Length

32 when CSR[misa].MXL == 0 64 when CSR[misa].MXL == 1

Privilege Mode

M

Format

This CSR format changes dynamically.

mhartid Format when CSR[misa].MXL == 0
Figure 1. mhartid Format when CSR[misa].MXL == 0
mhartid Format when CSR[misa].MXL == 1
Figure 2. mhartid Format when CSR[misa].MXL == 1

Field Summary

Name Location Type Reset Value

mhartid.ID

* 31:0 when CSR[misa].MXL == 0 * 63:0 when CSR[misa].MXL == 1

RO

UNDEFINED_LEGAL

Fields

ID

Location
  • 31:0 when CSR[misa].MXL == 0

  • 63:0 when CSR[misa].MXL == 1

Description

hart-specific ID.

Type

RO

Reset value

UNDEFINED_LEGAL

Software read

This CSR may return a value that is different from what is stored in hardware.

return hartid();