summaryrefslogtreecommitdiff
path: root/mips/main.sail
diff options
context:
space:
mode:
authorRobert Norton2018-06-27 16:18:00 +0100
committerRobert Norton2018-06-27 18:03:12 +0100
commit230cbb018b6808b103d1a815de64d48422a88191 (patch)
treea2d9a05de365db72ee23008e13b732b7154f098a /mips/main.sail
parenta7e350250069a46652d2f07351701d814024d882 (diff)
Add a new function cycle_limit_reached that returns bool, allowing for graceful exit on reaching cycle limit. This aids coverage and valgrind instrumentation.
Diffstat (limited to 'mips/main.sail')
-rw-r--r--mips/main.sail7
1 files changed, 3 insertions, 4 deletions
diff --git a/mips/main.sail b/mips/main.sail
index 87354b90..8fc48f9a 100644
--- a/mips/main.sail
+++ b/mips/main.sail
@@ -1,7 +1,7 @@
-val cycle_count = { c: "cycle_count" } : unit -> unit
+val cycle_limit_reached = { c: "cycle_limit_reached" } : unit -> bool
-function cycle_count() = ()
+function cycle_limit_reached() = false
register instCount : int
@@ -42,8 +42,7 @@ function fetch_and_execute () = {
just continue from nextPC, which should have been set to the appropriate
exception vector (along with clearing branchPending etc.) . */
};
- cycle_count();
- loop_again;
+ loop_again & not (cycle_limit_reached());
}
val elf_entry = {