Tips and Tricks

Editing

  1. Content assist

  2. [1.5.0]Expand Macros (Apply Preprocessing)

  3. [1.5.0]Trace Macro Errors

  4. Code templates

  5. [2.8.4]Quick Macro Inspect

  6. [2.5.0]Matching begin end

  7. [2.6.0]Mismatched `endif

  8. Toggle comment

  9. [2.0.0]Format source

  10. One key indentation

  11. NEWReminders (TODO markers)

  12. Spell checking

  13. Folding

  14. Maximize editor

  15. Show line numbers

  16. Local history (backup)

  17. Inactive code highlight

  18. NEWEmacs automations

Code Navigation

  1. Tooltips

  2. Hyperlinks

  3. [2.0.0]Inheritance Tree and Members

  4. [2.0.0]Instance Tree

  5. [2.6.0]Class Diagrams

  6. [1.5.0]Current Scope

  7. [1.5.0]Quick Types

  8. [1.5.0]Quick Outline

  9. [1.5.0]Quick Include Tree

  10. [1.5.0]Quick Hierarchy

  11. [1.5.0]External Implementation

  12. [1.5.0]Types

  13. [1.5.0]Include Tree

  14. [2.8.4]Macros

  15. Outline

  16. Mark occurrences

  17. Bookmarks

  1. Go to line

  2. Back/Forward navigation

  3. Go to last edit location

Searching

  1. [1.5.0]Search for task, function, field etc.

  2. [2.0.0]Search for references

  3. Search for whole word

Miscellaneous

  1. All shortcuts

  2. Project Properties

  3. [2.5.0]Export HTML Documentation

  4. Generic launch (make, scripts etc.)

  5. [2.6.0]VMM Smart Log

  6. [2.3.0]System Variables and -f Support in Top Files or INCDIR

  7. [2.8.4]Quick OVM Project

  8. [2.8.4]Quick VMM Project

  9. [2.3.0]External Builders

  10. [2.3.0]External Documentation

  11. [2.5.0]OVM Compliance Review

  12. NEWOVM Field Editor

  13. [2.3.0]Context Sensitive Help

  14. [2.3.0]Internal Builder Properties

  15. [2.3.0]Mapping Linux to Windows (/proj/ to Z:\proj\)

  16. [2.3.0]Project Templates

  17. Recover from abnormal inconsistencies

Editing

Content assist

Content assist provides you with a list of suggested completions for partially entered text. In the editor press Ctrl+Space.

Expand Macros (Apply Preprocessing)

You can apply preprocessing over a selected section of code in order to see how macros are expanded. Select then right click -> Macros -> Expand All Levels.

You can also expand/collapse macros inline using Ctrl Shift = respectively Ctrl Shift - with the cursor placed on a macro call.



See the Macro Expansion section in the documentation

Trace Macro Errors

To debug macro usage errors (especially if macros in macros are used) you can see how the error is propagated from macro to macro (the error trace) either by:

  • going with the mouse over the error marker on the left and right click




  • or selecting the error in the Problems View, right click and chosing Macro Trace

The macro error trace will be presented in the Console View with hyperlinks to source.

Code templates

Code templates are presented in content assist if applicable.

Quick Macro Inspect

You can quickly inspect macro reparsing if you go with the mouse over the macro marker which appears on the left bar.

A tooltip appears showing how the macro is reparsed (only first level).

Matching begin - end

If you double click on/after begin – end, function – endfunction etc. the block is highlighted.

Mismatched `endif

You can use comments after `endif to track the match with starting `ifdef. If the name of `ifdef doesn't match the `endif comment a warning is issued.

Toggle Comment

You can toggle comment on/off for the current line or the selected lines. Press Ctrl+/ or use the action from the drop down menu on right click in editor.

Format source

Use the Format Source action from the toolbar or from editor right click menu.

The whole file is formatted or the current selection, if any.

One key indentation

If you press Tab once at the begining of a line, it is automatically aligned to the enclosing context.

Press twice to insert a tab.

Reminders (TODO markers)

When you tag a comment in source code with TODO, a corresponding taks is automatically created as a reminder. From the Tasks View, double click on the task takes you to the TODO in the code.

Same for for FIXME (higher priority) and XXX (lower priority) markers. You can also add your own tags, see the Reminders section of the documentation.



Spell checking

You can enable spell-checking support from the General > Editors > Text Editors > Spelling preference page. Spelling errors are displayed in the e Language editor and corresponding Quick Fixes are available.

Folding

You can fold code sections to improve read-ability. This is how a folded file looks like:

Folding actions (to expand or collapse) are available in the toolbar or on right click in the editor. You may also use the + or - signs on the left side of the editor.

  • Use Collapse All Levels for folding to statement (class, module ...) level.

  • Use Show First Level for folding to struct member (method, cover...) level.

  • Use Expand All to fully expand the file.

When you type on a folded line, it is automatically expanded. You may see the folded code in a tooltip if you move with the mouse over the + sign.

