From 3c6d20318631b714f884b5f60d41264af0e0af5a Mon Sep 17 00:00:00 2001 From: Akilan Date: Thu, 5 Mar 2026 17:40:03 +0000 Subject: [PATCH] saving commented delta changes --- CHERICC_Fat.bsv | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHERICC_Fat.bsv b/CHERICC_Fat.bsv index 38840fb..70baf84 100644 --- a/CHERICC_Fat.bsv +++ b/CHERICC_Fat.bsv @@ -1408,6 +1408,10 @@ instance CHERICap #(CapPipe, OTypeW, FlagsW, CapAddrW, CapW, TSub#(MW, 3)); , mask: result.mask }; endfunction + // TODO: Similar to set bounds but sets the delta value between the 38th and 64th bit + // function setDeltaValue (cap, length); + // endfunction + // Create function to set delta value // function setDeltaValue (CapPipe cap, Bit#(Delta) delta); // // let result = setDelta(cap.capFat, delta); @@ -1415,6 +1419,24 @@ instance CHERICap #(CapPipe, OTypeW, FlagsW, CapAddrW, CapW, TSub#(MW, 3)); // return cap; // endfunction + // function Bit#(CapAddrW) encodeDelta(Bit#(CapAddrW) addr, Bit#(Delta) delta); + // // Bits 0..38: actual virtual address + // let va_bits = addr[38:0]; + + // // Bits 63:39: store delta in upper bits + // let delta_bits = zeroExtend(delta); // extend delta to 25 bits (63-39+1 = 25) + // let delta_bits_truncated = delta_bits[24:0]; // ensure fits exactly in bits 63:39 + + // return {delta_bits_truncated, va_bits}; + // endfunction + + // // Extract the delta stored in bits 63:39 of the address + // function Bit#(Delta) decodeDelta(Bit#(CapAddrW) addr); + // // Bits 63:39 contain the delta + // let delta_bits = addr[63:39]; // 25 bits + // return truncate(delta_bits); // truncate to the width of Delta + // endfunction + function nullWithAddr (addr);