• 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
        • Mlib
        • Transforms
          • Unparameterization
          • Elaborate
          • Addnames
          • Annotate
            • Increment-elim
            • Make-implicit-wires
              • Shadowcheck
                • Vl-shadowcheck-genelement
                • Vl-shadowcheck-reference-name
                • Vl-shadowcheck-declare-name
                • Deltemps
                • Vl-shadowcheck-modelement
                • Vl-lexscope
                • Vl-shadowcheck-reference-scopeexpr
                • Vl-shadowcheck-reference-names
                • Vl-shadowcheck-declare-names
                • Vl-shadowcheck-paramtype
                • Vl-shadowcheck-fun/task-loaditems
                • Vl-shadowcheck-fun/task-loaditem
                • Vl-shadowcheck-fundecl
                • Vl-shadowcheck-declare-typedefs
                • Vl-shadowcheck-blockitemlist
                • Vl-shadowcheck-portdecllist
                • Vl-shadowcheck-paramdecls
                • Vl-shadowcheck-dpiimports
                • Vl-shadowcheck-taskdecls
                • Vl-shadowcheck-taskdecl
                • Vl-shadowcheck-push-scope
                • Vl-shadowcheck-blockitem
                • Vl-shadowcheck-vardecls
                • Vl-shadowcheck-vardecl
                • Vl-shadowcheck-typedef
                • Vl-shadowcheck-portdecl
                • Vl-shadowcheck-paramdecl
                • Vl-shadowcheck-modport
                • Vl-shadowcheck-modinst
                • Vl-shadowcheck-imports
                • Vl-shadowcheck-import
                • Vl-shadowcheck-gateinst
                • Vl-shadowcheck-fundecls
                • Vl-shadowcheck-dpiimport
                • Vl-shadowcheck-ports
                • Vl-shadowcheck-port
                • Vl-shadowcheck-initial
                • Vl-shadowcheck-assign
                • Vl-shadowcheck-always
                • Vl-shadowcheck-final
                • Vl-shadowcheck-alias
                • Vl-shadowcheck-state
                • Vl-shadowcheck-module
                • Vl-shadowcheck-interface
                • Vl-shadowcheck-interfaces
                • Vl-shadowcheck-modules
                • Vl-packagemap-find-packages-for-name
                • Vl-shadowcheck-design
                • Vl-lexscopes
                • Vl-expr->maybe-subtype
                • Vl-shadowcheck-pop-scope
                • Nameclash
                  • Vl-make-nameclash-warnings
                  • Vl-make-nameclash-warning
                  • Vl-nameclash-warning-summary
                  • Vl-scope-nameclash-warnings
                    • Generate-block-nameclash-items
                  • Vl-scopeitem->loc
                  • Vl-nameclash-collect-local-decls
                  • Vl-nameclash-collect-import-decls
                  • Vl-strip-locs-from-importresult-alist
                • Vl-portdecl-or-blockitem
                • Vl-lexscope-decls
                • Vl-packagemap
                • Vl-portdecl-or-blockitem-list
              • Implicit-wires-minutia
              • Implicit-wires-generate-scoping
              • Vl-genbase-make-implicit-wires
              • Vl-expr-names-for-implicit
              • Vl-make-implicit-wires-main
              • Vl-implicitst
              • Vl-make-port-implicit-wires
              • Vl-import-update-implicit
              • Vl-blockitemlist-update-implicit
              • Vl-blockitem-update-implicit
              • Vl-make-ordinary-implicit-wires
              • Vl-remove-declared-wires
              • Vl-implicitsts-restore-fast-alists
              • Vl-genblock-under-cond-make-implicit-wires
              • Vl-collect-exprs-for-implicit-wires-from-namedargs
              • Vl-genblock-make-implicit-wires
              • Vl-collect-exprs-for-implicit-wires-from-portargs
              • Vl-collect-exprs-for-implicit-wires-from-namedarg
              • Vl-gateinst-exprs-for-implicit-wires
              • Vl-modinst-exprs-for-implicit-wires
              • Vl-genelementlist-make-implicit-wires
              • Vl-packagemap-find-name
            • Basic-bind-elim
            • Argresolve
            • Basicsanity
            • 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
  • Nameclash

