• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
          • Vl-lint
            • Vl-lintconfig-p
            • Condcheck
            • Lint-warning-suppression
            • Lucid
            • Lvaluecheck
            • Vl-interfacelist-alwaysstyle
            • Truncation-warnings
            • Vl-modulelist-alwaysstyle
            • Skip-detection
            • Vl-lint-report
            • Vl-lintresult
            • Vl::vl-design-sv-use-set
            • Oddexpr-check
            • Leftright-check
            • Duplicate-detect
            • Selfassigns
            • *vl-lint-help*
            • Arith-compare-check
            • Dupeinst-check
            • Qmarksize-check
            • Lint-whole-file-suppression
            • Run-vl-lint-main
            • Logicassign
            • Run-vl-lint
            • Vl-print-certain-warnings
            • Duperhs-check
            • Vl-lint-top
            • Sd-filter-problems
            • Vl-modulelist-add-svbad-warnings
            • Vl-module-add-svbad-warnings
            • Check-case
            • Vl-lint-extra-actions
            • Drop-lint-stubs
            • Vl-lint-print-warnings
            • Drop-user-submodules
            • Check-namespace
              • Vl-modulelist-check-namespace
              • Vl-check-portdecl-and-moduleitem-compatible
              • Vl-check-portdecl-overlap-compatible
              • Vl-module-check-namespace
                • Vl-design-check-namespace
              • Vl-lintconfig-loadconfig
              • Vl-lint-design->svex-modalist-wrapper
              • Vl-delete-sd-problems-for-modnames-aux
              • Vl-collect-new-names-from-orignames
              • Vl-lint-print-all-warnings
              • Vl-design-remove-unnecessary-modules
              • Vl-delete-sd-problems-for-modnames
              • Vl-always-check-style
              • Vl-vardecllist-svbad-warnings
              • Vl-vardecl-svbad-warnings
              • Vl-reportcard-remove-suppressed
              • Vl-reportcard-keep-suppressed
              • Vl-alwayslist-check-style
              • Vl-remove-nameless-descriptions
              • Vl-lint-apply-quiet
              • Vl-warninglist-remove-suppressed
              • Vl-warninglist-keep-suppressed
              • Vl-print-eliminated-descs
              • Vl-module-alwaysstyle
              • Vl-jp-reportcard-aux
              • Vl-interface-alwaysstyle
              • Vl-design-alwaysstyle
              • Vl-jp-description-locations
              • Vl-jp-reportcard
              • Vl-pp-stringlist-lines
              • Vl-jp-design-locations
              • Vl-datatype-svbad-p
              • Unpacked-range-check
              • Sd-problem-major-p
              • Vl-alwaysstyle
            • Vl-server
            • Vl-gather
            • Vl-zip
            • Vl-main
            • Split-plusargs
            • Vl-shell
            • Vl-json
          • Mlib
          • Transforms
        • 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) (vl-module-fix 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)))))
        (ss (vl-scopestack-push x (vl-scopestack-null)))
        (warnings
             (append-without-guard
                  (vl-check-portdecl-overlap-compatible x.portdecls ss)
                  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)

    Theorem: vl-module-check-namespace-of-vl-module-fix-x

    (defthm vl-module-check-namespace-of-vl-module-fix-x
      (equal (vl-module-check-namespace (vl-module-fix x))
             (vl-module-check-namespace x)))

    Theorem: vl-module-check-namespace-vl-module-equiv-congruence-on-x

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