• 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
          • 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
              • Vl-duplicate-detect-strip-gateinsts
              • Vl-duplicate-detect-strip-cassertions
              • Vl-modulelist-duplicate-detect
              • Vl-duplicate-detect-strip-properties
              • Vl-duplicate-detect-strip-assertions
              • Vl-duplicate-detect-strip-sequences
              • Vl-duplicate-detect-strip-modinsts
              • Vl-duplicate-detect-strip-initials
              • Vl-duplicate-detect-strip-assigns
              • Vl-duplicate-detect-strip-alwayses
              • Vl-duplicate-detect-strip-aliases
              • Vl-duplicate-detect-strip-finals
              • Vl-module-duplicate-detect
              • Vl-duplicate-detect-strip-gateinst
              • Vl-duplicate-warnings
              • Vl-collect-original-elements-matching-dupe
              • Vl-duplicate-warning
                • Vl-modinstlist-remove-interfaces
                • Vl-duplicate-detect-strip-modinst
                • Vl-design-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-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
    • Duplicate-detect

    Vl-duplicate-warning

    Signature
    (vl-duplicate-warning type dupes) → warning
    Arguments
    type — Guard (stringp type).
    dupes — Guard (vl-modelementlist-p dupes).
    Returns
    warning — Type (vl-warning-p warning).

    Definitions and Theorems

    Function: vl-duplicate-warning

    (defun vl-duplicate-warning (type dupes)
     (declare (xargs :guard (and (stringp type)
                                 (vl-modelementlist-p dupes))))
     (declare (xargs :guard (<= 2 (len dupes))))
     (let ((__function__ 'vl-duplicate-warning))
       (declare (ignorable __function__))
       (b* ((msg (with-local-ps
                      (vl-ps-update-autowrap-col 100)
                      (vl-ps-update-autowrap-ind 10)
                      (vl-print "Found duplicated ")
                      (vl-print-str type)
                      (vl-println ":")
                      (vl-indent 6)
                      (vl-print "  // From ")
                      (vl-print-loc (vl-modelement->loc (first dupes)))
                      (vl-println "")
                      (vl-indent 6)
                      (vl-pp-modelement (first dupes))
                      (vl-indent 6)
                      (vl-print "  // From ")
                      (vl-print-loc (vl-modelement->loc (second dupes)))
                      (vl-println "")
                      (vl-indent 6)
                      (vl-pp-modelement (second dupes))
                      (if (atom (cddr dupes))
                          ps
                        (vl-ps-seq (vl-println "")
                                   (vl-indent 6)
                                   (vl-print "  // And ")
                                   (vl-print-nat (- (len dupes) 2))
                                   (vl-print " more."))))))
         (make-vl-warning :type :vl-warn-duplicates
                          :msg "~s0"
                          :args (list msg dupes)
                          :fatalp nil
                          :fn __function__))))

    Theorem: vl-warning-p-of-vl-duplicate-warning

    (defthm vl-warning-p-of-vl-duplicate-warning
      (b* ((warning (vl-duplicate-warning type dupes)))
        (vl-warning-p warning))
      :rule-classes :rewrite)