From cf541bea6be2d612c9bc91af032ab277a3756512 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 4 Feb 2024 19:38:08 +0000 Subject: [PATCH] Initialize mstatus[MPP] to M mode This goes away when https://github.com/riscv/sail-riscv/pull/397 lands upstream --- model/riscv_sys_control.sail | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model/riscv_sys_control.sail b/model/riscv_sys_control.sail index 6fc95e79d..a2a57fefe 100644 --- a/model/riscv_sys_control.sail +++ b/model/riscv_sys_control.sail @@ -505,6 +505,8 @@ function init_sys() -> unit = { mstatus = set_mstatus_UXL(mstatus, misa[MXL]); mstatus[SD] = 0b0; + mstatus[MPP] = 0b11; + /* set to little-endian mode */ if sizeof(xlen) == 64 then { mstatus = Mk_Mstatus([mstatus.bits with 37 .. 36 = 0b00])