HARTID
ROCurrent hart ID
HARTID (bits XLEN-1:0) — Current hart ID.
What This Field Controls
- - Current hart ID
Common Values
This field is better understood together with surrounding context than as a fixed memorized enumeration.
Machine hart ID; returns the unique identifier of the current hart.
Current hart ID
HARTID (bits XLEN-1:0) — Current hart ID.
This field is better understood together with surrounding context than as a fixed memorized enumeration.
mhartid is a RO CSR in machine implementation and hart identification csrs at 0xF14. Check privilege and implemented extensions before interpreting its bit fields.
Read mhartid to obtain hardware or runtime state.
Interpret the returned value according to the field descriptions and do not attempt to write it back.
If reading fails at the current privilege level, handle the illegal-instruction exception path.
Do not decide from the CSR name alone. The official CSR address encoding and tables define the lowest access privilege; this entry records mhartid as Machine. Access with insufficient privilege or to an unimplemented CSR raises an illegal-instruction exception.
mhartid is read-only. Treat it as an observation point, do not try to write it, and do not depend on fixed values for reserved or WPRI fields.