- Verilog Procedural Interface
The Verilog Procedural Interface (VPI) is an interface primarily intended for the
C programming language . It allows behavioralVerilog code to invoke C functions, and C functions to invoke standard Verilog system tasks. TheIEEE 1364-2005 standard defines the Verilog Procedural Interface. VPI is sometimes also referred to as PLI 2, since it replaces thedeprecated Program Language Interface (PLI).Example
As an example, consider the following Verilog code fragment:
Suppose the
increment
system task increments its first parameter by one. Using C and the VPI mechanism, theincrement
task can be implemented as follows:Also, a function that registers this system task is necessary. This function is invoked prior to elaboration or resolution of references when it is placed in the externally visible
vlog_startup_routines []
array.The C code is compiled into a shared object that will be used by the Verilog simulator. A simulation of the earlier mentioned Verilog fragment will now result in the following output:
VPI routine received 41After $increment, val=42ources
* [http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=496013 IEEE Xplore]
External links
* [http://www.edn.com/article/CA46145.html Verilog PLI primer]
* [http://www.asic-world.com/verilog/pli6.html#Verilog_Procedural_Interface_(VPI) Verilog VPI tutorial]
* [http://ruby-vpi.rubyforge.org/ Ruby-VPI] - Verilog VPI interface for theRuby programming language
* [http://jove.sourceforge.net/ JOVE] - Verilog VPI interface for theJava programming language
* [http://teal.sourceforge.net/ Teal] - Verilog VPI interface for theC++ programming language
* [http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/ ScriptEDA] - Verilog VPI interface for thePerl programming language ,Python programming language , andTcl programming language
Wikimedia Foundation. 2010.