Tips and Tricks

A few tips and tricks for increasing your productivity.

Editing Source

Content assist

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

../../_images/pss_concepts_autocomplete_1.png

Content assist for enumerated types

You can use content assist to speed up the access to enum items. Just press Ctrl+Space.

../../_images/pss_concepts_autocomplete_2.png

Code templates

Code templates are presented in content assist if applicable.To create your own templates use the Code Templates View or the DVT > Code Templates preference page.

../../_images/pss-code-template-proposals.png

Matching brackets

To find a matching bracket place the cursor after the bracket and press Ctrl+Shift+P or choose Source > Jump To Pair Bracket from the right click menu. You can also double click after the bracket - this selects the text between the two brackets.

../../_images/pss-tips-matching-brackets.png

Toggle comment

You can toggle comment on/off for the current line or the selected lines. Press Ctrl+/ or from the right click menu in editor Source > Toggle Comment.

../../_images/pss-tips-toggle-comment.png

Expand/Restore Selection

Press 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 the current action block, then the enclosing function, then the enclosing struct 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 source

Use the Format Source action from the editor right click menu Source > Format Source. The whole file is formatted or the current selection, if any.

One key indentation

If 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 e source code with TODO, a corresponding task 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.

../../_images/pss-tasks-view.png

Spell checking

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

../../_images/pss-spelling-correction-proposal.png

Folding

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

../../_images/pss-folding.png

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

  • Use Collapse All Levels for folding to statement level.

  • Use Show First Level for folding to struct member 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 areas

You can define custom folding areas using comments to indicate the start and the end of the area:

../../_images/dvt-custom-folding.png

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 Opens the general text editor preference page 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 choose Compare With/Replace With > Local History….

../../_images/pss-local-history.png

Go to line

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

../../_images/dvt-line-number-in-status-bar.png
../../_images/dvt-go-to-line.png

Back/Forward navigation

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

../../_images/dvt-tips-bkfwd-btn.png

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 lastedit in the toolbar to jump to the file where you were previously editing.

Inactive code highlight

The editor marks with a colored background the areas of code that are not active. See the Inactive Code Highlight documentation section.

../../_images/pss-inactive-code-highlight.png

Open file in more editors

To open multiple editors for the same file you should first open the file then use menu Window > Editor > Clone.

Split the editor view

To 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, use menu Window > Editor > Clone.

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

../../_images/pss-tips-split-editor-horizontal.png
  • if you wish to split vertically, drag the title bar of the file you want to split and drop it over the vertical scrollbar

../../_images/pss-tips-split-editor-vertical.png

Column selection

You 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.

../../_images/dvt-toggle-block-selection.png

Searching

Search for method, field, event etc.

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

  • Press Ctrl+H to open the Search Dialog

  • Click on the PSS 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 pool etc. and Declarations

  • Click Search.

../../_images/pss-search-view.png

Search for references

To search where a field, method, action etc. is used, hold Ctrl, hover 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).

../../_images/pss-show-usages.png

Code Navigation

Tooltips

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

../../_images/pss-tooltip-action.png

Hyperlinks

If you place the mouse over a type, 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.

../../_images/pss-tips-hyperlink-to-type.png

Inheritance tree

You can view the inheritance tree and all the members of a struct by placing the mouse over it and pressing the F4 key. See also Type Hierarchy View.

../../_images/pss_type_hierarchy_view.png

Components tree

You can use the Verification Hierarchy View to browse the tree of sub-components by placing the mouse over a top component and pressing Shift+F6.

Scope

Your current scope (for example the method or struct you are editing) is always presented in the status bar.

../../_images/pss-tips-current-scope.png

Quick Types

You can quickly open a specific type definition, just 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.

../../_images/pss_quick_types_view.png

Quick Outline

Press 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.

../../_images/pss-quick_outline_view.png

Quick Layers

Press Ctrl+Shift+O with the cursor positioned on the name to quickly see extensions.

../../_images/pss_quick_layers_view.png

Quickly jump to a layer of a field’s type

Press Ctrl+Shift+O twice with the cursor positioned on the field name (first time shows the field layers, second time the layers of the type of the field). Then you can use the filter to jump to the desired layer.

Quick Compile Order

You can quickly open a compiled file. Just press Ctrl+I. The Quick Compile Order 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.

../../_images/pss_quick_compile_order_view.png

Quick Hierarchy

Position the cursor on the struct name and press Ctrl+T to see the Quick Type Hierarchy View.

../../_images/pss_quick_type_hierarchy_view.png

Layers

You can view all the extensions (layers) of composite and enumerated types. Place the cursor on the name and press Shift+F3 or right click and choose Show > Layers from the menu. See Layers View.

../../_images/pss-layers-view.png

Types

You can view all types (enums, structs) in the project (including each struct fields, methods etc.) in the Types View. Open the view from menu Window > Show View > Other… > DVT > Types.

Coverage

You can browse all the coverage definitions in the project using the Coverage View. Open the view from menu Window > Show View > Other… > DVT > Coverage.

../../_images/pss-coverage-view.png

Compile Order

You can see the compile order of the files in your project in the Compile Order View. Open the view from menu Window > Show View > Other… > DVT > Compile Order.

../../_images/pss_compile_order_view.png

Outline

You can see the summary contents of the current file in the Outline View. Open the view from menu Window > Show View > Other… > General > Outline.

../../_images/pss-outline_view.png

Mark occurrences

When working in the PSS editor, turn on Mark Occurrences in the toolbar mark-occurrences or press Alt+Shift+O.

../../_images/pss-occurrences-highlighted.png

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 choose Add Bookmark…

../../_images/pss-bookmark-action.png

Specify a meaningful name:

../../_images/pss-bookmark-dialog.png

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

../../_images/pss-bookmarks-view.png

Miscellaneous

All shortcuts

Press Ctrl+Shift+L to see all shortcuts.

../../_images/dvt-all-shortcuts.png

Project Properties

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

Project Templates

A project template is a parameterized directory tree. Both in the file contents (.pss, ,.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 Project Templates.

System Variables

See: Build Configurations

Generic launch (make, scripts etc.)

See: Run Configurations

Create dialogs for scripts & flows

You can create Custom Dialogs for your own scripts:

../../_images/dvt-customdialogs-demo.png

Follow the wizard from menu New > Example > DVT > DVT Custom Dialog, then create a run configuration with the command echo ${dvt_dialog_prompt:customdialog.swtxml} and run it.

Open terminal

You can open a fully working command-line terminal inside of DVT: In the Project Explorer View right-click on the desired location and select Open Terminal Here

Mapping Linux to Windows (/proj/ to Z:\proj\)

Linux 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, 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 a disfunction (missing results in search, types in type browsing, hyperlinks, tooltips etc.) please manually trigger a rebuild rebuild.

Add a new file extension to compile list extensions

Go to Window > Preferences > General > Content Types, select a category from the list (for example PSS Source File) then click on Add and then on Apply and Close.

../../_images/pss-contenttype-add-file-extension.png

Share workspace settings

Export 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).

../../_images/export-preferences-select.png
../../_images/export-preferences-exportall.png

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 DVT

You 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 terminal

You 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