Skip to content

Commit

Permalink
Factor maxE and maxT to cap_common
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterRugg committed Oct 20, 2020
1 parent eb53bf8 commit 69869a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/cheri_cap_common.sail
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ type CapLen = range(0, (2 ^ cap_len_width) - 1)
type CapPermsBits = bits(cap_perms_width)
type CapFlagsBits = bits(cap_flags_width)

/* Reset E and T calculated to make top 2**xlen. */
let maxE = cap_len_width - cap_mantissa_width
let resetE = to_bits(cap_exp_width, maxE)
let resetT = 0b01 @ zeros(cap_mantissa_width - 2)

/* A partially decompressed version of a capability -- E, B, T,
* lenMSB, sealed and otype fields are not present in all formats and are
* populated by capBitsToCapability.
Expand Down
4 changes: 0 additions & 4 deletions src/cheri_prelude_128.sail
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,8 @@ let cap_addr_width = sizeof(cap_addr_width)
type cap_len_width : Int = cap_addr_width + 2
let cap_len_width = sizeof(cap_len_width)

/* Reset E and T calculated to make top 2**64. */
let maxE = 52
type internal_exponent_take_bits : Int = 3
let internal_exponent_take_bits = sizeof(internal_exponent_take_bits)
let resetE = to_bits(cap_exp_width, maxE)
let resetT = 0b01 @ 0x000 /* bit 12 set */

/* Capability format completely compressed. Tag is out of band */
struct EncCapability = {
Expand Down
4 changes: 0 additions & 4 deletions src/cheri_prelude_64.sail
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,8 @@ let cap_addr_width = sizeof(cap_addr_width)
type cap_len_width : Int = cap_addr_width + 2
let cap_len_width = sizeof(cap_len_width)

/* Reset E and T calculated to make top 2**64. */
let maxE = 26
type internal_exponent_take_bits : Int = 3
let internal_exponent_take_bits = sizeof(internal_exponent_take_bits)
let resetE = to_bits(cap_exp_width, maxE)
let resetT = 0b01000000 /* bit 6 set */

/* Capability format completely compressed. Tag is out of band */
struct EncCapability = {
Expand Down

0 comments on commit 69869a4

Please sign in to comment.