• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
          • Scopestack
          • Filtering-by-name
          • Vl-namefactory
          • Substitution
          • Allexprs
          • Hid-tools
          • Vl-consteval
          • Range-tools
          • Lvalexprs
          • Hierarchy
          • Finding-by-name
            • Fast-finding-by-name
            • Vl-find-interfaceport
            • Vl-find-portdecl
            • Vl-find-taskdecl
            • Vl-find-paramdecl
            • Vl-find-interface
            • Vl-find-gateinst
            • Vl-find-vardecl
            • Vl-find-typedef
            • Vl-find-program
            • Vl-find-package
            • Vl-find-module
            • Vl-find-modport
            • Vl-find-modinst
            • Vl-find-genelement
            • Vl-find-fundecl
            • Vl-find-config
            • Vl-modalist
            • Vl-find-udp
            • Vl-make-portdecl-alist
            • Vl-fast-find-module
            • Vl-fast-find-portdecl
          • Expr-tools
          • Expr-slicing
          • Stripping-functions
          • Stmt-tools
          • Modnamespace
          • Vl-parse-expr-from-str
          • Welltyped
          • Reordering-by-name
          • Flat-warnings
          • Genblob
          • Expr-building
          • Datatype-tools
          • Syscalls
          • Relocate
          • Expr-cleaning
          • Namemangle
          • Caremask
          • Port-tools
          • Lvalues
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Mlib

Finding-by-name

Functions for looking up and reordering parsed objects by their names.

These are low-level functions that allow you to find parsed objects (e.g., variables, modules, parameters) by their names, or to use names to rearrange lists of objects.

Note: these functions do not have any proper understanding of scoping issues. If you just want to look up a name and see what it refers to, you should not use these functions; see scopestack instead.

One way to do find elements by name is to naively scan through the list of items and retrieve the first one that matches the name. Our simple lookup functions just do this for various types of objects. For instance, we provide functions to "find a portdecl with the following name in this list of portdecls."

If many items are going to be looked up from the same list, as is often the case, then a faster approach is to construct a fast alist that maps the item names to the items themselves, and then use hons-get to do hash table lookups. See fast-finding-by-name for functions related to constructing fast alists binding names to items that can be used for this purpose.

Subtopics

Fast-finding-by-name
Utilities for building alists for doing fast-alist lookups.
Vl-find-interfaceport
Naive, O(n) lookup of a vl-interfaceport in a list by its name.
Vl-find-portdecl
Naive, O(n) lookup of a vl-portdecl in a list by its name.
Vl-find-taskdecl
Naive, O(n) lookup of a vl-taskdecl in a list by its name.
Vl-find-paramdecl
Naive, O(n) lookup of a vl-paramdecl in a list by its name.
Vl-find-interface
Naive, O(n) lookup of a vl-interface in a list by its name.
Vl-find-gateinst
Naive, O(n) lookup of a vl-gateinst in a list by its name.
Vl-find-vardecl
Naive, O(n) lookup of a vl-vardecl in a list by its name.
Vl-find-typedef
Naive, O(n) lookup of a vl-typedef in a list by its name.
Vl-find-program
Naive, O(n) lookup of a vl-program in a list by its name.
Vl-find-package
Naive, O(n) lookup of a vl-package in a list by its name.
Vl-find-module
Naive, O(n) lookup of a vl-module in a list by its name.
Vl-find-modport
Naive, O(n) lookup of a vl-modport in a list by its name.
Vl-find-modinst
Naive, O(n) lookup of a vl-modinst in a list by its name.
Vl-find-genelement
Naive, O(n) lookup of a vl-genelement in a list by its name.
Vl-find-fundecl
Naive, O(n) lookup of a vl-fundecl in a list by its name.
Vl-find-config
Naive, O(n) lookup of a vl-config in a list by its name.
Vl-modalist
Legacy. Build a fast alist mapping module names to modules.
Vl-find-udp
Naive, O(n) lookup of a vl-udp in a list by its name.
Vl-make-portdecl-alist
Build a fast alist associating the name of each port declaration with the whole vl-portdecl-p object.
Vl-fast-find-module
Legacy. vl-modalist-optimized version of vl-find-module.
Vl-fast-find-portdecl
Faster version of vl-find-portdecl, where the search is done as an fast-alist lookup rather than as string search.