Maximize editor

Double-click on the editor tab to maximize editor to full window. Double-click again to restore.

Show line numbers

Check Show line numbers from the General > Editors > Text Editors preference page

Local history

Whenever you edit a file, its previous contents are kept in the local history. Right click in the editor and chose Compare With/Replace With > Local History....

Inactive code highlight

The editor marks with a colored background the areas of code which are not compiled due to preprocessing. See the Inactive Code Highlight documentation section.

Emacs Automation

You can invoke Emacs to perform automation on the file you are currently editing. In the editor window: Right click > Emacs, then select one of: Auto, DeleteAuto, InjectAuto, Indent or use the associated keybidings (the same as in Emacs).

Note 1: the shortcuts are available only when Emacs mode is enabled in Eclipse; to enable Emacs mode go to Window -> Preferences -> General -> Keys and select the Emacs scheme.

Note 2: you can also add toolbar buttons to perform Emacs automation: go to Window -> Customize Perspective -> Command Groups Availability and check Emacs Verilog-Mode from the Available command groups on the left.

Code Navigation

Tooltips

When you position the mouse over a type, method, field etc., a tooltip will pop-up showing information on corresponding declaration.





Hyperlinks

If you place the mouse over a type, method, field, macro etc. and press the Ctrl key, a hyperlink will be presented. Click on the hyperlink to jump to definition.

You can also jump to a definition if you put the cursor on the relevant name and press F3.

Inheritance tree and members (Hierarchy View)

You can view the inheritance tree and all the members of a class by placing the mouse over it and pressing the F4 key.

Instance tree of a module (Instance Tree View)

You can view the instance tree of a module by placing the mouse over it and pressing Shift+F4.

Class Diagrams

You can create class diagrams to inspect or document the architecture of a verification environment.

For more details see the Diagrams > Class Diagrams chapter in VlogDT User Guide.

Current Scope

Your current scope (in which method or class you are editing) is always presented in the status bar.

Quick Types

You can quickly open a specific type definition. Press Ctrl+Shift+T or press the Open Type button in the toolbar.

The Quick Types View will pop-up and you can enter any regular expression to locate a type. Select and press Enter or click to jump to its definition.

Quick Outline

Press Ctrl+O to open the Quick Outline which presents an overview of your file. You can enter any regular expression to locate a place to jump in the current file.

Quick Include Tree

You can quickly open a file which is included via the top files. Just press Ctrl+I.

The Quick Import View will pop-up and you can enter any regular expression to locate a file. Select and press Enter or click to open the file.

Quick Hierarchy

Position the cursor on the entity (struct, method ...) name and press Ctrl+T to see the Quick Hierarchy View.

For methods and others, non-grayed icons means parent implementations are available.

External Implementation

You can view the external implementations in the Layers View. Position the cursor on the relevant name and press Shift+F3 or right click and chose Show Layers from the menu.

Types View

You can view all the types (scalars, classes, module) in the project (including their fields, methods etc.) in the Types View. Open the view from menu Window > Show View > Other > Verilog Language > Types View.

Include Tree View

You can see the include tree of the files in your project in the Include Tree View.

Open the view from menu Window > Show View > Other... > Verilog Language > Include Tree.

Macros View

You can see all the defines in your project in the Macros View.

Open the view from menu Window > Show View > Other... > Verilog Language > Macros.

Outline View

You can see the summary contents of the current file (structs, field, methods) in the Outline View.

Open the view from menu Window > Show View > Other... > General > Outline.

Mark occurrences

When working in the SystemVerilog editor, turn on Mark Occurrences in the toolbar or press Alt+Shift+O.

Bookmarks

Similar with a web browser, you can add bookmarks in your code without altering the code.
Right click on the left vertical bar of the editor and chose Add Bookmark...

Specify a meaningful name:

You can jump to bookmarks from Bookmarks View. Open the view from menu Window > Show View > Other... > General > Bookmarks.

Go to line

Press Ctrl+L shortcut or double click in the status bar to jump to a specific line.

Back/Forward navigation

You can navigate between editors in a browser like way using the Back/Forward Navigation

Go to last edit location

Useful when you navigated around in the code, before proceeding with the source change.

Click on Last Edit Location button in the toolbar to jump to the file where you were previously editing.

Searching

Search for task. function, field etc.

To search for the declaration of a specific type, method, field etc. :

  • Press Ctrl+H to open the Search Dialog

  • Click on the Vlog Search tab.

  • Type the name in the Search String (if you select in the editor before pressing Ctrl+H, the Search String is automatically set to the selection).

  • Select type or function etc. and Declarations

  • Click Search.

Search for references

To search where a method (or field etc.) is used, right click on it's name > Refereces > Project.
The results are presented in the Search View.
You can also search for references from the Search Dialog (Ctrl+H).

Search for whole word

