• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
          • Expression-sizing
          • Occform
          • Oprewrite
          • Expand-functions
          • Delayredux
          • Unparameterization
          • Caseelim
          • Split
          • Selresolve
          • Weirdint-elim
          • Vl-delta
          • Replicate-insts
          • Rangeresolve
          • Propagate
          • Clean-selects
          • Clean-params
          • Blankargs
          • Inline-mods
          • Expr-simp
          • Trunc
          • Always-top
          • Gatesplit
            • Vl-gatesplit-nand/nor/xnor
            • Vl-modulelist-gatesplit
            • Vl-gatesplit-and/or/xor
            • Vl-degenerate-gate-to-buf
            • Vl-gatesplit-buf/not
            • Vl-make-temporary-wires
              • Vl-gateinst-gatesplit
              • Vl-gateinstlist-gatesplit
              • Vl-module-gatesplit
              • Vl-design-gatesplit
            • Gate-elim
            • Expression-optimization
            • Elim-supplies
            • Wildelim
            • Drop-blankports
            • Clean-warnings
            • Addinstnames
            • Custom-transform-hooks
            • Annotate
            • Latchcode
            • Elim-unused-vars
            • Problem-modules
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Gatesplit

    Vl-make-temporary-wires

    Generate expressions and declarations for some fresh, one-bit wires.

    Signature
    (vl-make-temporary-wires prefix i nf loc) 
      → 
    (mv exprs vardecls nf)
    Arguments
    prefix — Prefix for name generation.
        Guard (stringp prefix).
    i — How many wires to create.
        Guard (natp i).
    nf — Namefactory for generating fresh names.
        Guard (vl-namefactory-p nf).
    loc — Location for the new wire declarations.
        Guard (vl-location-p loc).
    Returns
    exprs — Expressions for the new one-bit wires.
        Type (and (vl-exprlist-p exprs) (equal (len exprs) (nfix i))).
    vardecls — Declarations for the new wires.
        Type (vl-vardecllist-p vardecls), given (force (vl-location-p loc)).
    nf — Type (vl-namefactory-p nf), given (and (force (stringp prefix)) (force (vl-namefactory-p nf))).

    Definitions and Theorems

    Function: vl-make-temporary-wires

    (defun vl-make-temporary-wires (prefix i nf loc)
      (declare (xargs :guard (and (stringp prefix)
                                  (natp i)
                                  (vl-namefactory-p nf)
                                  (vl-location-p loc))))
      (let ((__function__ 'vl-make-temporary-wires))
        (declare (ignorable __function__))
        (b* (((when (zp i)) (mv nil nil nf))
             ((mv new-name nf)
              (vl-namefactory-indexed-name prefix nf))
             (expr1 (make-vl-atom :guts (make-vl-id :name new-name)
                                  :finalwidth 1
                                  :finaltype :vl-unsigned))
             (decl1 (make-vl-vardecl :name new-name
                                     :type *vl-plain-old-wire-type*
                                     :nettype :vl-wire
                                     :loc loc))
             ((mv exprs decls nf)
              (vl-make-temporary-wires prefix (- i 1)
                                       nf loc)))
          (mv (cons expr1 exprs)
              (cons decl1 decls)
              nf))))

    Theorem: return-type-of-vl-make-temporary-wires.exprs

    (defthm return-type-of-vl-make-temporary-wires.exprs
      (b* (((mv ?exprs ?vardecls ?nf)
            (vl-make-temporary-wires prefix i nf loc)))
        (and (vl-exprlist-p exprs)
             (equal (len exprs) (nfix i))))
      :rule-classes :rewrite)

    Theorem: vl-vardecllist-p-of-vl-make-temporary-wires.vardecls

    (defthm vl-vardecllist-p-of-vl-make-temporary-wires.vardecls
      (implies (force (vl-location-p loc))
               (b* (((mv ?exprs ?vardecls ?nf)
                     (vl-make-temporary-wires prefix i nf loc)))
                 (vl-vardecllist-p vardecls)))
      :rule-classes :rewrite)

    Theorem: vl-namefactory-p-of-vl-make-temporary-wires.nf

    (defthm vl-namefactory-p-of-vl-make-temporary-wires.nf
      (implies (and (force (stringp prefix))
                    (force (vl-namefactory-p nf)))
               (b* (((mv ?exprs ?vardecls ?nf)
                     (vl-make-temporary-wires prefix i nf loc)))
                 (vl-namefactory-p nf)))
      :rule-classes :rewrite)

    Theorem: vl-make-temporary-wires-mvtypes-0

    (defthm vl-make-temporary-wires-mvtypes-0
      (true-listp (mv-nth 0
                          (vl-make-temporary-wires prefix i nf loc)))
      :rule-classes :type-prescription)

    Theorem: vl-make-temporary-wires-mvtypes-1

    (defthm vl-make-temporary-wires-mvtypes-1
      (true-listp (mv-nth 1
                          (vl-make-temporary-wires prefix i nf loc)))
      :rule-classes :type-prescription)

    Theorem: vl-make-temporary-wires-0-under-iff

    (defthm vl-make-temporary-wires-0-under-iff
      (iff (mv-nth 0
                   (vl-make-temporary-wires prefix i nf loc))
           (not (zp i))))