Merge branch 'master' into verilog-ams
[sverilog.git] / vpi.txt
blob27cfb3830dfeab1531283f81f875478c7a56bab6
2 HOW IT WORKS
4 The VPI interface for Icarus Verilog works by creating from a
5 collection of PLI applications a single vpi module. The vpi module
6 includes compiled code for the applications linked together (with any
7 other libraries that the applications need) into a module with a
8 single exported symbol, the vlog_startup_routines array.
10 The product that wishes to invoke the module (normally at run time)
11 loads the module, locates the vlog_startup_routines table, and calls
12 all the startup routines contained in that table. It is possible for a
13 product to link with many modules. In that case, all the modules are
14 linked in and startup routines are called in order.
16 The product that uses vpi modules uses the environment variable
17 VPI_MODULE_PATH as a ':' separated list of directories. This is the
18 module search path. When a module is specified by name (using whatever
19 means the product supports) the module search path is scanned until
20 the module is located.
22 The special module name "system.vpi" is part of the core Icarus
23 Verilog distribution and includes implementations of the standard
24 system tasks/functions.
26 COMPILING A VPI MODULE
28 See the iverilog-vpi documentation.
30 TRACING VPI USE
32 The vvp command includes the ability to trace VPI calls. This is
33 useful if you are trying to debug a problem with your code. To
34 activate tracing simply set the VPI_TRACE environment variable, with
35 the path to a file where trace text gets written. For example:
37         setenv VPI_TRACE /tmp/foo.txt
39 This tracing is pretty verbose, so you don't want to run like this
40 normally. Also, the format of the tracing messages will change
41 according to my needs (and whim) so don't expect to be able to parse
42 it in software.