DVT IDE for VS Code SystemVerilog User Guide
Rev. 24.1.6, 27 March 2024

37.4 Compilation Speed-up

Several DVT directives can help you reduce this duration, by shrinking the analysis of the full build or by limiting some functionalities in some sections of code.

This application note responds to performance related questions in terms of full build duration and memory consumption.

How can I stop compiling some files?

All you need for this is to use the +dvt_skip_compile directive.

It allows DVT to completely skip some files during the full build process.

The advantage of skipping compilation can be seen both in terms of build duration and memory consumption.

Note that, by skipping files from compilation, you might end up with false positive errors. This is caused by DVT not compiling the definition of some types (classes, modules, typedefs etc.). To fix this issue you will need Compile_Waivers.

The directive comes in several flavors:

  • +dvt_skip_compile+<simple_pattern>

  • +dvt_skip_compile+not+<simple_pattern>

  • +dvt_skip_compile+regex+<regex_pattern>

  • +dvt_skip_compile+regex+not+<regex_pattern>

In a simple pattern you can use wildcards such as '*' (any string) and '?' (any character). The absolute paths are considered for pattern matching.

If you want to skip compiling all the files under */dir1/*, you can add to the build configuration the following line:

+dvt_skip_compile+*/dir1/*

If you want to skip compiling all the files except those under */dir1/*, use:

+dvt_skip_compile+not+*/dir1/*

If you want to skip compiling all the files except those under */dir1/* and */dir2/*, use:

+dvt_skip_compile+not+*/dir1/*
+dvt_skip_compile+not+*/dir2/*

Or

+dvt_skip_compile+regex+not+(.*/dir1/.*|.*/dir2/.*)

Note: If +dvt_skip_compile+not is the first skip directive encountered, then a preceding +dvt_skip_compile+* is implied. Note: The +dvt_skip_compile directive affects only the +dvt_init section it resides in. To specify the same set of skip compile directives for all +dvt_init sections, use +dvt_prepend_init.

Skip compile directives are applied in order when determining which files to be skipped. For this reason, the following configuration will result in all files under dir1 being skipped except those under dir1/dir2.

+dvt_skip_compile+*/dir1/*
+dvt_skip_compile+not+*/dir1/dir2/*

Skipped files are decorated distinctively in the Navigator View / Explorer View.

DVT Eclipse:

DVT for VS Code:

How can I compile the API only?

When you want to use some IPs, or internal code you don't need to change, the shallow compilation mode can help you.

This will ensure that DVT parses the shallow compiled files and extracts the API from them, leaving aside the details at the same time. This means DVT will still detect all the classes, modules, interfaces and so on, but it will only take into consideration the minimum necessary to use their API. For example, only the ports and parameters will be collected from within a module and only arguments will be collected for functions and tasks.

This approach will lower the build time and memory consumption, but a smaller scale compared to +dvt_skip_compile.

The advantage of using shallow compilation resides in the ability to use the shallow compiled API. Modules and functions will appear in the Autocomplete proposal list, hyperlinks like "Open Declaration" will work and, most importantly, no new errors will be triggered, meaning there is no need to add Compile Waivers.

To enable the shallow compilation, use the following directive:

  • +dvt_shallow_compile+<mode>[+not|+regex|+regex+not]+<pattern>

Where <mode> is one of:

  • FILE : modules and functions declared in files with an absolute path matching <pattern>

  • MODULE : modules with a name matching <pattern>

  • FUNCTION : functions with a fully qualified name matching <pattern>

A fully qualified name is preceded by a hierarchical path of scopes. For a function foo belonging to my_class in my_pkg the fully qualified name is my_pkg::my_class.foo.

In a simple pattern you can use wildcards such as '*' (any string) and '?' (any character).

Note: If +dvt_shallow_compile+<mode>+not is the first skip directive encountered, then a preceding +dvt_shallow_compile+FILE+* is implied. Note: The +dvt_shallow_compile directive affects only the +dvt_init section it resides in. To specify the same set of shallow compile directives for all +dvt_init sections, use +dvt_prepend_init.

Shallow compile directives are applied in order when determining which modules or functions to shallow compile.

Examples:

Shallow compile everything+dvt_shallow_compile+FILE+*
Shallow compile the design - all modules except the testbench top+dvt_shallow_compile+MODULE+*


+dvt_shallow_compile+MODULE+not+fully_qualified_name_of_tb_top
Shallow compile a subset of the design - all modules in files matching pattern+dvt_shallow_compile+FILE+*pattern*
Shallow compile a VIP - all functions in package+dvt_shallow_compile+FUNCTION+vip_pkg::*
Shallow compile everything except for a particular package+dvt_shallow_compile+FILE+*


+dvt_shallow_compile+FUNCTION+not+compiled_pkg::*

Visual indicators are added in multiple places:

A notification at the top of the editor
Not available in VS Code
An "[S]" indicator in the views: Compile Order, Types, Design Hierarchy, Verification Hierarchy
An "[S]" indicator in the diagrams: Schematic Diagrams, UVM Component Diagrams
A "(shallow)" indicator in the Console View during full build

Note: Design Hierarchy and Verification Hierarchy will not show instances for shallow compiled elements (modules/UVM components).

Note: Some functionalities may not fully work in shallow compiled API (i.e. show usages, refactoring)

How to improve the elaboration time

To improve the elaboration time, you can configure it with the directives found in the Elaboration Performance documentation page.