From 7cfbb697db209b96449a5c311b395d64d99e20a8 Mon Sep 17 00:00:00 2001 From: Robert Norton Date: Fri, 2 Mar 2018 13:43:57 +0000 Subject: work around bug in ocaml foreach generation -- end point not included in loop (see #8). --- cheri/cheri_prelude_common.sail | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cheri') diff --git a/cheri/cheri_prelude_common.sail b/cheri/cheri_prelude_common.sail index 02a6d408..fb3f456e 100644 --- a/cheri/cheri_prelude_common.sail +++ b/cheri/cheri_prelude_common.sail @@ -385,7 +385,7 @@ function init_cp2_state () = { PCC = defaultBits; nextPCC = defaultBits; delayedPCC = defaultBits; - foreach(i from 0 to 31) { + foreach(i from 0 to 32) { let idx = to_bits(5, i) in writeCapReg(idx, default_cap); } @@ -418,7 +418,7 @@ function capToString cap = function dump_cp2_state () = { print(concat_str("DEBUG CAP PCC", capToString(capRegToCapStruct(PCC)))); - foreach(i from 0 to 31) { + foreach(i from 0 to 32) { print(concat_str("DEBUG CAP REG ", concat_str(string_of_int(i), capToString(readCapReg(to_bits(5, i)))))) } } \ No newline at end of file -- cgit v1.2.3