Skip to content
Snippets Groups Projects
Commit 7ee4f352 authored by Alban Gruin's avatar Alban Gruin Committed by Alban Gruin
Browse files

correct_store_buffer: redefine constaints and use it in the proofs


Signed-off-by: default avatarAlban Gruin <alban.gruin@irit.fr>
parent d943294e
No related branches found
No related tags found
No related merge requests found
...@@ -66,6 +66,15 @@ Definition cycle sbState trace := ...@@ -66,6 +66,15 @@ Definition cycle sbState trace :=
let isSuUsed := List.existsb is_in_su trace in let isSuUsed := List.existsb is_in_su trace in
List.map (cycle_elt isSuUsed sbState trace) trace. List.map (cycle_elt isSuUsed sbState trace) trace.
Definition is_constrained (elt : instr_kind) trace sbState :=
match elt, sbState with
| (_, (Sp, _)), _ => List.existsb is_in_lsu trace
| (Load, (Lsu, _)), Empty => List.existsb is_in_lu trace || List.existsb is_in_su trace
| (Load, (Lsu, _)), _ => true
| (Store, (Lsu, _)), _ => List.existsb is_in_su trace
| _, _ => false
end.
Section can_advance. Section can_advance.
Variable isSuUsed : bool. Variable isSuUsed : bool.
Variable sbState : sbStateT. Variable sbState : sbStateT.
...@@ -139,10 +148,11 @@ Section constrained. ...@@ -139,10 +148,11 @@ Section constrained.
Theorem constrained_sp_can_advance_unconstrained_too : Theorem constrained_sp_can_advance_unconstrained_too :
e = (opc, (Sp, 0)) -> e = (opc, (Sp, 0)) ->
(* t is constrained, t' is unconstrained *) (* t is constrained, t' is unconstrained *)
(List.existsb is_in_lsu t) = true -> (List.existsb is_in_lsu t') = false -> is_constrained e t sbState = true -> is_constrained e t' sbState' = false ->
List.nth_error tc i = Some (opc, (Lsu, 0)) -> List.nth_error tc' i = Some (opc, (Lsu, 0)). List.nth_error tc i = Some (opc, (Lsu, 0)) -> List.nth_error tc' i = Some (opc, (Lsu, 0)).
Proof. Proof.
intros He HconstT HconstT'. intros He HconstT HconstT'.
rewrite He in HconstT'.
constraint_delve He. constraint_delve He.
...@@ -153,15 +163,15 @@ Section constrained. ...@@ -153,15 +163,15 @@ Section constrained.
- exact HconstT'. - exact HconstT'.
Qed. Qed.
(* If a constrained Lsu can advance, an unconstrained Lsu can advance. *)
(* Store version *) (* Store version *)
Theorem constrained_lsu_store_advance_unconstrained_too : Theorem constrained_lsu_store_advance_unconstrained_too :
e = (Store, (Lsu, 0)) -> e = (Store, (Lsu, 0)) ->
(* t is constrained, t' is unconstrained *) (* t is constrained, t' is unconstrained *)
(List.existsb is_in_su t) = true -> (List.existsb is_in_su t') = false -> is_constrained e t sbState = true -> is_constrained e t' sbState' = false ->
List.nth_error tc i = Some (Store, (Su, 0)) -> List.nth_error tc' i = Some (Store, (Su, 0)). List.nth_error tc i = Some (Store, (Su, 0)) -> List.nth_error tc' i = Some (Store, (Su, 0)).
Proof. Proof.
intros He HconstT HconstT'. intros He HconstT HconstT'.
rewrite He in HconstT'.
constraint_delve He. constraint_delve He.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment