• 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
              • Typo-detection
              • Vl-lucid-dissect-pair
                • Vl-lucidstate
                • Vl-lucid-dissect-var-main
                • Vl-lucidstate-init
                • Vl-lucid-check-uses-are-spurious-instances
                • Vl-hidslice-mark
                • Vl-namedarglist-lucidcheck
                • Vl-lucidst-mark-modport
                • Vl-lucid-multidrive-detect
                • Vl-namedarg-lucidcheck
                • Vl-lucid-filter-merges
                • Vl-hidsolo-mark
                • Vl-arguments-lucidcheck
                • Vl-lucid-dissect-database
                • Vl-design-lucid
                • Vl-maybe-delayoreventcontrol-lucidcheck
                • Vl-lucid-valid-bits-for-datatype
                • Vl-delayoreventcontrol-lucidcheck
                • Vl-repeateventcontrol-lucidcheck
                • Vl-namedparamvaluelist-lucidcheck
                • Vl-scopeexprlist-mark-solo
                • Vl-plainarg-lucidcheck
                • Vl-maybe-rhsexprlist-lucidcheck
                • Vl-maybe-paramvalue-lucidcheck
                • Vl-paramvaluelist-lucidcheck
                • Vl-namedparamvalue-lucidcheck
                • Vl-maybe-gatedelay-lucidcheck
                • Vl-plainarglist-lucidcheck
                • Vl-lucidstate-mark
                • Vl-lucid-mark-simple
                • Vl-eventcontrol-lucidcheck
                • Vl-enumitemlist-lucidcheck
                • Vl-delaycontrol-lucidcheck
                • Vl-paramvalue-lucidcheck
                • Vl-paramargs-lucidcheck
                • Vl-maybe-rhsexpr-lucidcheck
                • Vl-maybe-range-lucidcheck
                • Vl-lucid-typo-detect1
                • Vl-gatedelay-lucidcheck
                • Vl-evatomlist-lucidcheck
                • Vl-rangelist-lucidcheck
                • Vl-pps-lucidstate
                • Vl-enumitem-lucidcheck
                • Vl-custom-suppress-multidrive-p
                • Vl-evatom-lucidcheck
                • Vl-rhs-lucidcheck
                • Vl-range-lucidcheck
                • Vl-lucidocclist-drop-bad-modinsts
                • Vl-hidtrace-mark-interfaces
                • Vl-hidstep-mark-interfaces
                • Vl-add-typo-candidate
                • Vl-paramdecl-lucidcheck
                • Vl-interfaceportlist-lucidcheck
                • Vl-interfaceport-lucidcheck
                • Vl-fundecl-lucidcheck
                • Vl-design-lucidcheck-main
                • Vl-taskdecllist-lucidcheck
                • Vl-taskdecl-lucidcheck
                • Vl-portdecllist-lucidcheck
                • Vl-paramdecllist-lucidcheck
                • Vl-package-lucidcheck
                • Vl-modinst-lucidcheck
                • Vl-interfacelist-lucidcheck
                • Vl-gateinstlist-lucidcheck
                • Vl-dpiimportlist-lucidcheck
                • Vl-dpiexportlist-lucidcheck
                • Vl-vardecllist-lucidcheck
                • Vl-vardecl-lucidcheck
                • Vl-typedeflist-lucidcheck
                • Vl-portdecl-lucidcheck
                • Vl-packagelist-lucidcheck
                • Vl-modulelist-lucidcheck
                • Vl-modportlist-lucidcheck
                • Vl-modinstlist-lucidcheck
                • Vl-interface-lucidcheck
                • Vl-initiallist-lucidcheck
                • Vl-gateinst-lucidcheck
                • Vl-fundecllist-lucidcheck
                • Vl-dpiimport-lucidcheck
                • Vl-dpiexport-lucidcheck
                • Vl-assignlist-lucidcheck
                • Vl-alwayslist-lucidcheck
                • Vl-typedef-lucidcheck
                • Vl-modport-lucidcheck
                • Vl-initial-lucidcheck
                • Vl-finallist-lucidcheck
                • Vl-assign-lucidcheck
                • Vl-always-lucidcheck
                • Vl-aliaslist-lucidcheck
                • Vl-module-lucidcheck
                • Vl-lucid-typo-detect
                • Vl-final-lucidcheck
                • Vl-alias-lucidcheck
                • Vl-lucidocclist-drop-foreign-writes
                • Vl-lucid-pp-multibits
                • Vl-lucid-slices-append-bits
                • Vl-scopestack-is-portdecl-p
                • Vl-lucid-valid-bits-for-decl
                • Vl-lucid-resolved-slices->bits
                • Vl-lucid-resolved-slice->bits
                • Vl-lucid-instmod-find-port-dir
                • Vl-custom-suppress-multidrive-p-default
                • Vl-lucidmergealist-count
                • Vl-lucid-scopestack-subscope-p
                • Vl-lucid-range->bits
                • Vl-lucidocclist-drop-initials/finals
                • Vl-lucid-collect-solo-occs
                • Vl-lucid-collect-resolved-slices
                • Vl-basic-lucidctx
                • Vl-scopestack->flat-transitive-names-slow
                • Vl-lucidocclist-drop-generates
                • Vl-lucid-dissect
                • Vl-lucid-first-solo-occ
                • Vl-lucid-do-merges1
                • Vl-lucid-do-merges
                • Vl-lucidocclist-remove-tails
                • Vl-lucid-some-solo-occp
                • Vl-scopestack-top-level-name
                • Vl-normalize-scopestack
                • Vl-lucid-resolved-slice-p
                • Vl-lucid-all-slices-resolved-p
                • Vl-lucid-warning-type
                • Vl-lucid-plainarglist-nicely-resolved-p
                • Vl-lucid-multidrive-summary
                • Vl-string-expr->value
                • Vl-scopestack->topname
                • Vl-pp-lucid-multidrive-summary
                • Vl-lucid-all-slices-p
                • Vl-lucidocclist-some-transistory-p
                • Vl-lucidocc-transistory-p
                • Vl-lucid-plainarg-nicely-resolved-p
                • Vl-inside-true-generate-p
                • Vl-possible-typo-warnings
                • Vl-lucid-z-gateinst-p
                • Vl-lucid-modinst-nicely-resolved-p
                • Vl-inside-interface-p
                • Vl-inside-blockscope-p
                • Vl-typocandidates
                • Vl-lucid-z-expr-p
                • Vl-lucid-z-assign-p
                • Vl-lucidmergealist
                • Vl-lucid-summarize-bits
                • Vl-pp-merged-index-list
                • Vl-pp-merged-index
                • Vl-lucid-pp-bits
              • 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-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
    • Lucid

    Vl-lucid-dissect-pair

    Signature
    (vl-lucid-dissect-pair key val reportcard st typos) 
      → 
    (mv reportcard typos)
    Arguments
    key — Guard (vl-lucidkey-p key).
    val — Guard (vl-lucidval-p val).
    reportcard — Guard (vl-reportcard-p reportcard).
    st — Guard (vl-lucidstate-p st).
    typos — Guard (vl-typocandidates-p typos).
    Returns
    reportcard — Type (vl-reportcard-p reportcard).
    typos — Type (vl-typocandidates-p typos).

    Definitions and Theorems

    Function: vl-lucid-dissect-pair

    (defun vl-lucid-dissect-pair (key val reportcard st typos)
     (declare (xargs :guard (and (vl-lucidkey-p key)
                                 (vl-lucidval-p val)
                                 (vl-reportcard-p reportcard)
                                 (vl-lucidstate-p st)
                                 (vl-typocandidates-p typos))))
     (let ((__function__ 'vl-lucid-dissect-pair))
      (declare (ignorable __function__))
      (b*
       ((reportcard (vl-reportcard-fix reportcard))
        (typos (vl-typocandidates-fix typos))
        ((vl-lucidstate st))
        ((vl-lucidkey key))
        ((vl-lucidval val))
        (topname (vl-scopestack->topname key.scopestack))
        (sequential-udp-p
         (b*
          ((dfn
            (and
               (stringp topname)
               (vl-scopestack-find-definition topname key.scopestack))))
          (and (eq (tag dfn) :vl-module)
               (consp (assoc-equal "VL_SEQUENTIAL_UDP"
                                   (vl-module->atts dfn))))))
        ((when sequential-udp-p)
         (mv reportcard typos))
        ((when val.errors)
         (b*
          ((w
            (make-vl-warning
             :type :vl-lucid-error
             :msg
             "Error computing use/set information for ~s0.  Debugging details: ~x1."
             :args (list (with-local-ps (vl-pp-lucidkey key))
                         val.errors)
             :fatalp nil
             :fn __function__)))
          (mv (vl-extend-reportcard topname w reportcard)
              typos))))
       (case
        (tag key.item)
        (:vl-fundecl
         (b*
          (((when (vl-lucid-some-solo-occp val.used))
            (mv reportcard typos))
           (w
            (make-vl-warning
             :type :vl-lucid-unused
             :msg "Function ~w0 is never used. (~s1)"
             :args
             (list
                  (vl-fundecl->name key.item)
                  (with-local-ps (vl-pp-scopestack-path key.scopestack))
                  key.item)
             :fn __function__
             :fatalp nil)))
          (mv (vl-extend-reportcard topname w reportcard)
              typos)))
        (:vl-genvar
         (b*
          ((usedp (consp val.used))
           (setp (consp val.set))
           ((when (and usedp setp))
            (mv reportcard typos))
           (name (vl-genvar->name key.item))
           (path (with-local-ps (vl-pp-scopestack-path key.scopestack)))
           (w
            (cond
             ((and (not usedp) (not setp))
              (make-vl-warning
                  :type :vl-lucid-spurious
                  :msg "Genvar ~w0 is never used or set anywhere. (~s1)"
                  :args (list name path key.item)
                  :fn __function__
                  :fatalp nil))
             ((and usedp (not setp))
              (make-vl-warning :type :vl-lucid-unset
                               :msg "Genvar ~w0 is never set. (~s1)"
                               :args (list name path key.item)
                               :fn __function__
                               :fatalp nil))
             (t (make-vl-warning :type :vl-lucid-unused
                                 :msg "Genvar ~w0 is never used. (~s1)"
                                 :args (list name path key.item)
                                 :fn __function__
                                 :fatalp nil)))))
          (mv (vl-extend-reportcard topname w reportcard)
              typos)))
        (:vl-modport
         (b*
          (((unless st.modportsp)
            (mv reportcard typos))
           ((when (vl-lucid-some-solo-occp val.used))
            (mv reportcard typos))
           (w
            (make-vl-warning
             :type :vl-lucid-unused
             :msg "Modport ~s0 is never used. (~s1)"
             :args
             (list
                  (vl-modport->name key.item)
                  (with-local-ps (vl-pp-scopestack-path key.scopestack))
                  key.item)
             :fn __function__
             :fatalp nil)))
          (mv (vl-extend-reportcard topname w reportcard)
              typos)))
        (:vl-dpiimport
         (b*
          (((when (vl-lucid-some-solo-occp val.used))
            (mv reportcard typos))
           (w
            (make-vl-warning
             :type :vl-lucid-unused
             :msg "DPI imported function ~w0 is never used. (~s1)"
             :args
             (list
                  (vl-dpiimport->name key.item)
                  (with-local-ps (vl-pp-scopestack-path key.scopestack))
                  key.item)
             :fn __function__
             :fatalp nil)))
          (mv (vl-extend-reportcard topname w reportcard)
              typos)))
        (:vl-taskdecl
         (b*
          (((when (vl-lucid-some-solo-occp val.used))
            (mv reportcard typos))
           (w
            (make-vl-warning
             :type :vl-lucid-unused
             :msg "Task ~w0 is never used. (~s1)"
             :args
             (list
                  (vl-taskdecl->name key.item)
                  (with-local-ps (vl-pp-scopestack-path key.scopestack))
                  key.item)
             :fn __function__
             :fatalp nil)))
          (mv (vl-extend-reportcard topname w reportcard)
              typos)))
        (:vl-typedef
         (b*
          (((when (vl-lucid-some-solo-occp val.used))
            (mv reportcard typos))
           (w
            (make-vl-warning
             :type :vl-lucid-unused
             :msg "Type ~w0 is never used. (~s1)"
             :args
             (list
                  (vl-typedef->name key.item)
                  (with-local-ps (vl-pp-scopestack-path key.scopestack))
                  key.item)
             :fn __function__
             :fatalp nil)))
          (mv (vl-extend-reportcard topname w reportcard)
              typos)))
        (:vl-vardecl
         (b*
          (((mv warnings possible-typop)
            (vl-lucid-dissect-var-main
                 key.scopestack key.item
                 val.used val.set st.db st.generatesp))
           (typos (if possible-typop
                      (vl-add-typo-candidate key.scopestack
                                             (vl-vardecl->name key.item)
                                             typos)
                    typos)))
          (mv (vl-extend-reportcard-list topname warnings reportcard)
              typos)))
        (:vl-paramdecl
           (b* (((unless st.paramsp)
                 (mv reportcard typos))
                ((mv warnings ?possible-typop)
                 (vl-lucid-dissect-var-main
                      key.scopestack key.item
                      val.used val.set st.db st.generatesp)))
             (mv (vl-extend-reportcard-list topname warnings reportcard)
                 typos)))
        (:vl-interfaceport
         (b*
          (((when (or val.used val.set))
            (mv reportcard typos))
           (w
            (make-vl-warning
             :type :vl-lucid-spurious
             :msg "Interface port ~w0 is never mentioned. (~s1)"
             :args
             (list
                  (vl-interfaceport->name key.item)
                  (with-local-ps (vl-pp-scopestack-path key.scopestack))
                  key.item)
             :fn __function__
             :fatalp nil)))
          (mv (vl-extend-reportcard topname w reportcard)
              typos)))
        (:vl-modinst
         (b*
          (((vl-modinst key.item))
           (mod (vl-scopestack-find-definition
                     key.item.modname key.scopestack))
           ((unless (eq (tag mod) :vl-interface))
            (mv reportcard typos))
           ((when (or val.used val.set))
            (mv reportcard typos))
           (w
            (make-vl-warning
             :type :vl-lucid-spurious
             :msg "Interface ~w0 is never mentioned. (~s1)"
             :args
             (list
                  key.item.instname
                  (with-local-ps (vl-pp-scopestack-path key.scopestack))
                  key.item)
             :fn __function__
             :fatalp nil)))
          (mv (vl-extend-reportcard topname w reportcard)
              typos)))
        (otherwise (mv reportcard typos))))))

    Theorem: vl-reportcard-p-of-vl-lucid-dissect-pair.reportcard

    (defthm vl-reportcard-p-of-vl-lucid-dissect-pair.reportcard
      (b* (((mv ?reportcard ?typos)
            (vl-lucid-dissect-pair key val reportcard st typos)))
        (vl-reportcard-p reportcard))
      :rule-classes :rewrite)

    Theorem: vl-typocandidates-p-of-vl-lucid-dissect-pair.typos

    (defthm vl-typocandidates-p-of-vl-lucid-dissect-pair.typos
      (b* (((mv ?reportcard ?typos)
            (vl-lucid-dissect-pair key val reportcard st typos)))
        (vl-typocandidates-p typos))
      :rule-classes :rewrite)

    Theorem: vl-lucid-dissect-pair-of-vl-lucidkey-fix-key

    (defthm vl-lucid-dissect-pair-of-vl-lucidkey-fix-key
      (equal (vl-lucid-dissect-pair (vl-lucidkey-fix key)
                                    val reportcard st typos)
             (vl-lucid-dissect-pair key val reportcard st typos)))

    Theorem: vl-lucid-dissect-pair-vl-lucidkey-equiv-congruence-on-key

    (defthm vl-lucid-dissect-pair-vl-lucidkey-equiv-congruence-on-key
     (implies
      (vl-lucidkey-equiv key key-equiv)
      (equal (vl-lucid-dissect-pair key val reportcard st typos)
             (vl-lucid-dissect-pair key-equiv val reportcard st typos)))
     :rule-classes :congruence)

    Theorem: vl-lucid-dissect-pair-of-vl-lucidval-fix-val

    (defthm vl-lucid-dissect-pair-of-vl-lucidval-fix-val
      (equal (vl-lucid-dissect-pair key (vl-lucidval-fix val)
                                    reportcard st typos)
             (vl-lucid-dissect-pair key val reportcard st typos)))

    Theorem: vl-lucid-dissect-pair-vl-lucidval-equiv-congruence-on-val

    (defthm vl-lucid-dissect-pair-vl-lucidval-equiv-congruence-on-val
     (implies
      (vl-lucidval-equiv val val-equiv)
      (equal (vl-lucid-dissect-pair key val reportcard st typos)
             (vl-lucid-dissect-pair key val-equiv reportcard st typos)))
     :rule-classes :congruence)

    Theorem: vl-lucid-dissect-pair-of-vl-reportcard-fix-reportcard

    (defthm vl-lucid-dissect-pair-of-vl-reportcard-fix-reportcard
      (equal
           (vl-lucid-dissect-pair key val (vl-reportcard-fix reportcard)
                                  st typos)
           (vl-lucid-dissect-pair key val reportcard st typos)))

    Theorem: vl-lucid-dissect-pair-vl-reportcard-equiv-congruence-on-reportcard

    (defthm
     vl-lucid-dissect-pair-vl-reportcard-equiv-congruence-on-reportcard
     (implies
      (vl-reportcard-equiv reportcard reportcard-equiv)
      (equal (vl-lucid-dissect-pair key val reportcard st typos)
             (vl-lucid-dissect-pair key val reportcard-equiv st typos)))
     :rule-classes :congruence)

    Theorem: vl-lucid-dissect-pair-of-vl-lucidstate-fix-st

    (defthm vl-lucid-dissect-pair-of-vl-lucidstate-fix-st
     (equal (vl-lucid-dissect-pair key
                                   val reportcard (vl-lucidstate-fix st)
                                   typos)
            (vl-lucid-dissect-pair key val reportcard st typos)))

    Theorem: vl-lucid-dissect-pair-vl-lucidstate-equiv-congruence-on-st

    (defthm vl-lucid-dissect-pair-vl-lucidstate-equiv-congruence-on-st
     (implies
      (vl-lucidstate-equiv st st-equiv)
      (equal (vl-lucid-dissect-pair key val reportcard st typos)
             (vl-lucid-dissect-pair key val reportcard st-equiv typos)))
     :rule-classes :congruence)

    Theorem: vl-lucid-dissect-pair-of-vl-typocandidates-fix-typos

    (defthm vl-lucid-dissect-pair-of-vl-typocandidates-fix-typos
      (equal (vl-lucid-dissect-pair key val reportcard
                                    st (vl-typocandidates-fix typos))
             (vl-lucid-dissect-pair key val reportcard st typos)))

    Theorem: vl-lucid-dissect-pair-vl-typocandidates-equiv-congruence-on-typos

    (defthm
      vl-lucid-dissect-pair-vl-typocandidates-equiv-congruence-on-typos
     (implies
      (vl-typocandidates-equiv typos typos-equiv)
      (equal (vl-lucid-dissect-pair key val reportcard st typos)
             (vl-lucid-dissect-pair key val reportcard st typos-equiv)))
     :rule-classes :congruence)