• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • 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
              • Vl-interfacelist-basicsanity
              • Vl-modport-portlist->names
              • Vl-modulelist-basicsanity
              • Vl-modport-portlist-check-wellformed
              • Vl-modport-port-check-wellformed
              • Vl-interface-check-modinst-is-subinterface
              • Vl-interface-check-modinsts-are-subinterfaces
              • Vl-modport-portcheck
              • Vl-modportlist-portcheck
              • Vl-interface-basicsanity
              • Vl-port-check-style
                • Vl-portlist-check-style
                • Vl-module-basicsanity
                • Vl-portlist-check-wellformed
                • Vl-port-check-wellformed
                • Vl-design-basicsanity
                • Vl-pps-expr-elided
              • Portdecl-sign
              • Enum-names
              • Port-resolve
              • Udp-elim
              • Vl-annotate-design
              • Vl-annotate-module
            • Clean-warnings
            • Eliminitial
            • Custom-transform-hooks
            • Problem-modules
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Basicsanity

    Vl-port-check-style

    Signature
    (vl-port-check-style x warnings) → warnings
    Arguments
    x — Guard (vl-port-p x).
    warnings — Guard (vl-warninglist-p warnings).
    Returns
    warnings — Type (vl-warninglist-p warnings).

    Definitions and Theorems

    Function: vl-port-check-style

    (defun vl-port-check-style (x warnings)
     (declare (xargs :guard (and (vl-port-p x)
                                 (vl-warninglist-p warnings))))
     (declare (xargs :guard (vl-port-wellformed-p x)))
     (let ((__function__ 'vl-port-check-style))
      (declare (ignorable __function__))
      (b*
       ((x (vl-port-fix x))
        ((when (eq (tag x) :vl-interfaceport))
         (ok))
        ((vl-regularport x))
        ((when (and x.name x.expr (vl-idexpr-p x.expr)
                    (equal (vl-idexpr->name x.expr)
                           x.name)))
         (ok))
        ((when (not x.expr))
         (if x.name (ok)
          (warn
           :type :vl-warn-port-style
           :msg
           "~a0: completely blank port without even a name.  Is ~
                          this an accidental extra comma?  If not, while blank ~
                          ports are legal, they will prevent you from ~
                          instantiating the module using named port connections.  ~
                          Consider giving this port a name using syntax like ~
                          \".myportname()\" instead to avoid this."
           :args (list x))))
        ((when (and (not x.name)
                    (not (vl-idexpr-p x.expr))
                    (vl-atomicportexpr-p x.expr)))
         (warn
          :type :vl-warn-port-style
          :msg
          "~a0: the port expression ~a1 has a range.  This is legal, ~
                        but means you can't connect the port by name, etc.  It ~
                        would be better to move the range to the port's ~
                        input/output declaration, or (better yet) to use the more ~
                        modern \"ANSI\" syntax for combined port declarations."
          :args (list x x.expr))))
       (warn :type :vl-warn-port-style
             :msg "~a0: port has complex expression ~s1"
             :args (list x (vl-pps-expr-elided x.expr))))))

    Theorem: vl-warninglist-p-of-vl-port-check-style

    (defthm vl-warninglist-p-of-vl-port-check-style
      (b* ((warnings (vl-port-check-style x warnings)))
        (vl-warninglist-p warnings))
      :rule-classes :rewrite)

    Theorem: vl-port-check-style-of-vl-port-fix-x

    (defthm vl-port-check-style-of-vl-port-fix-x
      (equal (vl-port-check-style (vl-port-fix x)
                                  warnings)
             (vl-port-check-style x warnings)))

    Theorem: vl-port-check-style-vl-port-equiv-congruence-on-x

    (defthm vl-port-check-style-vl-port-equiv-congruence-on-x
      (implies (vl-port-equiv x x-equiv)
               (equal (vl-port-check-style x warnings)
                      (vl-port-check-style x-equiv warnings)))
      :rule-classes :congruence)

    Theorem: vl-port-check-style-of-vl-warninglist-fix-warnings

    (defthm vl-port-check-style-of-vl-warninglist-fix-warnings
      (equal (vl-port-check-style x (vl-warninglist-fix warnings))
             (vl-port-check-style x warnings)))

    Theorem: vl-port-check-style-vl-warninglist-equiv-congruence-on-warnings

    (defthm
        vl-port-check-style-vl-warninglist-equiv-congruence-on-warnings
      (implies (vl-warninglist-equiv warnings warnings-equiv)
               (equal (vl-port-check-style x warnings)
                      (vl-port-check-style x warnings-equiv)))
      :rule-classes :congruence)