Machine ISA Control
Reports the XLEN and "major" extensions supported by the ISA.
| 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MXL | — | X | — | V | U | — | S | — | Q | — | M | — | I | H | — | F | — | D | C | B | A | ||||||||||
| 63:56 | 55:48 | 47:40 | 39:32 | 31:24 | 23:16 | 15:8 | 7:0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MXL | — | X | — | V | U | — | S | — | Q | — | M | — | I | H | — | F | — | D | C | B | A | ||||||||||||||||||||||||||||||||||||||||||
| Bits | Field | Alias | Description | Type | Reset |
|---|---|---|---|---|---|
| RV32 [31:30] RV64 [63:62] | MXL | XLEN in M-mode. | RO | return (MXLEN == 32) ? 2'b01 : 2'b10; | |
| [0] | A | Indicates support for the `A` (atomic) extension. | return (implemented?(ExtensionName::A) && MUTABLE_MISA_A) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::A) ? 1 : 0; | |
| [1] | B | Indicates support for the `B` (bitmanip) extension. | return (implemented?(ExtensionName::B) && MUTABLE_MISA_B) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::B) ? 1 : 0; | |
| [2] | C | Indicates support for the `C` (compressed) extension. Writing 0 to this field will cause all compressed instructions to raise an `IllegalInstruction` exception. Additionally, IALIGN becomes 32. | return (implemented?(ExtensionName::C) && MUTABLE_MISA_C) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::C) ? 1 : 0; | |
| [3] | D | Indicates support for the `D` (double precision float) extension. -- Writing 0 to this field will cause all double-precision floating point instructions to raise an `IllegalInstruction` exception. Additionally, the upper 32-bits of the f registers will read as zero. -- | return (implemented?(ExtensionName::D) && MUTABLE_MISA_D) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::D) ? 1 : 0; | |
| [5] | F | Indicates support for the `F` (single precision float) extension. -- Writing 0 to this field will cause all floating point (single and double precision) instructions to raise an `IllegalInstruction` exception. Writing 0 to this field with `misa.D` set will result in UNDEFINED behavior. -- | return (implemented?(ExtensionName::F) && MUTABLE_MISA_F) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::F) ? 1 : 0; | |
| [7] | H | Indicates support for the `H` (hypervisor) extension. Writing 0 to this field will cause all attempts to enter VS- or VU- mode, execute a hypervisor instruction, or access a hypervisor CSR to raise an `IllegalInstruction` fault. | return (implemented?(ExtensionName::H) && MUTABLE_MISA_H) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::H) ? 1 : 0; | |
| [8] | I | Indicates support for the `I` (base) extension. | RO | 1 | |
| [12] | M | Indicates support for the `M` (integer multiply/divide) extension. Writing 0 to this field will cause all attempts to execute an integer divide or remainder instruction to raise an `IllegalInstruction` exception. The multiply instructions are provided by `Zmmul` and are unaffected. | return (implemented?(ExtensionName::M) && MUTABLE_MISA_M) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::M) ? 1 : 0; | |
| [16] | Q | Indicates support for the `Q` (quad precision float) extension. -- Writing 0 to this field will cause all quad-precision floating point instructions to raise an `IllegalInstruction` exception. -- | return MUTABLE_MISA_Q ? CsrFieldType::RW : CsrFieldType::RO; | 1 | |
| [18] | S | Indicates support for the `S` (supervisor mode) extension. Writing 0 to this field will cause all attempts to enter S-mode or access S-mode state to raise an exception. | return (implemented?(ExtensionName::S) && MUTABLE_MISA_S) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::S) ? 1 : 0; | |
| [20] | U | Indicates support for the `U` (user mode) extension. Writing 0 to this field will cause all attempts to enter U-mode to raise an exception. | return (implemented?(ExtensionName::U) && MUTABLE_MISA_U) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::U) ? 1 : 0; | |
| [21] | V | Indicates support for the `V` (vector) extension. Writing 0 to this field will cause all attempts to execute a vector instruction to raise an `IllegalInstruction` trap. | return (implemented?(ExtensionName::V) && MUTABLE_MISA_V) ? CsrFieldType::RW : CsrFieldType::RO; | return implemented?(ExtensionName::V) ? 1 : 0; | |
| [23] | X | The `X` bit will be set if there are any non-standard extensions. | RO | return NON_STANDARD_EXTENSION_IMPLEMENTED ? 1 : 0; |
return ( (CSR[misa].MXL `<< (xlen() - 2)) | (CSR[misa].X `<< 23) | (CSR[misa].V `<< 21) | (CSR[misa].U `<< 20) | (CSR[misa].S `<< 18) | (CSR[misa].Q `<< 16) | (CSR[misa].M `<< 12) | (CSR[misa].I `<< 8) | (CSR[misa].H `<< 7) | (CSR[misa].F `<< 5) | (CSR[misa].D `<< 3) | (CSR[misa].C `<< 2) | (CSR[misa].B `<< 1) | CSR[misa].A);
Version af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.