projects
/
riscv-isa-sim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
AMOs should always return store faults, not load faults
[riscv-isa-sim.git]
/
riscv
/
insns
/
amoswap_d.h
diff --git
a/riscv/insns/amoswap_d.h
b/riscv/insns/amoswap_d.h
index 8cf1411fe791b7e382c1f9ac173a4e85d9366f9b..e1bffdeb5cdda44cbc0e9b64f4602bec5eaf1632 100644
(file)
--- a/
riscv/insns/amoswap_d.h
+++ b/
riscv/insns/amoswap_d.h
@@
-1,5
+1,3
@@
require_extension('A');
require_rv64;
-reg_t v = MMU.load_uint64(RS1);
-MMU.store_uint64(RS1, RS2);
-WRITE_RD(v);
+WRITE_RD(MMU.amo_uint64(RS1, [&](uint64_t lhs) { return RS2; }));