Skip to content

Commit 10ac2d0

Browse files
committed
Add test and adjust emacs mode
1 parent 96471e9 commit 10ac2d0

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

editors/sail-mode.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"else" "match" "in" "return" "register" "ref" "forall" "operator" "effect" "config"
3636
"overload" "cast" "sizeof" "constant" "constraint" "default" "assert" "newtype" "from"
3737
"pure" "impure" "monadic" "infixl" "infixr" "infix" "scattered" "end" "try" "catch" "and" "to" "private"
38-
"throw" "clause" "as" "repeat" "until" "while" "do" "foreach" "bitfield"
38+
"throw" "clause" "as" "repeat" "until" "while" "do" "foreach" "bitfield" "when"
3939
"mapping" "where" "with" "implicit" "instantiation" "impl" "forwards" "backwards"))
4040

4141
(defconst sail-project-keywords
@@ -107,8 +107,8 @@
107107
(setq-local comment-end "*/")
108108
(setq major-mode 'sail-mode)
109109
(setq mode-name "Sail")
110-
(add-hook 'sail-mode-hook
111-
(lambda () (add-hook 'after-save-hook 'sail-load nil 'local)))
110+
;; (add-hook 'sail-mode-hook
111+
;; (lambda () (add-hook 'after-save-hook 'sail-load nil 'local)))
112112
(run-hooks 'sail-mode-hook))
113113

114114
;; (with-eval-after-load 'lsp-mode **/
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
default Order dec
2+
3+
$include <vector.sail>
4+
5+
union instruction = {
6+
LUI : bitvector(6)
7+
}
8+
9+
val encdec : instruction <-> bitvector(11)
10+
scattered mapping encdec
11+
12+
mapping clause encdec = LUI(imm)
13+
<-> 0b011 @ imm[5] : bitvector(1) @ imm[4..0] : bitvector(5) @ 0b01
14+
when imm != 0b000000
15+
16+
end encdec

0 commit comments

Comments
 (0)