Fix swapped derivability checks

This commit is contained in:
Peter Rugg
2020-03-31 17:51:36 +01:00
parent 486d7b31eb
commit 8fbf0377f9

View File

@@ -1078,8 +1078,8 @@ instance CHERICap #(CapReg, OTypeW, FlagsW, CapAddressW, CapW, TSub#(MW, 3));
function Bool isDerivable (CapReg cap); function Bool isDerivable (CapReg cap);
return cap.bounds.exp <= resetExp return cap.bounds.exp <= resetExp
&& !(cap.bounds.exp == resetExp && ((truncateLSB(cap.bounds.topBits) != 1'b0) || (cap.bounds.baseBits[valueOf(TSub#(MW,1))] != 1'b0))) && !(cap.bounds.exp == resetExp && ((truncateLSB(cap.bounds.topBits) != 1'b0) || (truncateLSB(cap.bounds.baseBits) != 2'b0)))
&& !(cap.bounds.exp == resetExp-1 && (cap.bounds.baseBits[valueOf(TSub#(MW,1)):valueOf(TSub#(MW,2))] != 2'b0)) && !(cap.bounds.exp == resetExp-1 && (truncateLSB(cap.bounds.baseBits) != 2'b0))
&& (cap.reserved == 0); && (cap.reserved == 0);
endfunction endfunction