白皮书

Making your DPI-C interface a fast river of data

Use SystemVerilog DPI-C in simple ways to achieve complex results.

Making your DPI-C interface a fast river of data

SystemVerilog DPI-C remains a powerful way to combine C and C++ with SystemVerilog providing functionality including modeling, checking, verification, and user interface functions. SystemVerilog DPI-C enables functional verification teams to leverage C code for modeling, checking and utility functions. The simple “C” style call interface allows fast adoption and easy integration.

What else is in DPI-C?

Include files

SystemVerilog DPI-C contains constants, datatypes, access routines and other useful information. That information can be found in the include files that ship from the vendors. There should be a file named ‘svdpi.h’ with other supporting include files as needed.

Access routines

There are many access routines which do a variety of things. Feel free to use any of them, but the ones used in this paper and the associated examples are the easiest to understand and use. The svdpi.h contains hundreds of lines. It contains more than 90 constants, defines and access routines. The best advice on using these is to keep things as simple as possible. The access routines exist in part to help interpret the layout of complex structures that are passed back and forth. The best advice is to limit the complex structures that are passed back and forth.

This paper explains the workings of the integration and provides datatype mapping examples and some hints on optimizing the calls for maximum performance. Specific examples cover datatypes, scopes, threaded execution, and chandles to help teams either get started on using DPI-C or extend an existing implementation.

分享

相关资源