This commit is contained in:
@@ -40,8 +40,8 @@ export CapPipe;
|
||||
export CapFat;
|
||||
export MW;
|
||||
export OTypeW;
|
||||
export Delta;
|
||||
export setDeltaValue;
|
||||
// export Delta;
|
||||
// export setDeltaValue;
|
||||
export FlagsW;
|
||||
export Perms;
|
||||
export ResW;
|
||||
@@ -61,8 +61,8 @@ export Exp;
|
||||
export MetaInfo;
|
||||
export SetBoundsReturn;
|
||||
export CapTrim;
|
||||
// export trimCap;
|
||||
// export untrimCap;
|
||||
export trimCap;
|
||||
export untrimCap;
|
||||
export CapAddr;
|
||||
export CapAddrPlus1;
|
||||
|
||||
@@ -86,20 +86,20 @@ typedef 0 UPermW;
|
||||
typedef 8 MW;
|
||||
typedef 6 ExpW;
|
||||
typedef 4 OTypeW;
|
||||
typedef 24 Delta;
|
||||
// typedef 24 Delta;
|
||||
typedef `FLAGSW FlagsW;
|
||||
typedef 32 CapAddrW;
|
||||
typedef 88 CapW;
|
||||
typedef 64 CapW;
|
||||
`else // CAP128 is default
|
||||
typedef 4 UPermW;
|
||||
typedef 14 MW;
|
||||
typedef 6 ExpW;
|
||||
typedef 18 OTypeW;
|
||||
typedef 44 Delta;
|
||||
// typedef 44 Delta;
|
||||
typedef `FLAGSW FlagsW;
|
||||
typedef 64 CapAddrW;
|
||||
// The capability width changes
|
||||
typedef 172 CapW;
|
||||
typedef 128 CapW;
|
||||
`endif
|
||||
|
||||
// The Address type is used to represent the full sized address returned to the
|
||||
@@ -144,7 +144,6 @@ typedef SizeOf#(Perms) PermsW;
|
||||
// The reserved bits
|
||||
typedef TSub#(CapW, TAdd#( CapAddrW
|
||||
, TAdd#( OTypeW
|
||||
, TAdd#( Delta
|
||||
, TAdd#( CBoundsW
|
||||
, TAdd#(PermsW, FlagsW)))))) ResW;
|
||||
// The full capability structure, including the "tag" bit.
|
||||
@@ -154,7 +153,7 @@ typedef struct {
|
||||
Bit#(ResW) reserved;
|
||||
Bit#(FlagsW) flags;
|
||||
Bit#(OTypeW) otype;
|
||||
Bit#(Delta) delta;
|
||||
// Bit#(Delta) delta;
|
||||
CBounds bounds;
|
||||
CapAddr address;
|
||||
} CapabilityInMemory deriving (Bits, Eq, FShow); // CapW + 1 (tag bit)
|
||||
@@ -190,7 +189,7 @@ typedef struct {
|
||||
Bit#(FlagsW) flags;
|
||||
Bit#(ResW) reserved;
|
||||
Bit#(OTypeW) otype;
|
||||
Bit#(Delta) delta;
|
||||
// Bit#(Delta) delta;
|
||||
Format format;
|
||||
Bounds bounds;
|
||||
} CapFat deriving (Bits);
|
||||
@@ -237,7 +236,7 @@ function CapFat unpackCap(Capability thin);
|
||||
fat.flags = memCap.flags;
|
||||
fat.reserved = memCap.reserved;
|
||||
fat.otype = memCap.otype;
|
||||
fat.delta = memCap.delta;
|
||||
// fat.delta = memCap.delta;
|
||||
match {.f, .b} = decBounds(memCap.bounds);
|
||||
fat.format = f;
|
||||
fat.bounds = b;
|
||||
@@ -1054,7 +1053,7 @@ typedef struct {
|
||||
// Note: commented out methods have a provided default implementation in the
|
||||
// CHERICap typeclass definition
|
||||
|
||||
instance CHERICap #(CapMem, OTypeW, FlagsW, CapAddrW, CapW, TSub #(MW, 3), Delta);
|
||||
instance CHERICap #(CapMem, OTypeW, FlagsW, CapAddrW, CapW, TSub #(MW, 3));
|
||||
|
||||
// capability validity
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1122,7 +1121,7 @@ instance CHERICap #(CapMem, OTypeW, FlagsW, CapAddrW, CapW, TSub #(MW, 3), Delta
|
||||
, pack (cap.reserved)
|
||||
, pack (cap.flags)
|
||||
, pack (cap.otype)
|
||||
, pack (cap.delta)
|
||||
// , pack (cap.delta)
|
||||
, pack (cap.bounds) };
|
||||
endfunction
|
||||
function getAddr (capMem);
|
||||
@@ -1213,7 +1212,7 @@ endinstance
|
||||
// Note: commented out methods have a provided default implementation in the
|
||||
// CHERICap typeclass definition
|
||||
|
||||
instance CHERICap #(CapReg, OTypeW, FlagsW, CapAddrW, CapW, TSub #(MW, 3), Delta);
|
||||
instance CHERICap #(CapReg, OTypeW, FlagsW, CapAddrW, CapW, TSub #(MW, 3));
|
||||
|
||||
// capability validity
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1361,7 +1360,7 @@ instance CHERICap #(CapReg, OTypeW, FlagsW, CapAddrW, CapW, TSub #(MW, 3), Delta
|
||||
|
||||
endinstance
|
||||
|
||||
instance CHERICap #(CapPipe, OTypeW, FlagsW, CapAddrW, CapW, TSub#(MW, 3), Delta);
|
||||
instance CHERICap #(CapPipe, OTypeW, FlagsW, CapAddrW, CapW, TSub#(MW, 3));
|
||||
|
||||
//Functions supported by CapReg are just passed through
|
||||
|
||||
@@ -1410,11 +1409,11 @@ instance CHERICap #(CapPipe, OTypeW, FlagsW, CapAddrW, CapW, TSub#(MW, 3), Delta
|
||||
endfunction
|
||||
|
||||
// Create function to set delta value
|
||||
function setDeltaValue (CapPipe cap, Bit#(Delta) delta);
|
||||
// let result = setDelta(cap.capFat, delta);
|
||||
cap.capFat.delta = delta;
|
||||
return cap;
|
||||
endfunction
|
||||
// function setDeltaValue (CapPipe cap, Bit#(Delta) delta);
|
||||
// // let result = setDelta(cap.capFat, delta);
|
||||
// cap.capFat.delta = delta;
|
||||
// return cap;
|
||||
// endfunction
|
||||
|
||||
|
||||
|
||||
@@ -1544,7 +1543,7 @@ typedef 48 VA_Width;
|
||||
typedef struct {
|
||||
Perms perms;
|
||||
Bit#(FlagsW) flags;
|
||||
Bit#(Delta) delta;
|
||||
// Bit#(Delta) delta;
|
||||
CBounds bounds;
|
||||
Bit#(VA_Width) address;
|
||||
Bool validAddress;
|
||||
|
||||
@@ -155,7 +155,7 @@ typeclass CHERICap #( type capT // type of the CHERICap capability
|
||||
, numeric type maskableW // width of maskable bits
|
||||
, numeric type delta // size of delta (tlb bypass)
|
||||
)
|
||||
dependencies (capT determines (otypeW, flgW, addrW, inMemW, maskableW, delta));
|
||||
dependencies (capT determines (otypeW, flgW, addrW, inMemW, maskableW));
|
||||
|
||||
// capability validity
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -321,8 +321,8 @@ typeclass CHERICap #( type capT // type of the CHERICap capability
|
||||
// the null capability (requires a dummy proxy)
|
||||
function capT nullCapFromDummy (capT dummy);
|
||||
|
||||
// define set delta function
|
||||
function capT setDeltaValue (capT cap, Bit #(delta) length);
|
||||
// define set delta function (Disabled when we will use the virtual addresses)
|
||||
// function capT setDeltaValue (capT cap, Bit #(delta) length);
|
||||
|
||||
// Assert that the encoding is valid
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user