Move getLength to address length (not address length + 1), as we're explicitly saturating in order to express as a normal address.

This commit is contained in:
Jonathan Woodruff
2025-02-04 16:31:01 +00:00
parent 3926b793bf
commit b3896e4e50
3 changed files with 6 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ typedef union tagged {
typedef struct {
Bit #(addrW) base;
Bit #(TAdd #(addrW, 1)) top;
Bit #(TAdd #(addrW, 1)) length;
Bit #(addrW) length;
Bit #(addrW) repBase;
Bit #(TAdd #(addrW, 1)) repTop;
Bit #(TAdd #(addrW, 1)) repLength;
@@ -258,7 +258,7 @@ typeclass CHERICap #( type capT // type of the CHERICap capability
// Get the top
function Bit #(TAdd #(addrW, 1)) getTop (capT cap) = getBoundsInfo(cap).top;
// Get the length
function Bit #(TAdd #(addrW, 1)) getLength (capT cap) =
function Bit #(addrW) getLength (capT cap) =
getBoundsInfo(cap).length;
// Assertion that the capability's address is between its base and top
function Bool isInBounds (capT cap, Bool isTopIncluded) =