summaryrefslogtreecommitdiff
path: root/test/typecheck
diff options
context:
space:
mode:
authorAlasdair Armstrong2020-01-16 19:14:22 +0000
committerAlasdair Armstrong2020-01-16 19:14:22 +0000
commitbc6b51d70a783df161f8fb43264ea1558ff37bac (patch)
tree06cfe24052ab08f0268c116ce488be115c4e6af4 /test/typecheck
parentbc55a2c25d0f2f630acf457420d5b868d2855ebc (diff)
Allow effects on mappings
Diffstat (limited to 'test/typecheck')
-rw-r--r--test/typecheck/pass/mapping_rreg.sail17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/typecheck/pass/mapping_rreg.sail b/test/typecheck/pass/mapping_rreg.sail
new file mode 100644
index 00000000..1f3e1212
--- /dev/null
+++ b/test/typecheck/pass/mapping_rreg.sail
@@ -0,0 +1,17 @@
+default Order dec
+
+$include <prelude.sail>
+
+register enabled : bits(1)
+
+union ast = {
+ I: bits(1)
+}
+
+val encdec : ast <-> bits(2) effect {rreg}
+
+scattered mapping encdec
+
+mapping clause encdec = I(imm) if enabled == 0b0 <-> 0b0 @ imm if enabled == 0b0
+
+end encdec