|
<< Click to Display Table of Contents >> 2.11 Using VPI applications to interface to the Simulator |
![]() ![]()
|
VeriLogger Extreme supports VPI (also called PLI 2.0). VPI is a C-based interface for communicating with Verilog simulators. Users create C/C++-based VPI applications that will be loaded by the Verilog simulator via dynamic linking (a dynamic link library(.dll) on Windows or a shared library(.so) on Unix). VeriLogger also supports the older PLI 1.0 standard (tf/acc functions).
Overview of VPI Example application
VeriLogger ships with an example VPI application that you can build and run under the SynaptiCAD/vpi_test directory to test out VPI functionality and learn how to use VPI function calls.
This example, vpi_test, is a VPI application that registers several user-defined tasks that can be called from Verilog source code. The main purpose of these tasks is to test the VPI functionality of a simulator and demonstrate the usage of VPI C calls. The code for registering the tasks is located in vpi_dll.c. The most important of these tasks is:
$traverse_top_modules
which will dump information about all the design objects in a simulation to the simulation log. For example, to dump the vpi structure of a verilog design, add these lines to one of your Verilog modules to call this function at the start of your simulation run:
initial
$traverse_top_modules;
Selecting an appropriate C/C++ compiler to compile the VPI application
VeriLogger Extreme ships with two versions of the simulator: a 32-bit simulator called simx32 and a 64-bit simulator called simx64. You must use an appropriate version of your C/C++ compiler to build a compatible PLI application (i.e. a 32bit PLI application for simx32 or a 64bit PLI application for simx64).
Basic Steps for creating and running the sample VPI application
initial $traverse_top_modules;
|
![]()
|

Note: When building, you may see the following warnings:
|
These warnings are benign and can safely be ignored.
Enabling PLI/VPI access to object values (e.g. reg and wire values)
When simx is run under the BugHunter GUI, the +linedebug command line option is passed to the simulator. This option allows PLI applications to read and write the values of regs and wires (the GUI needs this option for it's debug capabilities also). However, when the simulator is run standalone from the command line, you will need to pass this option if your PLI application uses functions that read or write these objects. If this option is not passed and your application calls such a function, you will get a warning message such as:
pli_r: Warning 95002 ./myfile.v(26): Object of type vpiIntegerVar does not have a value.
Include files for VPI, ACC, and TF Functions
The header files to include in your PLI application are located in your SynaptiCAD installation directory under the subdirectory: simxkernel\src\vpi\rh .
|
Some SynaptiCAD specific functions can also be used by including these files: acc_user_syncad.h and vpi_user_syncad.h.