-
Notifications
You must be signed in to change notification settings - Fork 1
/
rvic_is_masked.v
34 lines (29 loc) · 974 Bytes
/
rvic_is_masked.v
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
Require Import SpecDeps.
Require Import RData.
Require Import EventReplay.
Require Import MoverTypes.
Require Import Constants.
Require Import CommonLib.
Require Import AbsAccessor.Spec.
Require Import RVIC.Spec.
Local Open Scope Z_scope.
Section Spec.
Definition rvic_is_masked_spec (rvic: Pointer) (intid: Z64) (adt: RData) : option Z :=
match intid with
| VZ64 intid =>
rely is_int64 intid;
rely (peq (base rvic) rvic_loc);
let idx := (intid / 64) in
let bit := (intid mod 64) in
let slot := offset rvic in
rely prop_dec (0 <= slot < 16);
rely prop_dec (0 <= idx < 512);
when gidx == (buffer (priv adt)) @ slot;
let gn := (gs (share adt)) @ gidx in
rely ((g_tag (ginfo gn)) =? GRANULE_STATE_REC);
rely prop_dec (glock gn = Some CPU_ID);
let bits := (r_mask_bits (g_rvic (gnorm gn))) @ idx in
if Z.land bits (Z.shiftl 1 bit) =? 0
then Some 0 else Some 1
end.
End Spec.