mret
Machine Exception Return
This instruction is defined by:
Execution
-
Pruned, XLEN == 64
-
Original
if (true && CSR[mstatus].MPP != 2'b11) {
CSR[mstatus].MPRV = 0;
}
CSR[mstatus].MIE = CSR[mstatus].MPIE;
CSR[mstatus].MPIE = 1;
if (CSR[mstatus].MPP == 2'b00) {
set_mode(PrivilegeMode::U);
} else if (CSR[mstatus].MPP == 2'b01) {
set_mode(PrivilegeMode::S);
} else if (CSR[mstatus].MPP == 2'b11) {
set_mode(PrivilegeMode::M);
}
CSR[mstatus].MPP = 2'b00;
$pc = $bits(CSR[mepc]);
idl
if (implemented?(ExtensionName::S) && CSR[mstatus].MPP != 2'b11) {
CSR[mstatus].MPRV = 0;
}
CSR[mstatus].MIE = CSR[mstatus].MPIE;
CSR[mstatus].MPIE = 1;
if (CSR[mstatus].MPP == 2'b00) {
set_mode(PrivilegeMode::U);
} else if (CSR[mstatus].MPP == 2'b01) {
set_mode(PrivilegeMode::S);
} else if (CSR[mstatus].MPP == 2'b11) {
set_mode(PrivilegeMode::M);
}
CSR[mstatus].MPP = implemented?(ExtensionName::U) ? 2'b00 : 2'b11;
$pc = $bits(CSR[mepc]);
idl