summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKathy Gray2016-06-03 15:59:57 +0100
committerKathy Gray2016-06-03 16:00:11 +0100
commit33ce6cafbd7254b52fe5c6a2244f57bb6d4e7f42 (patch)
treec844cef4866a3763430cd68f403dfe026e10277b
parenta77f59965a265cfe056c4048f6d63e1fbbc54950 (diff)
Mips file: removed some unnecessary parenthesis
Interp: trying to add some debugging to isolate bug
-rw-r--r--mips/mips_prelude.sail20
-rw-r--r--src/lem_interp/interp.lem7
2 files changed, 14 insertions, 13 deletions
diff --git a/mips/mips_prelude.sail b/mips/mips_prelude.sail
index 4710167e..5847cecb 100644
--- a/mips/mips_prelude.sail
+++ b/mips/mips_prelude.sail
@@ -368,8 +368,8 @@ function unit incrementCP0Count() = {
(* XXX Sail does not allow reading fields here :-( *)
let (bit[32])status = CP0Status in
let (bit[32])cause = CP0Cause in
- let (bit[8]) ims = (status[15..8]) in
- let (bit[8]) ips = (cause[15..8]) in
+ let (bit[8]) ims = status[15..8] in
+ let (bit[8]) ips = cause[15..8] in
let ie = status[0] in
let exl = status[1] in
let erl = status[2] in
@@ -379,14 +379,14 @@ function unit incrementCP0Count() = {
function bool tlbEntryMatch(r, vpn2, asid, (TLBEntry) entry) =
let entryVal = (bit[117]) entry in
- let entryValid = (entryVal[62]) in
- let entryR = (entryVal[100..99]) in
- let entryMask = (entryVal[116..101]) in
- let entryVPN = (entryVal[98..72]) in
- let entryASID = (entryVal[71..64]) in
- let entryG = (entryVal[63]) in
- ((entryValid) &
- (r == (entryR)) &
+ let entryValid = entryVal[62] in
+ let entryR = entryVal[100..99] in
+ let entryMask = entryVal[116..101] in
+ let entryVPN = entryVal[98..72] in
+ let entryASID = entryVal[71..64] in
+ let entryG = entryVal[63] in
+ (entryValid &
+ (r == entryR) &
((vpn2 & ~(EXTZ(entryMask))) == ((entryVPN) & ~(EXTZ(entryMask)))) &
((asid == (entryASID)) | (entryG)))
diff --git a/src/lem_interp/interp.lem b/src/lem_interp/interp.lem
index dccbe090..f3938453 100644
--- a/src/lem_interp/interp.lem
+++ b/src/lem_interp/interp.lem
@@ -13,6 +13,9 @@ open import Instruction_extractor
type tannot = Interp_utilities.tannot
+val debug_print : string -> unit
+declare ocaml target_rep function debug_print s = `Printf.eprintf` "%s" s
+
val intern_annot : tannot -> tannot
let intern_annot annot =
match annot with
@@ -574,6 +577,7 @@ end
val access_vector : value -> nat -> value
let access_vector v n =
+ let _ = debug_print ("access_vector given " ^ string_of_value v ^ " and " ^ show n) in
retaint v (match (detaint v) with
| V_unknown -> V_unknown
| V_lit (L_aux L_undef _) -> v
@@ -1054,9 +1058,6 @@ let fix_up_nondet typ branches annot =
(fun e -> E_aux (E_assign (LEXP_aux (LEXP_id redex_id) annot) e) annot) branches), Just "0")
end
-val debug_print : string -> unit
-declare ocaml target_rep function debug_print s = `Printf.eprintf` "%s" s
-
(* match_pattern returns a tuple of (pattern_matches? , pattern_passed_due_to_unknown?, env_of_pattern *)
val match_pattern : top_level -> pat tannot -> value -> bool * bool * lenv
let rec match_pattern t_level (P_aux p (_, annot)) value_whole =