Structure View
Use the structure view to see the outline of a long file at a glance and to jump to any class, method or port without scrolling or searching. The Structure tool window (⌘7 on macOS, Alt+7 on Windows/Linux) and the File Structure popup (⌘F12 / Ctrl+F12, or Navigate | File Structure) show the declarations of the current file as a tree.
Try it
Section titled “Try it”The steps use the sample project; open it and wait for indexing first. Nothing is edited, so there is nothing to undo.
- Open
uvm/my_pkg.svand press ⌘F12 (Ctrl+F12; hold Fn if F12 does nothing on a laptop). - The popup shows
my_pkgwith its classes. Undermy_driveryou seevif,new,build_phaseandrun_phase; undermy_item,addr,data, the constraintc_addrandnew. - Type
runand press Enter. The popup closes and the caret (the text cursor) in the editor is onrun_phase. (Escape closes the popup without jumping.) - Press ⌘7 (Alt+7) to open the same tree in the Structure tool window; it stays open as a side panel (usually on the right; press ⌘7 / Alt+7 again to hide it), and a click on an entry (for example
connect_phaseundermy_env: the caret moves to that method) jumps to it.
If the tree is empty or the shortcut does nothing, see If it doesn’t work.
What it shows
Section titled “What it shows”| Under | Shown |
|---|---|
| The file | modules, interfaces, programs, packages, classes, interface classes, checkers, user-defined primitives, functions and tasks |
| A module, interface or program | parameters, ports, nets, variables, typedefs, instances (also gate instances such as and g1 (…)), functions, tasks, modports, clocking blocks, properties, sequences, covergroups, checkers, classes, generate blocks (by their label) |
| A package | parameters, typedefs, variables, functions, tasks, classes, checkers |
| A class | properties, constraints, covergroups, the constructor new and methods (also as extern prototypes), typedefs, parameters, nested classes |
| A generate block | its declarations (a block without a label adds them to the enclosing module) |
Each entry shows its kind (port, net, task, …). Local variables of functions, tasks and procedural blocks are not
listed, and neither are the ports and items of a checker or primitive (the checker or primitive itself is listed). Click
an entry, or pick it in the popup, to jump to its name. The tree follows your edits.
Two options of the Structure tool window (its toolbar buttons) help in a long file: the tree can be sorted alphabetically, and with Autoscroll from Source the entry around the caret (the text cursor) is selected: the method whose body you are in, the module, the declaration under the caret.
Limitations
Section titled “Limitations”- Only declarations in the active branch of an
`ifdefare listed (see Conditional compilation). - The body of an out-of-block method (
function void C::f(); … endfunction, written outside its class) has no entry of its own; its prototype in the class is listed. With the caret in such a body, Autoscroll from Source selects the enclosing package (or nothing at file level), not the prototype.
If it doesn’t work
Section titled “If it doesn’t work”| You see | Likely cause | What to do |
|---|---|---|
| The tree is empty | The file is not a SystemVerilog file (.sv, .svh, .v), or the plugin is disabled |
See Installation |
| A declaration is missing | It is in code an `ifdef switches off, or it is a kind that is not listed (a local variable) |
See the limitations above |
| The shortcut does nothing | Your keymap differs, or on a laptop you must hold Fn for F12 | Use Navigate | File Structure, or View | Tool Windows | Structure |