This commit is contained in:
@@ -161,7 +161,8 @@ typedef struct {
|
||||
// The full capability structure as Bits, including the "tag" bit.
|
||||
typedef Bit#(TAdd#(CapW,1)) Capability;
|
||||
// not including the tag bit
|
||||
typedef Bit#(CapW) CapBits;
|
||||
// Hard-coded
|
||||
typedef Bit#(128) CapBits;
|
||||
/* TODO
|
||||
staticAssert(valueOf(SizeOf#(CapabilityInMemory))==valueOf(SizeOf#(Capability)),
|
||||
"The CapabilityInMemory type has incorrect size of " + integerToString(valueOf(SizeOf#(CapabilityInMemory))) + " (CapW = " + integerToString(valueOf(CapW)) + ")"
|
||||
@@ -1588,4 +1589,16 @@ typedef struct {
|
||||
// });
|
||||
// endfunction
|
||||
|
||||
// Standalone fromMem wrapper for CapPipe
|
||||
function CapPipe fromMemTest(Tuple2#(Bool, Bit#(CapW)) capBits);
|
||||
// capBits.fst = Bool tag
|
||||
// capBits.snd = concatenated bits (e.g., {getAddr(b), getAddr(a)})
|
||||
|
||||
// Reconstruct the underlying CapReg (or CapFat)
|
||||
CapReg res = fromMem(capBits);
|
||||
|
||||
// Wrap into CapPipe with tempFields
|
||||
return CapPipe { capFat: res, tempFields: getTempFields(res) };
|
||||
endfunction
|
||||
|
||||
endpackage
|
||||
|
||||
Reference in New Issue
Block a user