• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Riscv
          • Specification
            • Semantics
            • Features
              • Feat-base
              • Feat-endian
              • Feat
              • Feat->xlen
                • Feat->ialign
                • Feat->xnum
                • Feat-64p
                • Feat-32p
                • Feat-little-endianp
                • Feat-big-endianp
                • Feat->ilen
                • Feat-embedp
                • Feat-mp
              • Instructions
              • Encoding
              • States
              • Reads-over-writes
              • Semantics-equivalences
              • Decoding
              • Execution
            • Executable
            • Specialized
            • Optimized
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Features

    Feat->xlen

    The XLEN parameter [ISA:1.3].

    Signature
    (feat->xlen feat) → xlen
    Arguments
    feat — Guard (featp feat).
    Returns
    xlen — Type (posp xlen).

    This is the register width, depending on the choice of base.

    Definitions and Theorems

    Function: feat->xlen

    (defun feat->xlen (feat)
      (declare (xargs :guard (featp feat)))
      (let ((__function__ 'feat->xlen))
        (declare (ignorable __function__))
        (b* (((feat feat) feat))
          (feat-base-case feat.base
                          :rv32i 32
                          :rv64i 64
                          :rv32e 32
                          :rv64e 64))))

    Theorem: posp-of-feat->xlen

    (defthm posp-of-feat->xlen
      (b* ((xlen (feat->xlen feat)))
        (posp xlen))
      :rule-classes (:rewrite :type-prescription))

    Theorem: feat->xlen-when-32-bits

    (defthm feat->xlen-when-32-bits
      (implies (feat-32p feat)
               (b* ((?xlen (feat->xlen feat)))
                 (equal xlen 32))))

    Theorem: feat->xlen-when-64-bits

    (defthm feat->xlen-when-64-bits
      (implies (feat-64p feat)
               (b* ((?xlen (feat->xlen feat)))
                 (equal xlen 64))))

    Theorem: feat->xlen-of-feat-fix-feat

    (defthm feat->xlen-of-feat-fix-feat
      (equal (feat->xlen (feat-fix feat))
             (feat->xlen feat)))

    Theorem: feat->xlen-feat-equiv-congruence-on-feat

    (defthm feat->xlen-feat-equiv-congruence-on-feat
      (implies (feat-equiv feat feat-equiv)
               (equal (feat->xlen feat)
                      (feat->xlen feat-equiv)))
      :rule-classes :congruence)