• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
          • Typo-detection
          • Vl-wireinfo-alistp
          • Vl-annotate-vardecllist-with-wireinfo
          • Vl-useset-report-entry-p
          • Vl-print-useset-report-entry
          • Vl-mark-wires-for-module
          • Vl-split-useset-report
          • Vl-annotate-vardecl-with-wireinfo
            • Vl-mark-wires-for-modinstlist
            • Vl-mark-wires-for-modinst
            • Vl-mark-wires-for-gateinstlist
            • Vl-mark-wires-for-gateinst
            • Vl-mark-wires-for-plainarg
            • Vl-wireinfo-p
            • Vl-mark-wires-for-modulelist
            • Vl-vardecllist-impexp-names
            • Vl-report-totals
            • Vl-mark-wires-for-plainarglist
            • Vl-collect-unused-or-unset-wires
            • Vl-clean-up-warning-wires
            • Vl-print-useset-report-top
            • Vl-mark-wires-for-arguments
            • Vl-useset-report-p
            • Vl-star-names-of-warning-wires
            • Vl-design-use-set-report
            • Vl-module-impexp-names
            • Vl-make-initial-wireinfo-alist
            • Vl-mark-wire-used
            • Vl-mark-wire-set
            • Vl-mark-wires-used
            • Vl-mark-wires-for-assignment
            • Vl-mark-wires-for-assignlist
            • Vl-mark-wires-set
            • Vl-print-useset-report-full-aux
            • Vl-print-typo-alist
            • Vl-print-typo-possibilities
          • Syntax
          • Getting-started
          • Utilities
          • Loader
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Use-set

    Vl-annotate-vardecl-with-wireinfo

    Annotate vardecls with the results of use-set analysis.

    Signature
    (vl-annotate-vardecl-with-wireinfo x alist wwires) → new-x
    Arguments
    x — A net declaration.
        Guard (vl-vardecl-p x).
    alist — The wireinfo alist we collected for this module.
        Guard (vl-wireinfo-alistp alist).
    wwires — The warning wires we're unsure about.
        Guard (string-listp wwires).
    Returns
    new-x — A copy of X, possibly extended with some attributes.
        Type (vl-vardecl-p new-x), given (force (vl-vardecl-p x)).

    We add as many as two annotations to X. The possible annotations we add are

    • VL_UNUSED - Appears to be unused, not a warning wire
    • VL_MAYBE_UNUSED - Appears to be unused, but is a warning wire
    • VL_UNSET - Appears to be unset, not a warning wire
    • VL_MAYBE_UNSET - Appears to be unset, but is a warning wire

    Definitions and Theorems

    Function: vl-annotate-vardecl-with-wireinfo

    (defun vl-annotate-vardecl-with-wireinfo (x alist wwires)
      (declare (xargs :guard (and (vl-vardecl-p x)
                                  (vl-wireinfo-alistp alist)
                                  (string-listp wwires))))
      (let ((__function__ 'vl-annotate-vardecl-with-wireinfo))
        (declare (ignorable __function__))
        (b* ((name (vl-vardecl->name x))
             (info (cdr (hons-get name alist)))
             ((unless info)
              (raise "No wireinfo entry for ~s0." name)
              x)
             (usedp (vl-wireinfo->usedp info))
             (setp (vl-wireinfo->setp info))
             ((when (and usedp setp)) x)
             (atts (vl-vardecl->atts x))
             (warnp (member-equal name wwires))
             (atts (cond (usedp atts)
                         (warnp (cons (list "VL_MAYBE_UNUSED") atts))
                         (t (cons (list "VL_UNUSED") atts))))
             (atts (cond (setp atts)
                         (warnp (cons (list "VL_MAYBE_UNSET") atts))
                         (t (cons (list "VL_UNSET") atts)))))
          (change-vl-vardecl x :atts atts))))

    Theorem: vl-vardecl-p-of-vl-annotate-vardecl-with-wireinfo

    (defthm vl-vardecl-p-of-vl-annotate-vardecl-with-wireinfo
     (implies
        (force (vl-vardecl-p x))
        (b* ((new-x (vl-annotate-vardecl-with-wireinfo x alist wwires)))
          (vl-vardecl-p new-x)))
     :rule-classes :rewrite)