From 9c8b72693e1654ef016b57099f87b59b7b44e244 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 20 Aug 2021 09:02:56 +0200 Subject: [PATCH] correct trap ids of access faults --- incl/iss/arch/riscv_hart_mu_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/incl/iss/arch/riscv_hart_mu_p.h b/incl/iss/arch/riscv_hart_mu_p.h index 2a05997..8d01c3f 100644 --- a/incl/iss/arch/riscv_hart_mu_p.h +++ b/incl/iss/arch/riscv_hart_mu_p.h @@ -600,7 +600,7 @@ iss::status riscv_hart_mu_p::read(const address_type type, const acc if(!pmp_check(access, addr, length) && (access&access_type::DEBUG) != access_type::DEBUG) { fault_data = addr; if (access && iss::access_type::DEBUG) throw trap_access(0, addr); - this->reg.trap_state = (1 << 31) | (1 << 16); // issue trap 1 + this->reg.trap_state = (1 << 31) | ((access==access_type::FETCH?1:5) << 16); // issue trap 1 return iss::Err; } } @@ -695,7 +695,7 @@ iss::status riscv_hart_mu_p::write(const address_type type, const ac if(!pmp_check(access, addr, length) && (access&access_type::DEBUG) != access_type::DEBUG) { fault_data = addr; if (access && iss::access_type::DEBUG) throw trap_access(0, addr); - this->reg.trap_state = (1 << 31) | (1 << 16); // issue trap 1 + this->reg.trap_state = (1 << 31) | (7 << 16); // issue trap 1 return iss::Err; } }