• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
          • Unparameterization
          • Elaborate
          • Addnames
          • Annotate
            • Increment-elim
            • Make-implicit-wires
            • Basic-bind-elim
            • Argresolve
            • Basicsanity
            • Portdecl-sign
            • Enum-names
            • Port-resolve
              • Vl-modulelist-resolve-nonansi-interfaceports
              • Vl-interfacelist-resolve-nonansi-interfaceports
              • Vl-ansi-portdecl-resolve
              • Vl-interfacelist-resolve-ansi-portdecls
              • Vl-modulelist-resolve-ansi-portdecls
              • Vl-ansi-portdecl-to-regularport
              • Vl-ansi-portdecl-to-regularport-from-previous-regularport
              • Vl-resolve-ansi-portdecls
              • Vl-nettype-for-parsed-ansi-port
              • Vl-loaditems-remove-interfaceport-decls
              • Vl-vardecl-is-really-interfaceport
                • Vl-name-is-interface-or-type
                • Vl-interface/type-warn-about-unexpected-lookup
                • Vl-interface-resolve-nonansi-interfaceports
                • Vl-module-resolve-nonansi-interfaceports
                • Vl-interface-resolve-ansi-portdecls
                • Vl-ports-resolve-interfaces
                • Vl-module-resolve-ansi-portdecls
                • Vl-ansi-portdecl-consistency-check
                • Vl-design-resolve-nonansi-interfaceports
                • Vl-ansi-portdecl-to-interfaceport
                • Vl-ansi-portdecl-regularport-type
                • Vl-design-resolve-ansi-portdecls
              • Udp-elim
              • Vl-annotate-design
              • Vl-annotate-module
            • Clean-warnings
            • Eliminitial
            • Custom-transform-hooks
            • Problem-modules
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Port-resolve

    Vl-vardecl-is-really-interfaceport

    Signature
    (vl-vardecl-is-really-interfaceport x ss) 
      → 
    (mv warnings ifport)
    Arguments
    x — Guard (vl-vardecl-p x).
    ss — Guard (vl-scopestack-p ss).
    Returns
    warnings — Type (vl-warninglist-p warnings).
    ifport — Type (iff (vl-interfaceport-p ifport) ifport).

    Definitions and Theorems

    Function: vl-vardecl-is-really-interfaceport

    (defun vl-vardecl-is-really-interfaceport (x ss)
     (declare (xargs :guard (and (vl-vardecl-p x)
                                 (vl-scopestack-p ss))))
     (let ((__function__ 'vl-vardecl-is-really-interfaceport))
      (declare (ignorable __function__))
      (b*
       (((vl-vardecl x) (vl-vardecl-fix x))
        (warnings nil)
        ((when (or x.varp x.nettype
                   (not (vl-datatype-case x.type :vl-usertype))
                   (not (vl-idscope-p (vl-usertype->name x.type)))
                   (consp (vl-datatype->pdims x.type))))
         (mv warnings nil))
        (typename (vl-idscope->name (vl-usertype->name x.type)))
        ((wmv warnings is-interface is-type
              :ctx x)
         (vl-name-is-interface-or-type typename ss))
        (warnings
         (if
          (iff is-interface is-type)
          (fatal
           :type :vl-ambiguous-declaration :msg
           "~a0: Ambiguous whether this is a variable or ~
                                     interfaceport declaration, because ~a1 is ~
                                     ~s2 an interface ~s3 a type name."
           :args
           (if is-interface (list x typename "both" "and")
             (list x typename "neither" "nor")))
          warnings)))
       (mv
          warnings
          (and is-interface
               (make-vl-interfaceport :name x.name
                                      :ifname typename
                                      :modport nil
                                      :udims (vl-datatype->udims x.type)
                                      :loc x.loc))))))

    Theorem: vl-warninglist-p-of-vl-vardecl-is-really-interfaceport.warnings

    (defthm
        vl-warninglist-p-of-vl-vardecl-is-really-interfaceport.warnings
      (b* (((mv ?warnings ?ifport)
            (vl-vardecl-is-really-interfaceport x ss)))
        (vl-warninglist-p warnings))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-vardecl-is-really-interfaceport.ifport

    (defthm return-type-of-vl-vardecl-is-really-interfaceport.ifport
      (b* (((mv ?warnings ?ifport)
            (vl-vardecl-is-really-interfaceport x ss)))
        (iff (vl-interfaceport-p ifport)
             ifport))
      :rule-classes :rewrite)

    Theorem: vl-vardecl-is-really-interfaceport-of-vl-vardecl-fix-x

    (defthm vl-vardecl-is-really-interfaceport-of-vl-vardecl-fix-x
      (equal (vl-vardecl-is-really-interfaceport (vl-vardecl-fix x)
                                                 ss)
             (vl-vardecl-is-really-interfaceport x ss)))

    Theorem: vl-vardecl-is-really-interfaceport-vl-vardecl-equiv-congruence-on-x

    (defthm
     vl-vardecl-is-really-interfaceport-vl-vardecl-equiv-congruence-on-x
     (implies (vl-vardecl-equiv x x-equiv)
              (equal (vl-vardecl-is-really-interfaceport x ss)
                     (vl-vardecl-is-really-interfaceport x-equiv ss)))
     :rule-classes :congruence)

    Theorem: vl-vardecl-is-really-interfaceport-of-vl-scopestack-fix-ss

    (defthm vl-vardecl-is-really-interfaceport-of-vl-scopestack-fix-ss
      (equal
           (vl-vardecl-is-really-interfaceport x (vl-scopestack-fix ss))
           (vl-vardecl-is-really-interfaceport x ss)))

    Theorem: vl-vardecl-is-really-interfaceport-vl-scopestack-equiv-congruence-on-ss

    (defthm
     vl-vardecl-is-really-interfaceport-vl-scopestack-equiv-congruence-on-ss
     (implies (vl-scopestack-equiv ss ss-equiv)
              (equal (vl-vardecl-is-really-interfaceport x ss)
                     (vl-vardecl-is-really-interfaceport x ss-equiv)))
     :rule-classes :congruence)