aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_insts_aext.sail
diff options
context:
space:
mode:
authorRobert Norton <rmn30@cam.ac.uk>2019-05-23 16:51:42 +0100
committerRobert Norton <rmn30@cam.ac.uk>2019-05-23 16:51:42 +0100
commit8eb54cef949b3c7529b7136bebd03783cd68a991 (patch)
tree350c2aadf34b0792c269ae7b6120f26a7e5f3d27 /model/riscv_insts_aext.sail
parent798066304a257e843b00b7c8fbf6e242dc0fddad (diff)
downloadsail-riscv-8eb54cef949b3c7529b7136bebd03783cd68a991.zip
sail-riscv-8eb54cef949b3c7529b7136bebd03783cd68a991.tar.gz
sail-riscv-8eb54cef949b3c7529b7136bebd03783cd68a991.tar.bz2
Be more careful about matching only instructions that are defined for xlen being built.
Diffstat (limited to 'model/riscv_insts_aext.sail')
-rw-r--r--model/riscv_insts_aext.sail12
1 files changed, 6 insertions, 6 deletions
diff --git a/model/riscv_insts_aext.sail b/model/riscv_insts_aext.sail
index 490a06e..1ba280d 100644
--- a/model/riscv_insts_aext.sail
+++ b/model/riscv_insts_aext.sail
@@ -23,8 +23,8 @@ function lrsc_width_str(width : word_width) -> string =
/* ****************************************************************** */
union clause ast = LOADRES : (bool, bool, regidx, word_width, regidx)
-mapping clause encdec = LOADRES(aq, rl, rs1, size, rd)
- <-> 0b00010 @ bool_bits(aq) @ bool_bits(rl) @ 0b00000 @ rs1 @ 0b0 @ size_bits(size) @ rd @ 0b0101111
+mapping clause encdec = LOADRES(aq, rl, rs1, size, rd) if word_width_bytes(size) <= sizeof(xlen_bytes)
+ <-> 0b00010 @ bool_bits(aq) @ bool_bits(rl) @ 0b00000 @ rs1 @ 0b0 @ size_bits(size) @ rd @ 0b0101111 if word_width_bytes(size) <= sizeof(xlen_bytes)
/* We could set load-reservations on physical or virtual addresses.
* For now we set them on virtual addresses, since it makes the
@@ -85,8 +85,8 @@ mapping clause assembly = LOADRES(aq, rl, rs1, size, rd)
/* ****************************************************************** */
union clause ast = STORECON : (bool, bool, regidx, regidx, word_width, regidx)
-mapping clause encdec = STORECON(aq, rl, rs2, rs1, size, rd)
- <-> 0b00011 @ bool_bits(aq) @ bool_bits(rl) @ rs2 @ rs1 @ 0b0 @ size_bits(size) @ rd @ 0b0101111
+mapping clause encdec = STORECON(aq, rl, rs2, rs1, size, rd) if word_width_bytes(size) <= sizeof(xlen_bytes)
+ <-> 0b00011 @ bool_bits(aq) @ bool_bits(rl) @ rs2 @ rs1 @ 0b0 @ size_bits(size) @ rd @ 0b0101111 if word_width_bytes(size) <= sizeof(xlen_bytes)
/* NOTE: Currently, we only EA if address translation is successful. This may need revisiting. */
function clause execute (STORECON(aq, rl, rs2, rs1, width, rd)) = {
@@ -178,8 +178,8 @@ mapping encdec_amoop : amoop <-> bits(5) = {
AMOMAXU <-> 0b11100
}
-mapping clause encdec = AMO(op, aq, rl, rs2, rs1, size, rd)
- <-> encdec_amoop(op) @ bool_bits(aq) @ bool_bits(rl) @ rs2 @ rs1 @ 0b0 @ size_bits(size) @ rd @ 0b0101111
+mapping clause encdec = AMO(op, aq, rl, rs2, rs1, size, rd) if word_width_bytes(size) <= sizeof(xlen_bytes)
+ <-> encdec_amoop(op) @ bool_bits(aq) @ bool_bits(rl) @ rs2 @ rs1 @ 0b0 @ size_bits(size) @ rd @ 0b0101111 if word_width_bytes(size) <= sizeof(xlen_bytes)
/* NOTE: Currently, we only EA if address translation is successful.
This may need revisiting. */