Vl-scope-nameclash-warnings

Top level function for checking a scope for name clashes.

Signature
(vl-scope-nameclash-warnings x design warnings) → warnings
Arguments
x — Guard (vl-scope-p x).
design — Guard (vl-design-p design).
warnings — Guard (vl-warninglist-p warnings).
Returns
warnings — Type (vl-warninglist-p warnings).

Definitions and Theorems

Function: vl-scope-nameclash-warnings

(defun vl-scope-nameclash-warnings (x design warnings)
 (declare (xargs :guard (and (vl-scope-p x)
                             (vl-design-p design)
                             (vl-warninglist-p warnings))))
 (let ((__function__ 'vl-scope-nameclash-warnings))
  (declare (ignorable __function__))
  (b*
   ((x (vl-scope-fix x))
    (design (vl-design-fix design))
    ((vl-scopeinfo info)
     (vl-scope->scopeinfo-aux x design))
    (tricky-generate-stuff (vl-genelementlist->nameclash-scopeitem-alist
                                (vl-scope->raw-generates x)
                                nil))
    (locals (append tricky-generate-stuff info.locals))
    (locally-declared-names (alist-keys locals))
    (directly-imported-names
     (alist-keys
        (mergesort
             (vl-strip-locs-from-importresult-alist info.imports))))
    (dupes (duplicated-members (append locally-declared-names
                                       directly-imported-names)))
    ((unless dupes) (ok)))
   (vl-make-nameclash-warnings
        (vl-scope->id x)
        dupes locals info.imports warnings))))

Theorem: vl-warninglist-p-of-vl-scope-nameclash-warnings

(defthm vl-warninglist-p-of-vl-scope-nameclash-warnings
  (b* ((warnings (vl-scope-nameclash-warnings x design warnings)))
    (vl-warninglist-p warnings))
  :rule-classes :rewrite)

Theorem: vl-scope-nameclash-warnings-of-vl-scope-fix-x

(defthm vl-scope-nameclash-warnings-of-vl-scope-fix-x
  (equal (vl-scope-nameclash-warnings (vl-scope-fix x)
                                      design warnings)
         (vl-scope-nameclash-warnings x design warnings)))

Theorem: vl-scope-nameclash-warnings-vl-scope-equiv-congruence-on-x

(defthm vl-scope-nameclash-warnings-vl-scope-equiv-congruence-on-x
 (implies
      (vl-scope-equiv x x-equiv)
      (equal (vl-scope-nameclash-warnings x design warnings)
             (vl-scope-nameclash-warnings x-equiv design warnings)))
 :rule-classes :congruence)

Theorem: vl-scope-nameclash-warnings-of-vl-design-fix-design

(defthm vl-scope-nameclash-warnings-of-vl-design-fix-design
  (equal (vl-scope-nameclash-warnings x (vl-design-fix design)
                                      warnings)
         (vl-scope-nameclash-warnings x design warnings)))

Theorem: vl-scope-nameclash-warnings-vl-design-equiv-congruence-on-design

(defthm
   vl-scope-nameclash-warnings-vl-design-equiv-congruence-on-design
 (implies
      (vl-design-equiv design design-equiv)
      (equal (vl-scope-nameclash-warnings x design warnings)
             (vl-scope-nameclash-warnings x design-equiv warnings)))
 :rule-classes :congruence)

Theorem: vl-scope-nameclash-warnings-of-vl-warninglist-fix-warnings

(defthm vl-scope-nameclash-warnings-of-vl-warninglist-fix-warnings
  (equal (vl-scope-nameclash-warnings
              x design (vl-warninglist-fix warnings))
         (vl-scope-nameclash-warnings x design warnings)))

Theorem: vl-scope-nameclash-warnings-vl-warninglist-equiv-congruence-on-warnings

(defthm
 vl-scope-nameclash-warnings-vl-warninglist-equiv-congruence-on-warnings
 (implies
      (vl-warninglist-equiv warnings warnings-equiv)
      (equal (vl-scope-nameclash-warnings x design warnings)
             (vl-scope-nameclash-warnings x design warnings-equiv)))
 :rule-classes :congruence)

Subtopics

Generate-block-nameclash-items
Special detection of name clashes involving generate block names.