DVT VHDL IDE User Guide
Rev. 19.1.31, 5 September 2019

Chapter 34. Tips and Tricks

The following tips and tricks give some helpful ideas for increasing your productivity.

Editing

Code Navigation

Searching

Miscellaneous

Editing

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


Component Automatic InstantiationYou need to type the first letters of the component (entity, component, configuration) name, then press Ctrl+Space three (3) times.


Matching begin - endIf you double click on/after architecture – end, function – end, etc. the block is highlighted.


Toggle CommentYou 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.


Expand/Restore SelectionPress Shift + Alt + Up Arrow to incrementally expand the current selection. For example when the cursor is on a word, select the word. Press again to select the whole line. Then, each of the nested enclosing scopes is selected, for example begin...end, then the enclosing proccess, then the enclosing architecture and so on. The same principle applies to nested enclosing parentheses, brackets and curly braces, as well as strings.


Press Shift + Alt + Down Arrow to restore the previous selection step made with Shift + Alt + Up Arrow
Format sourceUse the Source > Format Source action from the right click menu in the editor. The whole file is formatted or the current selection, if any.
One key indentationIf you press Tab once at the beginning 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 tasks 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 (TODO Markers) section of the documentation.


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


FoldingYou 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.
Folding custom areasYou can define custom folding areas using comments to indicate the start and the end of the area:


Maximize editor Double-click on the editor tab to maximize editor to full window. Double-click again to restore.
Show line numbersCheck Show line numbers from the General > Editors > Text Editors preference page
Local historyWhenever 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....


Open file in more editorsTo open multiple editors for the same file you should first open the file then right click on the editor's titlebar and select New Editor


Split the editor viewTo open multiple editors side by side follow these steps:


- open each file in its editor; if you wish to see the same file in a split view, right click on its titlebar and select New Editor


- if you wish to split horizontally, drag the title bar of the file you want to split and drop it over the horizontal scrollbar



- if you wish to split vertically, drag the title bar of the file you want to split and drop it over the vertical scrollbar


Column selectionYou can switch to and from column (block) selection mode either by clicking on the “Toggle Block Selection Mode” button in the toolbar, or by using the <Shift + Alt+ A> shortcut key.


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




HyperlinksIf you place the mouse over a type, method, field 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


Current ScopeYour current scope (for example the method or class you are editing) is always presented in the status bar.


Quick TypeYou can quickly open a specific type definition. Press Ctrl+Shift+T.


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 OutlinePress Ctrl+O to open the Quick Outline View. It presents an overview of your file. You can enter any regular expression to locate a place to jump in the current file.


Types ViewYou can view all 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... > DVT > Types.


Outline ViewYou 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 occurrencesWhen working in the VHDL editor, turn on Mark Occurrences in the toolbar or press Alt+Shift+O.


BookmarksSimilar 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 linePress Ctrl+L shortcut or double click in the status bar to jump to a specific line.



Back/Forward navigationYou can navigate between editors in a browser like way using the Back/Forward Navigation
Go to last edit locationUseful 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, hold Ctrl, hover over it's name and select Show Usages or right click on it's name > Show > Usages or right click on it's name > References > Project. The results are presented in the Search View. You can also search for references from the Search Dialog (Ctrl+H).


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


- Press Ctrl+H to open the Search Dialog


* Click on the VHDL 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 occurrences


- Click Search.

Miscellaneous

All shortcutsPress Ctrl+Shift+L to see all shortcuts.
Project PropertiesSelect the project in the Navigator View, right click and chose Properties. Or from menu Project > Properties.


System Variables and -f SupportSee: Build Configurations
Generic launch (make, scripts etc.)You can launch external scripts:


Menu Run > Run....


Select DVT Generic configuration and click the New button. Specify name, working directory and command.


Click Run.


Open terminalYou can open a fully working command-line terminal inside of DVT: In the Navigator View right-click on the desired location and select Open Terminal Here
External BuildersAn external builder allows you to invoke any script/tool and back-annotate its output (errors, warnings etc.) to the source code. Practically it 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 VhdlDT User Guide.
Mapping Linux to WindowsLinux directories can be mapped to Windows drives in order to access them from Windows. For example /home/simi is mapped to Z:\. This has an impact on paths configured for a DVT project. 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 inconsistenciesIn 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....
Add a new file extension to compile list extensionsGo to Window > Preferences > General > Content Types, select a category from the list (for example VHDL Source File) then click on Add and then on Ok.


Sharing workspace settingsExport all Workspace/ Eclipse customization:


- Go to File > Export > General > Preferences


- Make sure Export all is selected


- Select a file where the preferences should be exported


Now you can share this file with your team. When it is imported into another instance of Eclipse (by using File > Import > General > Preferences), the configuration (all options available in Window >' Preferences') is replaced by the imported one. Note: you should restart Eclipse for the changes to be enforced ( File > Restart).


Using System Varibles in Linked Resources You can use System Variables in the path of linked resources. For example ${DVT_ENV-SYSTEM_VARIABLE_NAME}/work is equivalent to $SYSTEM_VARIABLE_NAME/work in a console.
Waive problems reported by DVTYou can use Compile Waivers to promote, demote or disable the problems reported by DVT.


To quickly create a new waiver, in the Problems View right click on any problem reported by DVT and waive it. DVT proposes some default values for the waiver description, path and message. You can easily change them to fine-tune the waiver.


To quickly start up a new waivers file click on the Edit waivers button in the Problems View. The .dvt/waivers.xml is created with a default content and opened. You can easily create your own waivers from the default generated ones.


In the waivers editor you can use autocomplete for tags, attributes and attribute values.
Open a file in DVT from the terminalYou can use the Command Line Interface like this:


$> dvt_cli.sh -workspace ~/dvt_workspace openFile $(readlink -f my/file.sv)


The command can be shortened by defining this alias in your ~/.cshrc:


alias dvtopen 'dvt_cli.sh -workspace ~/dvt_workspace openFile `readlink -f \!*`'


or by defining this function in your ~/.bashrc:


dvtopen () { dvt_cli.sh -workspace ~/dvt_workspace openFile $(readlink -f $1); }


Then the command gets much shorter:


$> dvtopen my/file.sv