DVT IDE for VS Code VHDL User Guide
Rev. 24.1.5, 13 March 2024

Chapter 25. External Tools Integration

Development process usually involves running various tools for pre-processing, compiling and simulating the code. In order to save time and avoid switching through applications, these tools can be integrated in VS Code using the Tasks feature.

Tasks are configured from the tasks.json file in the .vscode workspace directory. Use "Tasks: Configure Tasks" command and select "Create tasks.json file from template" -> "Others" to generate a tasks.json stub.

To run a Task, use the "Tasks: Run Task" command and select the desired one from the drop-down list.

For a comprehensive reference see the Tasks chapter in the official VS Code documentation.

Examples:

1. Run a simulation

{
   "version": "2.0.0",
   "tasks": [
       {
           "label": "Run simulation",
           "type": "shell",
           "options": {
               "cwd": "$IP_DIR",
               "env": {
                   "TEST_NAME" : "smoke"
               }
           },            
           "command": "make sim",
       }
   ]
}

2. Run a simulation and extract problems

The problems matched by problem matchers will be displayed in the Problems Panel.

{
   "version": "2.0.0",
   "tasks": [
       {
           "label": "Run simulation",
           "type": "shell",
           "options": {
               "cwd": "$IP_DIR",
               "env": {
                   "TEST_NAME" : "smoke"
               }
           },            
           "command": "make sim | ${DVT_SIMLOG_PROCESSOR}",
           "problemMatcher": [
               "$dvt-uvm-error",
               "$dvt-uvm-fatal",
               "$dvt-uvm-info",
               "$dvt-uvm-warning"
           ]
       }
   ]
}

Task Snippets

DVT provides built-in task snippets. Use the Insert Snippet command or the Content Assist to select one of the following available task snippets:

  • dvt-task-vcs-problems-from-log

  • dvt-task-questa-problems-from-log

  • dvt-task-ius-problems-from-log

Problem Matchers

Problem matchers scan the task output text for known info, warning or error strings, and report these inline in the editor and in the Problems Panel. Built-in problem matchers can be added to tasks.json using Content Assist.

DVT provides the following built-in problem matchers:

  • VCS

    • dvt-vcs-error

    • dvt-vcs-fatal

    • dvt-vcs-warning

    • dvt-vcs-lint

    • dvt-vcs-asertion

    • dvt-vcs-open-file-error

    • dvt-vcs-redefined-macro-warning

  • Questa

    • dvt-questa-error-1

    • dvt-questa-error-2

    • dvt-questa-fatal-1

    • dvt-questa-fatal-2

    • dvt-questa-open-file-error

    • dvt-questa-open-file-fatal

    • dvt-questa-warning-1

    • dvt-questa-warning-2

  • IUS

    • dvt-ius-error

    • dvt-ius-error-multiline

    • dvt-ius-fatal

    • dvt-ius-fatal-multiline

    • dvt-ius-note-1

    • dvt-ius-note-2

    • dvt-ius-upf-cpf-error

    • dvt-ius-upf-cpf-fatal

    • dvt-ius-warning

    • dvt-ius-warning-multiline-1

    • dvt-ius-warning-multiline-2

  • UVM

    • dvt-uvm-error

    • dvt-uvm-fatal

    • dvt-uvm-warning

    • dvt-uvm-info

NOTE: It is required to pass the output of the simulator to ${DVT_SIMLOG_PROCESSOR} (as shown in the above example). Doing so ensures that VS Code multiline problem matcher limitations will be overcome. The ${DVT_SIMLOG_PROCESSOR} environment variable resolves to an internal script that performs minor changes to the simulator output in order to make it matchable.

Problem Matchers Customization

For further tuning of the problem matchers, DVT offers the possibility to customize the above mentioned matchers. Use the Insert Snippet command or the Content Assist to select a problem matcher template proposal. The full definition of the matcher will be inserted at the current cursor position allowing for any specific modification. For more information see the Defining a Problem Matcher chapter in the official VS Code documentation.