• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
          • 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-modulelist-check-namespace
            • Vl-module-check-namespace
              • Vl-design-check-namespace
            • Vl-lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Check-namespace

    Vl-module-check-namespace

    Signature
    (vl-module-check-namespace x) → new-x
    Arguments
    x — Guard (vl-module-p x).
    Returns
    new-x — Perhaps extended with warnings.
        Type (vl-module-p new-x).

    Definitions and Theorems

    Function: vl-module-check-namespace

    (defun vl-module-check-namespace (x)
     (declare (xargs :guard (vl-module-p x)))
     (let ((__function__ 'vl-module-check-namespace))
      (declare (ignorable __function__))
      (b*
       (((vl-module x) x)
        (warnings x.warnings)
        (portdupes
         (duplicated-members (remove nil (vl-portlist->names x.ports))))
        (warnings (if portdupes (fatal :type :vl-bad-ports
                                       :msg "Duplicate port names: ~&0."
                                       :args (list portdupes))
                    warnings))
        (pdnames (vl-portdecllist->names x.portdecls))
        (pdnames-s (mergesort pdnames))
        (warnings (if (mbe :logic (no-duplicatesp-equal pdnames)
                           :exec (same-lengthp pdnames pdnames-s))
                      warnings
                    (fatal :type :vl-bad-portdecls
                           :msg "Duplicate port declaration names: ~&0."
                           :args (list (duplicated-members pdnames)))))
        (namespace (vl-module->modnamespace x))
        (namespace-s (mergesort namespace))
        (warnings
             (if (mbe :logic (no-duplicatesp-equal namespace)
                      :exec (same-lengthp namespace namespace-s))
                 warnings
               (fatal :type :vl-namespace-error
                      :msg "Illegal redefinition of ~&0."
                      :args (list (duplicated-members namespace)))))
        (overlap (intersect pdnames-s namespace-s))
        (palist (vl-make-portdecl-alist x.portdecls))
        (ialist (vl-make-moditem-alist x))
        ((mv & warnings)
         (vl-overlap-compatible-p-warn
              overlap x palist ialist warnings)))
       (change-vl-module x
                         :warnings warnings))))

    Theorem: vl-module-p-of-vl-module-check-namespace

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