• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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-modport-portcheck

    Signature
    (vl-modport-portcheck x oknames warnings) → new-warnings
    Arguments
    x — Guard (vl-modport-p x).
    oknames — Names of local wires, etc., that are OK in modport expressions.
        Guard (string-listp oknames).
    warnings — Guard (vl-warninglist-p warnings).
    Returns
    new-warnings — Type (vl-warninglist-p new-warnings).

    Definitions and Theorems

    Function: vl-modport-portcheck

    (defun vl-modport-portcheck (x oknames warnings)
     (declare (xargs :guard (and (vl-modport-p x)
                                 (string-listp oknames)
                                 (vl-warninglist-p warnings))))
     (declare (xargs :guard (setp oknames)))
     (let ((__function__ 'vl-modport-portcheck))
       (declare (ignorable __function__))
       (b*
        ((oknames (string-list-fix oknames))
         ((vl-modport x) (vl-modport-fix x))
         (external-names (vl-modport-portlist->names x.ports))
         (dupes (duplicated-members external-names))
         ((when dupes)
          (fatal :type :vl-bad-modport
                 :msg "~a0: Duplicated modport port names: ~&1."
                 :args (list x dupes)))
         ((mv warnings internalnames)
          (vl-modport-portlist-check-wellformed x.ports x warnings nil))
         (internalnames (mergesort internalnames))
         (badnames (difference internalnames oknames))
         ((when badnames)
          (fatal :type :vl-bad-modport
                 :msg "~a0: Modport refers to unknown name~s1: ~&2."
                 :args (list x (if (vl-plural-p badnames) "s" "")
                             badnames))))
        (ok))))

    Theorem: vl-warninglist-p-of-vl-modport-portcheck

    (defthm vl-warninglist-p-of-vl-modport-portcheck
      (b* ((new-warnings (vl-modport-portcheck x oknames warnings)))
        (vl-warninglist-p new-warnings))
      :rule-classes :rewrite)

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

    (defthm vl-modport-portcheck-of-vl-modport-fix-x
      (equal (vl-modport-portcheck (vl-modport-fix x)
                                   oknames warnings)
             (vl-modport-portcheck x oknames warnings)))

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

    (defthm vl-modport-portcheck-vl-modport-equiv-congruence-on-x
      (implies (vl-modport-equiv x x-equiv)
               (equal (vl-modport-portcheck x oknames warnings)
                      (vl-modport-portcheck x-equiv oknames warnings)))
      :rule-classes :congruence)

    Theorem: vl-modport-portcheck-of-string-list-fix-oknames

    (defthm vl-modport-portcheck-of-string-list-fix-oknames
      (equal (vl-modport-portcheck x (string-list-fix oknames)
                                   warnings)
             (vl-modport-portcheck x oknames warnings)))

    Theorem: vl-modport-portcheck-string-list-equiv-congruence-on-oknames

    (defthm vl-modport-portcheck-string-list-equiv-congruence-on-oknames
      (implies (str::string-list-equiv oknames oknames-equiv)
               (equal (vl-modport-portcheck x oknames warnings)
                      (vl-modport-portcheck x oknames-equiv warnings)))
      :rule-classes :congruence)

    Theorem: vl-modport-portcheck-of-vl-warninglist-fix-warnings

    (defthm vl-modport-portcheck-of-vl-warninglist-fix-warnings
     (equal
          (vl-modport-portcheck x oknames (vl-warninglist-fix warnings))
          (vl-modport-portcheck x oknames warnings)))

    Theorem: vl-modport-portcheck-vl-warninglist-equiv-congruence-on-warnings

    (defthm
       vl-modport-portcheck-vl-warninglist-equiv-congruence-on-warnings
      (implies (vl-warninglist-equiv warnings warnings-equiv)
               (equal (vl-modport-portcheck x oknames warnings)
                      (vl-modport-portcheck x oknames warnings-equiv)))
      :rule-classes :congruence)