• 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
            • Edgesynth
            • Stmtrewrite
            • Cblock
            • Vl-always-convert-regports
            • Vl-always-convert-regs
            • Stmttemps
            • Edgesplit
            • Vl-always-check-reg
            • Vl-convert-regs
            • Latchsynth
            • Vl-always-check-regs
            • Vl-match-always-at-some-edges
            • Unelse
            • Vl-always-convert-reg
            • Vl-design-always-backend
            • Vl-stmt-guts
            • Vl-always-convert-regport
              • Vl-always-scary-regs
              • Eliminitial
              • Ifmerge
              • Vl-edge-control-p
              • Elimalways
            • 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
    • Always-top

    Vl-always-convert-regport

    Convert a reg portdecl into a wire portdecl.

    Signature
    (vl-always-convert-regport x) → new-x
    Arguments
    x — Guard (vl-portdecl-p x).
    Returns
    new-x — Type (vl-portdecl-p new-x).

    See vl-always-convert-reg.

    Definitions and Theorems

    Function: vl-always-convert-regport

    (defun vl-always-convert-regport (x)
     (declare (xargs :guard (vl-portdecl-p x)))
     (let ((__function__ 'vl-always-convert-regport))
       (declare (ignorable __function__))
       (b* (((vl-portdecl x) (vl-portdecl-fix x))
            ((unless (and (eq (vl-datatype-kind x.type)
                              :vl-coretype)
                          (member (vl-coretype->name x.type)
                                  '(:vl-reg :vl-logic))))
             (raise "Not actually a portdecl reg?  ~x0" x)
             x)
            (dims (vl-coretype->pdims x.type))
            ((unless (and (atom (vl-coretype->udims x.type))
                          (or (atom dims)
                              (and (atom (cdr dims))
                                   (vl-range-p (car dims))))))
             (raise "Multi-dimensional array on portdecl reg? ~x0"
                    x)
             x))
         (change-vl-portdecl x
                             :type (change-vl-coretype x.type
                                                       :name :vl-logic)
                             :nettype :vl-wire
                             :atts (acons (hons-copy "VL_CONVERTED_REG")
                                          nil x.atts)))))

    Theorem: vl-portdecl-p-of-vl-always-convert-regport

    (defthm vl-portdecl-p-of-vl-always-convert-regport
      (b* ((new-x (vl-always-convert-regport x)))
        (vl-portdecl-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-always-convert-regport-of-vl-portdecl-fix-x

    (defthm vl-always-convert-regport-of-vl-portdecl-fix-x
      (equal (vl-always-convert-regport (vl-portdecl-fix x))
             (vl-always-convert-regport x)))

    Theorem: vl-always-convert-regport-vl-portdecl-equiv-congruence-on-x

    (defthm vl-always-convert-regport-vl-portdecl-equiv-congruence-on-x
      (implies (vl-portdecl-equiv x x-equiv)
               (equal (vl-always-convert-regport x)
                      (vl-always-convert-regport x-equiv)))
      :rule-classes :congruence)