diff options
Diffstat (limited to 'cheri/cheri_prelude.sail')
| -rw-r--r-- | cheri/cheri_prelude.sail | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cheri/cheri_prelude.sail b/cheri/cheri_prelude.sail index 7c5e34a9..8fa3b180 100644 --- a/cheri/cheri_prelude.sail +++ b/cheri/cheri_prelude.sail @@ -416,3 +416,12 @@ function (bit[64]) TranslateAddress ((bit[64]) vAddr, (MemAccessType) accessType exit (raise_c2_exception_noreg(CapEx_LengthViolation)) (* XXX take exception properly *) else TLBTranslate(absPC, accessType) + +function unit checkCP2usable () = + { + if (~((CP0Status.CU)[2])) then + { + (CP0Cause.CE) := 0b10; + exit (SignalException(CpU)); + } + } |
