• 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-packedp

    Decide whether the datatype is packed or not.

    Signature
    (vl-datatype-packedp x) → packedp
    Arguments
    x — Guard (vl-datatype-p x).

    A shallow check; e.g. we don't check for invalid things such as a packed struct with a member that's an unpacked array.

    Note that the question of whether something is packed is subtly different from the question of whether you can select from it: namely, simple bit types such as logic are packed but not selectable.

    Definitions and Theorems

    Function: vl-datatype-packedp

    (defun
       vl-datatype-packedp (x)
       (declare (xargs :guard (vl-datatype-p x)))
       (declare (xargs :guard (vl-datatype-resolved-p x)))
       (let ((__function__ 'vl-datatype-packedp))
            (declare (ignorable __function__))
            (b* ((x (vl-maybe-usertype-resolve x))
                 ((when (consp (vl-datatype->udims x)))
                  nil)
                 ((when (consp (vl-datatype->pdims x)))
                  t))
                (vl-datatype-case
                     x
                     :vl-coretype (b* (((vl-coredatatype-info xinfo)
                                        (vl-coretypename->info x.name)))
                                      (and xinfo.size t))
                     :vl-struct x.packedp
                     :vl-union x.packedp
                     :vl-enum t
                     :vl-usertype (impossible)))))

    Theorem: vl-datatype-packedp-of-vl-datatype-fix-x

    (defthm vl-datatype-packedp-of-vl-datatype-fix-x
            (equal (vl-datatype-packedp (vl-datatype-fix x))
                   (vl-datatype-packedp x)))

    Theorem: vl-datatype-packedp-vl-datatype-equiv-congruence-on-x

    (defthm vl-datatype-packedp-vl-datatype-equiv-congruence-on-x
            (implies (vl-datatype-equiv x x-equiv)
                     (equal (vl-datatype-packedp x)
                            (vl-datatype-packedp x-equiv)))
            :rule-classes :congruence)