-
Notifications
You must be signed in to change notification settings - Fork 9
/
chap-encoding-sail.tex
75 lines (50 loc) · 1.46 KB
/
chap-encoding-sail.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
\chapter{Sail listings for capability encoding}
\label{chap:sailenc}
This chapter contains Sail types and functions that implement the
capability encoding scheme.
\medskip
\sailRISCVtype{EncCapability}
\medskip
\sailRISCVtype{Capability}
\medskip
\label{sailRISCVzencCapabilityToCapability}
\sailRISCVfnencCapabilityToCapability
\medskip
\sailRISCVfncapToEncCap
\medskip
\sailRISCVfngetCapBoundsBits
\medskip
\sailRISCVfnsetCapBounds
\medskip
\sailRISCVfnsetCapBoundsRoundDown
\medskip
\sailRISCVfngetRepresentableAlignmentMask
\medskip
\sailRISCVfngetRepresentableLength
\section{SMT validation of properties of the capability encoding}
The Sail compiler can translate Sail code into a Satisfiability Modulo Theories
(SMT) problem that can be given to a solver such as CVC4 or Z3 to check whether
a given function returns true for all input values. We have used this to
check important properties of the capability encoding as implemented in Sail.
Some helper functions are used in the Sail properties:
\medskip
\sailRISCVfn{encodeDecode}
\medskip
\sailRISCVfn{capEncodable}
The following functions have been checked to return true for all inputs.
\medskip
\sailRISCVfn{prop\_decEnc}
\medskip
\sailRISCVfn{prop\_andperms}
\medskip
\sailRISCVfn{prop\_setbounds}
\medskip
\sailRISCVfn{prop\_setbounds\_monotonic}
\medskip
\sailRISCVfn{prop\_setaddr}
\medskip
\sailRISCVfn{prop\_repbounds\_c}
\medskip
\sailRISCVfn{prop\_repbounds}
\medskip
\sailRISCVfn{prop\_crrl\_cram}