• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
          • Vl-lintconfig-p
          • Lucid
          • Skip-detection
          • Vl-lintresult-p
          • Lint-warning-suppression
          • Condcheck
          • Selfassigns
          • Leftright-check
          • Dupeinst-check
          • Oddexpr-check
          • Remove-toohard
          • Qmarksize-check
          • Portcheck
            • Vl-modulelist-portcheck
            • Vl-port-check-style
            • Vl-portlist-check-style
            • Vl-portlist-check-wellformed
            • Vl-module-portcheck
              • Vl-port-check-wellformed
              • Vl-design-portcheck
            • Duplicate-detect
            • Vl-print-certain-warnings
            • Duperhs-check
            • *vl-lint-help*
            • Lint-stmt-rewrite
            • Drop-missing-submodules
            • Check-case
            • Drop-user-submodules
            • Check-namespace
            • Vl-lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Portcheck

    Vl-module-portcheck

    Signature
    (vl-module-portcheck x) → new-x
    Arguments
    x — Guard (vl-module-p x).
    Returns
    new-x — New version of x, with at most some added warnings.
        Type (vl-module-p new-x).

    Definitions and Theorems

    Function: vl-module-portcheck

    (defun vl-module-portcheck (x)
     (declare (xargs :guard (vl-module-p x)))
     (let ((__function__ 'vl-module-portcheck))
      (declare (ignorable __function__))
      (b*
       (((vl-module x) x)
        (bad-warnings (vl-portlist-check-wellformed x.ports))
        ((when bad-warnings)
         (change-vl-module x
                           :warnings (append bad-warnings x.warnings)))
        (warnings x.warnings)
        (warnings (vl-portlist-check-style x.ports warnings))
        (decl-names (mergesort (vl-portdecllist->names x.portdecls)))
        (port-names (mergesort (vl-portlist->internalnames x.ports)))
        (warnings
             (if (subset decl-names port-names)
                 warnings
               (fatal :type :vl-port-mismatch
                      :msg "Port declarations for non-ports: ~&0."
                      :args (list (difference decl-names port-names)))))
        (warnings
            (if (subset port-names decl-names)
                warnings
              (fatal :type :vl-port-mismatch
                     :msg "Missing port declarations for ~&0."
                     :args (list (difference port-names decl-names))))))
       (change-vl-module x
                         :warnings warnings))))

    Theorem: vl-module-p-of-vl-module-portcheck

    (defthm vl-module-p-of-vl-module-portcheck
      (b* ((new-x (vl-module-portcheck x)))
        (vl-module-p new-x))
      :rule-classes :rewrite)

    Theorem: vl-module-portcheck-of-vl-module-fix-x

    (defthm vl-module-portcheck-of-vl-module-fix-x
      (equal (vl-module-portcheck (vl-module-fix x))
             (vl-module-portcheck x)))

    Theorem: vl-module-portcheck-vl-module-equiv-congruence-on-x

    (defthm vl-module-portcheck-vl-module-equiv-congruence-on-x
      (implies (vl-module-equiv x x-equiv)
               (equal (vl-module-portcheck x)
                      (vl-module-portcheck x-equiv)))
      :rule-classes :congruence)