From 2e4faa4d50da990f2a5d72accc5530b832ded3f9 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 25 Mar 2023 09:14:56 +0100 Subject: [PATCH] fixes mstatus mask --- src/iss/arch/riscv_hart_m_p.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/iss/arch/riscv_hart_m_p.h b/src/iss/arch/riscv_hart_m_p.h index 95f4b36..11b3739 100644 --- a/src/iss/arch/riscv_hart_m_p.h +++ b/src/iss/arch/riscv_hart_m_p.h @@ -219,7 +219,7 @@ public: mstatus_t mstatus; - static const reg_t mstatus_reset_val = 0xa00000000; + static const reg_t mstatus_reset_val = 0x1800; void write_mstatus(T val) { auto mask = get_mask() &0xff; // MPP is hardcode as 0x3 @@ -228,7 +228,21 @@ public: } static constexpr T get_mask() { - return 0x8000000f007ff9ddULL; // 0b1...0 1111 0000 0000 0111 1111 1111 1001 1011 1011 + //return 0x8000000f007ff9ddULL; // 0b1...0 1111 0000 0000 0111 1111 1111 1001 1011 1011 + // + // +-TSR + // |+-TW + // ||+-TVM + // |||+-MXR + // ||||+-SUM + // |||||+-MPRV + // |||||| +-XS + // |||||| | +-FS + // |||||| | | +-MPP + // |||||| | | | +-SPP + // |||||| | | | |+-MPIE + // ||||||/|/|/| || +-MIE + return 0b00000000000000000001100010001000; } };