• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • 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-delete-duplicated-genelement-blocknames
                      • Vl-scope->raw-generates
                  • 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
  • Vl-scope-nameclash-warnings

Generate-block-nameclash-items

Special detection of name clashes involving generate block names.

Here we are trying to defend against NOT OK things such as:

wire foo;
if (version == 1)
begin : foo
  ...
end

Note that the above is NOT OK even if version != 1, i.e., even if the block is not going to exist after elaboration. See failtest/gen1*.v for many informative and related tests.

For everything else, our nameclash handling basically works as follows. For any arbitrary scope, check for name clashes by:

  • collecting up its scopeitem-alist, then
  • checking it for duplicate keys.

This works for almost everything (wire names, module instance names, port names, etc.), but our scopeitem-alist building code only collects the names from top-level named genblocks and genarrays. This makes perfect sense in post-elaboration contexts where any conditional generates have been eliminated, but it isn't right for us here because it doesn't get things like foo above. That is, it doesn't get any named blocks that occur as loop bodies, or under if/case constructs.

That's actually good. It's needs to be OK to have things like this:

if (version == 1)
begin : foo
  ...
end
else if (version == 2)
begin : foo              <--- no name clash with foo from above
  ...
end

So if scopeitem-alist collection was ``smarter'' and somehow dived down into the if/else blocks, we might think that there was a name clash for foo, which there isn't.

Anyway, our goal here is basically to augment the scopeitem-alist that we would normally produce with a supplemental scopeitem alist that accounts for the named blocks within any if/case/loop generate constructs.

Subtopics

Vl-delete-duplicated-genelement-blocknames
Vl-scope->raw-generates
Get the raw list of generate statements from any scope.