• 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
            • Vl-expr-expand-function-calls
            • Vl-expand-function-call
            • Vl-module-expand-functions
            • Vl-modulelist-expand-functions
            • Vl-check-bad-funcalls
            • Vl-funtemplate
              • Vl-funtemplate-p
                • Vl-fun-vardecllist-to-vardecls
                • Vl-funinputlist-to-vardecls
                • Vl-fundecl-expansion-template
                • Vl-funinput-to-vardecl
                • Vl-fundecllist-expansion-templates
                • Vl-fun-vardecllist-types-okp
                • Vl-portdecllist-types-okp
                • Vl-fun-vardecl-to-vardecl
                  • Vl-find-funtemplate
                  • Vl-funtemplatelist
                • Vl-funtemplate-fix
                • Vl-funtemplate-equiv
                • Make-vl-funtemplate
                • Vl-funtemplate->locals
                • Vl-funtemplate->inputs
                • Vl-funtemplate->assigns
                • Change-vl-funtemplate
                • Vl-funtemplate->out
                • Vl-funtemplate->name
              • Vl-funbody-to-assignments
              • Vl-assignlist->rhses
              • Vl-fundecl-expand-params
              • Vl-fun-stmt-okp
              • Vl-fundecllist-expand-params
              • Vl-remove-fake-function-vardecls
              • Vl-design-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
            • 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
    • Vl-funtemplate-p

    Vl-fun-vardecl-to-vardecl

    Convert a function's var declaration into a net declaration for its funtemplate.

    Signature
    (vl-fun-vardecl-to-vardecl x) → vardecl
    Arguments
    x — Guard (vl-vardecl-p x).
    Returns
    vardecl — Type (vl-vardecl-p vardecl).

    We assume the input is okay in the sense of vl-fun-vardecllist-types-okp.

    Definitions and Theorems

    Function: vl-fun-vardecl-to-vardecl

    (defun vl-fun-vardecl-to-vardecl (x)
     (declare (xargs :guard (vl-vardecl-p x)))
     (declare (xargs :guard (vl-simplereg-p x)))
     (let ((__function__ 'vl-fun-vardecl-to-vardecl))
      (declare (ignorable __function__))
      (b*
       (((vl-vardecl x) x)
        (name-atom (make-vl-atom :guts (make-vl-string :value x.name)))
        (range (vl-simplereg->range x))
        (type (make-vl-coretype :name :vl-logic
                                :pdims (and range (list range))
                                :signedp (vl-simplereg->signedp x))))
       (make-vl-vardecl :name x.name
                        :type type
                        :nettype :vl-wire
                        :atts (acons "VL_FUNCTION_VAR" name-atom x.atts)
                        :loc x.loc))))

    Theorem: vl-vardecl-p-of-vl-fun-vardecl-to-vardecl

    (defthm vl-vardecl-p-of-vl-fun-vardecl-to-vardecl
      (b* ((vardecl (vl-fun-vardecl-to-vardecl x)))
        (vl-vardecl-p vardecl))
      :rule-classes :rewrite)