• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Vwsim
      • Fgl
      • 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-modulelist-basicsanity
              • Vl-modport-portlist->names
              • 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
      • Testing-utilities
      • Math
    • Basicsanity

    Vl-module-basicsanity

    Signature
    (vl-module-basicsanity 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-basicsanity

    (defun
     vl-module-basicsanity (x)
     (declare (xargs :guard (vl-module-p x)))
     (let
      ((__function__ 'vl-module-basicsanity))
      (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)))))
        (external-names (vl-portlist->names x.ports))
        (dupes (duplicated-members (remove nil external-names)))
        (warnings (if (not dupes)
                      warnings
                      (fatal :type :vl-bad-ports
                             :msg "Duplicate port names: ~&0."
                             :args (list dupes)))))
       (change-vl-module x
                         :warnings warnings))))

    Theorem: vl-module-p-of-vl-module-basicsanity

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

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

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

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

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