aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Johnson <scott.johnson@arilinc.com>2020-11-12 17:01:20 -0800
committerGitHub <noreply@github.com>2020-11-12 17:01:20 -0800
commit70fdec9e6320f070f79fcbedec3a8c6e76618b85 (patch)
tree1626a4d98300a3dc2d8875fb3949048456b7f1dd
parent828d8553dcf1e2177de92767bf59545076102b76 (diff)
downloadspike-70fdec9e6320f070f79fcbedec3a8c6e76618b85.zip
spike-70fdec9e6320f070f79fcbedec3a8c6e76618b85.tar.gz
spike-70fdec9e6320f070f79fcbedec3a8c6e76618b85.tar.bz2
Correct AMO exception cause for misaligned accesses (#594)
Broken by 91092f21948ba2e77bfbc4629b82b6aa14d5ed6
-rw-r--r--riscv/mmu.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/riscv/mmu.h b/riscv/mmu.h
index 9943aea..5481946 100644
--- a/riscv/mmu.h
+++ b/riscv/mmu.h
@@ -195,6 +195,9 @@ public:
auto lhs = load_##type(addr, true); \
store_##type(addr, f(lhs)); \
return lhs; \
+ } catch (trap_load_address_misaligned& t) { \
+ /* AMO faults should be reported as store faults */ \
+ throw trap_store_address_misaligned(t.get_tval(), t.get_tval2(), t.get_tinst()); \
} catch (trap_load_page_fault& t) { \
/* AMO faults should be reported as store faults */ \
throw trap_store_page_fault(t.get_tval(), t.get_tval2(), t.get_tinst()); \