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

correct_store_buffer: fix ready and free functions


Signed-off-by: default avatarAlban Gruin <alban.gruin@irit.fr>
parent 1c22af68
Branches
No related tags found
No related merge requests found
...@@ -5,10 +5,10 @@ Import ListNotations. ...@@ -5,10 +5,10 @@ Import ListNotations.
(* free and cycle functions. *) (* free and cycle functions. *)
Definition ready isSuUsed sbState (elt : instr_kind) := Definition ready isSuUsed sbState (elt : instr_kind) :=
match elt with match elt with
| (Load, (Lsu, 0)) => busFree isSuUsed sbState | (Load, (Lsu, _)) => busFree isSuUsed sbState
| (_, (Su, 0)) => negb (sbStateT_beq sbState Full) | (_, (Su, _)) => negb (sbStateT_beq sbState Full)
| (_, (_, 0)) => true | (_, (Lu, S _)) => false
| _ => false | _ => true
end. end.
Definition luFree isSuUsed sbState trace := Definition luFree isSuUsed sbState trace :=
...@@ -28,7 +28,11 @@ Definition suFree isSuUsed sbState trace := ...@@ -28,7 +28,11 @@ Definition suFree isSuUsed sbState trace :=
Definition lsuFree isSuUsed sbState trace := Definition lsuFree isSuUsed sbState trace :=
let instr := get_instr_in_stage trace Lsu in let instr := get_instr_in_stage trace Lsu in
match instr with match instr with
| Some elt => ready isSuUsed sbState elt | Some (opcode, (stg, lat)) => ready isSuUsed sbState (opcode, (stg, lat)) &&
if stage_beq (nstg stg opcode) Lu then
luFree isSuUsed sbState trace
else
suFree isSuUsed sbState trace
| None => true | None => true
end. end.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment