• 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
            • Selfassigns
              • Vl-modulelist-check-selfassigns
              • Vl-expr-approx-bits
              • Vl-assignlist-check-selfassigns
              • Vl-module-check-selfassigns
              • Vl-assign-check-selfassigns
              • Vl-selfassign-bits
              • Vl-selfassign-bits-from-indices
              • Vl-selfassign-bit
              • Vl-design-check-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
  • Vl-lint

Selfassigns

Simple check for self-assignments.

This is just a heuristic check that adds warnings if it sees assignments where some bit is on both the left- and right-hand sides. For instance, it would warn about something like this:

assign foo = a ? b : foo;

Such assignments might be combinational loops. Of course, most combinational loops are not so simple, and this is just an extremely stupid check that will only catch the most obvious problems.

I started by just seeing how bad it would be if I just gathered names on both side of the expression using vl-expr-names to gather up the names. But that produced too much noise about assignments like

foo[1] =
foo[0]
.

So I now essentially collect up the bits of expressions, fudging for bit/part selects that aren't resolved. If this is done only after ranges are resolved, it is still pretty good. But it needs to be done before expressions are split, etc.

This found only two things at Centaur, one of which was an assignment of an otherwise-unused wire to itself, and one which was not actually a problem because essentially it had the form:

assign {foo, bar} = {baz, foo};

Subtopics

Vl-modulelist-check-selfassigns
(vl-modulelist-check-selfassigns x ss) maps vl-module-check-selfassigns across a list.
Vl-expr-approx-bits
Collect strings representing (approximately) the individual bits of wires involved in an expression.
Vl-assignlist-check-selfassigns
(vl-assignlist-check-selfassigns x ss) applies vl-assign-check-selfassigns to every member of the list x, and appends together all the resulting lists.
Vl-module-check-selfassigns
Check the assignments of a module for self-assignments to bits.
Vl-assign-check-selfassigns
(vl-assign-check-selfassigns x ss) checks an assignment for bits that occur on the lhs and rhs.
Vl-selfassign-bits
Vl-selfassign-bits-from-indices
Vl-selfassign-bit
Vl-design-check-selfassigns