-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvm_types.ml
More file actions
46 lines (39 loc) · 1.01 KB
/
vm_types.ml
File metadata and controls
46 lines (39 loc) · 1.01 KB
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
open Ast
module StringMap = Map.Make(String)
type value =
| Ival of int
| Aval of int * int
| Pval of int
(* DIRECTIVES *)
type prediction = bool
type directive =
| Fetch
| PFetch of prediction
| Exec of int
| Retire
(* OBSERVATIONS *)
type observation =
| None
| Read of int * int list
| Write of int * int list
| Fail of int
| Rollback of int
(* INSTRUCTION SET *)
type instruction =
| Nop
| AssignV of identifier * value
| AssignE of identifier * expr
| Load of identifier * expr (* id := load(e) *)
| StoreV of value * value
| StoreE of expr * expr
| IProtectV of identifier * protect * value
| IProtectE of identifier * protect * expr (* id := protect(e) *)
| Guard of expr * prediction * cmd list * int
| Fail of int
(* CONFIGURATIONS *)
type configuration = {
is : instruction list ;
cs : cmd list ;
mu : int array ;
rho : int StringMap.t ;
} [@@deriving show]