From 78703f987512fbc90ccccea4b813f24fe0ccd49a Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Fri, 4 Apr 2014 11:14:25 +0100 Subject: Improve Power execution - Move FDE loop to the OCaml side of the Power model (avoid leaking memory due to lack of TCO in interpreter) - Display cycle count - Check the value of CIA at the end of each cycle and stop if it is equal to the initial value of LR, returning the value in GPR3. --- src/lem_interp/run_interp.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lem_interp') diff --git a/src/lem_interp/run_interp.ml b/src/lem_interp/run_interp.ml index 7100a197..556e61c6 100644 --- a/src/lem_interp/run_interp.ml +++ b/src/lem_interp/run_interp.ml @@ -208,14 +208,14 @@ let run ?(mem=Mem.empty) (name, test) = let rec loop env = function - | Value (v, _) -> eprintf "%s: returned %s\n" name (val_to_string v); true + | Value (v, _) -> eprintf "%s: returned %s\n" name (val_to_string v); true, env | Action (a, s) -> eprintf "%s: suspended on action %s\n" name (act_to_string a); (*eprintf "%s: suspended on action %s, with stack %s\n" name (act_to_string a) (stack_to_string s);*) let return, env' = perform_action env a in eprintf "%s: action returned %s\n" name (val_to_string return); loop env' (resume test s return) - | Error(l, e) -> eprintf "%s: %s: error: %s\n" name (loc_to_string l) e; false in + | Error(l, e) -> eprintf "%s: %s: error: %s\n" name (loc_to_string l) e; false, env in eprintf "%s: starting\n" name; try Printexc.record_backtrace true; @@ -223,5 +223,5 @@ let run with e -> let trace = Printexc.get_backtrace () in eprintf "%s: interpretor error %s\n%s\n" name (Printexc.to_string e) trace; - false + false, (reg, mem) ;; -- cgit v1.2.3