From a8898154d4661803db0c8a6eafc85ab734d4d5d5 Mon Sep 17 00:00:00 2001 From: Ivan Ribeiro Date: Sat, 30 Sep 2023 18:27:35 +0100 Subject: [PATCH] Add functions to CHERICapWrap.bsv --- CHERICapWrap.bsv | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHERICapWrap.bsv b/CHERICapWrap.bsv index 0c5402a..53b297b 100644 --- a/CHERICapWrap.bsv +++ b/CHERICapWrap.bsv @@ -95,5 +95,11 @@ function Bool `W(validAsType) (`CAPTYPE dummy, Bit#(CapAddrW) checkType) = valid function `CAPTYPE `W(fromMem) (Tuple2#(Bool, Bit#(CapW)) mem_cap) = fromMem(mem_cap); (* noinline *) function Tuple2#(Bool, Bit#(CapW)) `W(toMem) (`CAPTYPE cap) = toMem(cap); +(* noinline *) +function Bit#(CapAddrW) `W(getRepresentableAlignmentMask) (`CAPTYPE dummy, Bit#(CapAddrW) length) = alignmentMask (dummy, length); +(* noinline *) +function Bit#(CapAddrW) `W(getRepresentableLength) (`CAPTYPE dummy, Bit#(CapAddrW) length) = roundLength (dummy, length); +(* noinline *) +function Bit#(2) `W(getBaseAlignment) (`CAPTYPE cap) = getBaseAlignment(cap); endpackage