This module provides name resolution for ASTs. The targeted approach is as
follows:
- Perform a first pass where names are collected and scopes are assembled.
Scopes shall be collected into a scope map, indexed by the item ID.
- Perform a second pass where names are resolved against the ones collected
in step 1. This should then allow for proper resolution of imports,
hierarchical names, and paths (
pkg::name and intf.modport).
Implement a more efficient way of resolving names. In a first pass, iterate
over all globally visible items, and items that are accessible through
hierarchical names, and store them in a lookup table. Then perform a second
pass where we go through each and every item in the AST and resolve names.
In this second pass we keep a stack of local scopes that we use to resolve
variable names and other local declarations. Whenever we cannot find
something, we resolve to checking the lookup table discussed above. Be wary
of the precedence between the lookup table and the individual local scopes.
| NameResolution |
The result of name resolution: An association between every identifier in
the AST and a definition it points to.
|