From f7884bb932b33355be650d0bc9be9ef8702fafcd Mon Sep 17 00:00:00 2001 From: Akilan Date: Fri, 20 Feb 2026 01:59:12 +0000 Subject: [PATCH] hack changes --- CHERICC_Fat.bsv | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHERICC_Fat.bsv b/CHERICC_Fat.bsv index 0e8dc35..a712ac4 100644 --- a/CHERICC_Fat.bsv +++ b/CHERICC_Fat.bsv @@ -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