DVT SystemVerilog IDE User Guide
Rev. 24.2.25, 31 October 2024

42.1 C/C++ support

C and C++ support is provided on top of the C Development Tooling Eclipse (CDT) plugin. DVT provides the following features on top of CDT:

Installation

The CDT plugin is already bundled in DVT KIT distributions, and has to be enabled using the dvt_kit_installer.sh script:

dvt_kit_installer.sh install CDT

This command installs the CDT plugin and the DVT CDT Integration plugin as well.

Project Natures

Right click on a project and choose Change DVT Nature:

  • The C/C++ Language nature enables basic CDT integration features: project configuration and SystemVerilog DPI cross-linking when the SystemVerilog nature is also enabled

  • The C/C++ Language Extended nature enables advanced features like C/C++ content shown in the DVT views

Project Build

For a DVT project with any C/C++ Language nature, the build process includes a scan for C/C++ files and CDT re-indexing.

Note: By default the CDT Codan, the code analysis engine which performns semantic checks in C and C++ code, is not active. Using the +dvt_run_codan+FULL+INCR directive you can specify when CDT Codan analysis should be performed: FULL - at full build, INCR - at incremental build (for example when saving a file).

During full build, DVT collects the following C/C++ specific directives from your build configuration file and uses them to configure CDT and to scan for all included C/C++ files:

  • -I

  • -D

  • -L

  • -l

  • -imacros

  • -include

The gcc args mentioned above are also collected from the strings passed to the following build configuration directives:

  • -CFLAGS

  • -ccflags

  • -ccargs

The C/C++ sources located outside the project directory are automatically linked inside the project under the DVT Auto-Linked folder.

The C/C++ sources located inside the project but not included by the C/C++ top files specified in the build configuration are automatically excluded from the CDT build.

The following DVT specific build configuration directives are available:

Directive Description
+dvt_gcc+</path/to/gcc_executable>Specify location of GCC executable (used when scanning for included C/C++ files and injected in the CDT project configuration).
+dvt_gcc_args+"args string"Specify extra arguments for the GCC executable (used when scanning for included C/C++ files and injected in the CDT project configuration).
+dvt_gcc_timeout+<timeout>Timeout in seconds when running GCC. Set 0 to disable timeout. Default: 40 seconds.