From 5abf3ae1be4eb936ff1d3291d2998fac1c746c3a Mon Sep 17 00:00:00 2001 From: Robert Norton Date: Thu, 26 Jan 2017 15:35:37 +0000 Subject: fix incorrect constant in calculation of representable boundary (should be B - 2**12) --- cheri/cheri_prelude_128.sail | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cheri/cheri_prelude_128.sail b/cheri/cheri_prelude_128.sail index ba2d9186..b864ba64 100644 --- a/cheri/cheri_prelude_128.sail +++ b/cheri/cheri_prelude_128.sail @@ -187,7 +187,7 @@ function bit[64] getCapBase((CapStruct) c) = let ([|63|]) E = min(unsigned(c.E), 45) in let (bit[20]) B = c.B in let (bit[64]) a = c.address in - let (bit[20]) R = B - 0x00100 in (* wraps *) + let (bit[20]) R = B - 0x01000 in (* wraps *) let (bit[20]) a_mid = a[(E + 19)..E] in let (int) correction = a_top_correction(a_mid, R, B) in let a_top = a[63..(E+20)] in @@ -199,7 +199,7 @@ function bit[65] getCapTop((CapStruct) c) = let (bit[20]) B = c.B in let (bit[20]) T = c.T in let (bit[64]) a = c.address in - let (bit[20]) R = B - 0x00100 in (* wraps *) + let (bit[20]) R = B - 0x01000 in (* wraps *) let (bit[20]) a_mid = a[(E + 19)..E] in let (int) correction = a_top_correction(a_mid, R, T) in let a_top = a[63..(E+20)] in -- cgit v1.2.3