• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
          • Hierarchy
          • Extract-vl-types
          • Range-tools
          • Finding-by-name
          • Stmt-tools
          • Modnamespace
          • Flat-warnings
          • Reordering-by-name
          • Datatype-tools
            • Vl-dimensionlist-total-size
            • Vl-maybe-usertype-resolve
            • Vl-dimensionlist-resolved-p
            • Vl-datatype-packedp
            • Vl-datatype-select-ok
            • Vl-dimension-size
            • Vl-datatype-size
              • Vl-maybe-dimension-size
              • Vl-hidexpr-name1
              • Maybe-nat-list
            • Syscalls
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Datatype-tools

    Vl-datatype-size

    Computes the number of bits in the datatype.

    Signature
    (vl-datatype-size x) → (mv err size)
    Arguments
    x — The datatype to size.
        Guard (vl-datatype-p x).
    Returns
    err — Type (iff (vl-msg-p err) err).
    size — Type (maybe-natp size).

    This works for unpacked datatypes as well as packed ones; you should check separately that the datatype is packed if that is what you want. Returns nil without error if given a datatype that has no fixed bit size, e.g. if it contains a real number or has unsized dimensions. We produce an error message if a usertype is not found, if the recursion limit runs out, or if unresolved dimensions are present.