To search for a whole word in all files, in comments or not:

  • Press Ctrl+H to open the Search Dialog

  • Click on the vlog Search tab.

  • Type the name in the Search String (if you select in the editor before pressing Ctrl+H, the Search String is automatically set to the selection).

  • Select Whole Word and Do not search in comments or All occurences

  • Click Search.

Miscellaneous

All shortcuts

Press Ctrl+Shift+L to see all shortcuts.

Project Properties

Select the project in the Navigator View, right click and chose Properties.
Or from menu Project > Properties.

Export HTML Documentation

To generate the HTML Documentation click the Export HTML Documentation Wizard button in the toolbar of the Verilog Perspective.

For more details see the Export HTML Documentation chapter in VlogDT User Guide.

OVM Compliance Review

To perform the OVM compliance review of your project click the OVM Compliance Review button in the toolbar of the Verilog Perspective.

For more details see the OVM Compliance Review chapter in VlogDT User Guide.

OVM Field Editor

The OVM Field Editor enables you to inspect and edit OVM field registrations.
To bring up the OVM Field Editor, right click inside a class definition and select 'OVM Field Editor' from the pop-up menu, or simply press Shift Alt F.

Project Templates

A project template is a parameterized directory tree. Both in the file contents (.v, .sv, .sh - practically any file) and in the file or directory names you can use parameters.

Combined with TODO markers, you can use a project template as a customized wizard.

For more details see the Project Templates chapter in VlogDT User Guide.

System Variables and -f Support

To specify Top Files, INCDIR etc. you can also directly edit the corresponding files <project_dir>/.dvt/.vlog_top_files, <project_dir>.dvt/.vlog_inc_dir etc. and use:

  • -f <file_name> to include a file containing more commands

  • system variables like ${var} or %var%

  • absolute paths

  • comments (//,--,#)

  • Top Files only: +incdir+<path> or -incdir <path> to indicate search directories for files included with `include "filename"

  • Top Files only: +define+<DEFINE>[=<replacement>] or -define <DEFINE> [=<replacement>] similar with `define name replacement

  • Top Files only: -v <path> to specify the Verilog source library file

  • Top Files only: -y <path> to specify the Verilog source library directory

  • Top Files only: +libext+<suffix> to specify suffix (extension) of files in the library directories

Quick OVM Project

Quickly enable OVM library use from right click on project > Properties > Verilog Language > OVM

Quick VMM Project

Quickly enable OVM library use from right click on project > Properties > Verilog Language > VMM

Generic launch (make, scripts etc.)

You can launch external scripts:

  1. Menu Run > Run....

  2. Select Generic configuration and click the New button.

  3. Specify name, working directory and command.

  4. Click Run.

VMM Smart Log

DVT ships with predefined filters for VMM which allow you to view colored and hyper-linked logs like the one below.

For more details see the External Tools > VMM Smart Log chapter in VlogDT User Guide.

External Builders

An external builder allows you to invoke any script/tool and back-annotate its output (errors, warnings etc.) to the source code. It is a mean which allows you to connect any 3d party tool (compiler, linter etc.) to DVT error signaling engines.

You can configure one or more external builders on a project:

  • The commands you define will be invoked on project clean, full build and incremental build.

  • The patterns you define will be applied on the command output to recognize errors, warnings etc.

  • The pattern matches will be back-annotated to the source code and presented in a similar way DVT signals errors (file, line, in the Errors View etc.)

DVT ships with some predefined example configurations to get you started.

For more details see the External Tools > External Builders chapter in VlogDT User Guide.

External Documentation

You can browse and search through 3rd party documentation using the Eclipse help system.

For more details see the External Tools > External Documentation chapter in VlogDT User Guide.

Context Sensitive Help

A focused set of help topics that is related to the current context can be shown to users on demand using context-sensitive help. This form of user assistance is delivered to users when a platform-specific trigger is activated (e.g. F1 key on Windows, Ctrl+F1 on GTK, Help key on Carbon).

For more details see the Getting Started > Context Sensitive Help chapter in VlogDT User Guide.

Internal Builder Properties

You can configure the VlogDT Builder from project properties, section Internal Builder.

For more details see the VlogDT Builder (Internal DVT Builder) chapter in VlogDT User Guide.

Mapping Linux to Windows

Linux directories can be mapped to Windows drives, which allows editing files from Windows. For example /home/simi is mapped to Z:\. This has an impact on paths configured for a DVT project, for example INCDIRs etc. The paths are set using Linux conventions, however Eclipse runs in Windows and the DVT builder needs to know about the mapping in order to compile the files.

To specify the mapping, set the system variable %DVT_CROSSPLATFORM_MAP% before invoking Eclipse. You can add multiple mappings separated by ";" e.g.:

/projects/=p:\;/home/lars/=Z:\lars\

Recover from abnormal inconsistencies

In the event of unexpected behavior (missing results in search, types in type browsing, hyperlinks, tooltips etc.) please manually trigger a clean build from menu Project > Clean... or toolbar button .