forked from cubicle-model-checker/cubicle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
german.ctc_nodata.cub
134 lines (110 loc) · 2.72 KB
/
german.ctc_nodata.cub
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
(*
German cache coherence protocol as modeled by Ching-Tsun Chou and used in the
paper C.-T. Chou, P. K. Mannava, and S. Park, A simple method for parameterized
verification of cache coherence protocols, FMCAD 2004.
Version without data paths
*)
type state = Invalid | Shared | Exclusive
type msg = Empty | Reqs | Reqe | Inv | Invack | Gnts | Gnte
var Exgntd : bool
var Curcmd : msg
var CurClient : proc
array Chan1Cmd[proc] : msg
array Chan2Cmd[proc] : msg
array Chan3Cmd[proc] : msg
array CacheState[proc] : state
array Invset[proc] : bool
array Shrset[proc] : bool
init (z) {
Chan1Cmd[z] = Empty &&
Chan2Cmd[z] = Empty &&
Chan3Cmd[z] = Empty &&
CacheState[z] = Invalid &&
Invset[z] = False &&
Shrset[z] = False &&
Curcmd = Empty &&
Exgntd = False
}
(* Control *)
unsafe (z1 z2) { CacheState[z1] = Exclusive && CacheState[z2] <> Invalid }
transition sendReqs (i)
requires { Chan1Cmd[i] = Empty && CacheState[i] = Invalid }
{
Chan1Cmd[i] := Reqs;
}
transition sendReqe (i)
requires { Chan1Cmd[i] = Empty && CacheState[i] <> Exclusive }
{
Chan1Cmd[i] := Reqe;
}
transition recvReqs (i)
requires { Curcmd = Empty && Chan1Cmd[i] = Reqs }
{
Curcmd := Reqs;
CurClient := i;
Chan1Cmd[i] := Empty;
Invset[j] := case | _ : Shrset[j];
}
transition recvReqe (i)
requires { Curcmd = Empty && Chan1Cmd[i] = Reqe }
{
Curcmd := Reqe;
CurClient := i;
Chan1Cmd[i] := Empty;
Invset[j] := case | _ : Shrset[j];
}
transition sendInv1 (i)
requires { Chan2Cmd[i] = Empty && Invset[i] = True && Curcmd = Reqe }
{
Chan2Cmd[i] := Inv;
Invset[i] := False;
}
transition sendInv2 (i)
requires { Chan2Cmd[i] = Empty && Invset[i] = True && Curcmd = Reqs &&
Exgntd = True }
{
Chan2Cmd[i] := Inv;
Invset[i] := False;
}
transition sendInvack (i)
requires { Chan2Cmd[i] = Inv && Chan3Cmd[i] = Empty }
{
Chan2Cmd[i] := Empty;
Chan3Cmd[i] := Invack;
CacheState[i] := Invalid;
}
transition recvInvack1 (i)
requires { Chan3Cmd[i] = Invack && Curcmd <> Empty }
{
Chan3Cmd[i] := Empty;
Shrset[i] := False;
Exgntd := False;
}
transition sendGnts (i)
requires { Curcmd = Reqs && CurClient = i && Chan2Cmd[i] = Empty && Exgntd = False }
{
Chan2Cmd[i] := Gnts;
Shrset[i] := True;
Curcmd := Empty;
}
transition sendGnte (i)
requires { Curcmd = Reqe && CurClient = i && Chan2Cmd[i] = Empty && Exgntd = False &&
Shrset[i] = False && forall_other j. Shrset[j] = False }
{
Chan2Cmd[i] := Gnte;
Shrset[i] := True;
Curcmd := Empty;
Exgntd := True;
}
transition recvGnts (i)
requires { Chan2Cmd[i] = Gnts }
{
CacheState[i] := Shared;
Chan2Cmd[i] := Empty;
}
transition recvGnts (i)
requires { Chan2Cmd[i] = Gnte }
{
CacheState[i] := Exclusive;
Chan2Cmd[i] := Empty;
}