Go to Definition
About 275 wordsLess than 1 minute
2025-01-08
What is go to definition
Go to definition takes you from where a symbol is used to its declaration. Common cases:
- from a use of a signal, variable or type to its declaration, including signals referenced in instance connections and connection expressions;
- from an instance's module name to the module definition, even when it is in another file;
- from a named port connection to the port declaration in the target module;
- from a parameter assignment in an instance to the parameter declaration in the target module.
Place the cursor on an identifier and press F12, or right-click and choose Go to Definition. Alt+F12 peeks at the definition in place; on Windows/Linux you can also Ctrl-click a symbol.
Demo
The two sides of a named connection
The two sides of a named connection are different symbols. In .input_a(signal), input_a jumps to the port declaration in the target module, while signal jumps to the local declaration in the current module. The same applies to WIDTH in the parameter assignment #(.WIDTH(8)), which jumps to the target module's parameter declaration.
Find references
Find All References (Shift+F12) lists the resolved references to a symbol across the project. Unlike text search, it does not include unrelated identifiers with the same name. Macros and include paths can also be navigated when their dependencies resolve.
When navigation fails
If the target is ambiguous or the jump fails, check for duplicate design units, include paths, library settings and .dideignore. Do not change the top level to work around a missing dependency.