misa
Machine ISA Control
Reports the XLEN and "major" extensions supported by the ISA.
Fields
MXL
- Location
-
misa[63:62] - Description
-
XLEN in M-mode.
- Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
2
A
- Location
-
misa[0] - Description
-
Indicates support for the A (atomic) extension.
Writing 0 to this field will cause all atomic instructions to raise an
IllegalInstructionexception. - Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
B
- Location
-
misa[1] - Description
-
Indicates support for the B (bitmanip) extension.
Writing 0 to this field will cause all bitmanip instructions to raise an
IllegalInstructionexception. - Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
C
- Location
-
misa[2] - Description
-
Indicates support for the C (compressed) extension.
Writing 0 to this field will cause all compressed instructions to raise an
IllegalInstructionexception. Additionally, IALIGN becomes 32. - Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
D
- Location
-
misa[3] - Description
-
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.
- Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
F
- Location
-
misa[5] - Description
-
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.
- Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
- Software write
-
This field has special behavior when written by software (e.g., through csrrw).
When software tries to write
csr_value, the field will be written with the return value of the function below.if (csr_value.F == 0 && csr_value.D == 1) { return UNDEFINED_LEGAL_DETERMINISTIC; } return csr_value.F;
H
- Location
-
misa[7] - Description
-
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
IllegalInstructionfault. - Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
I
- Location
-
misa[8] - Description
-
Indicates support for the I (base) extension.
- Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
M
- Location
-
misa[12] - Description
-
Indicates support for the M (integer multiply/divide) extension.
Writing 0 to this field will cause all attempts to execute an integer multiply or divide instruction to raise an
IllegalInstructionexception. - Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
S
- Location
-
misa[18] - Description
-
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.
- Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
U
- Location
-
misa[20] - Description
-
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.
- Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
V
- Location
-
misa[21] - Description
-
Indicates support for the V (vector) extension.
Writing 0 to this field will cause all attempts to execute a vector instruction to raise an
IllegalInstructiontrap. - Type
RO |
Read-Only Field has a hardwired value that does not change. Writes to an RO field are ignored. |
- Reset value
-
1
Software read
This CSR may return a value that is different from what is stored in hardware.
-
Pruned
-
Original
return CSR[misa].MXL << (62 | (CSR[misa].V << 21) | (CSR[misa].U << 20) | (CSR[misa].S << 18) | (CSR[misa].Q << 16) | (CSR[misa].M << 12) | (CSR[misa].I << 7) | (CSR[misa].H << 6) | ((CSR[misa].A & CSR[misa].M & CSR[misa].F & CSR[misa].D) << 5) | (CSR[misa].F << 4) | (CSR[misa].D << 3) | (CSR[misa].C << 2) | (CSR[misa].B << 1) | CSR[misa].A);
return CSR[misa].MXL << (xlen() - 2 | (CSR[misa].V << 21) | (CSR[misa].U << 20) | (CSR[misa].S << 18) | (CSR[misa].Q << 16) | (CSR[misa].M << 12) | (CSR[misa].I << 7) | (CSR[misa].H << 6) | ((CSR[misa].A & CSR[misa].M & CSR[misa].F & CSR[misa].D) << 5) | (CSR[misa].F << 4) | (CSR[misa].D << 3) | (CSR[misa].C << 2) | (CSR[misa].B << 1) | CSR[misa].A);