Easy Tutorial
❮ Js Filter Table Android Tutorial Download2 ❯

8.1 Introduction to Verilog PLI

Category Advanced Verilog Tutorial

When engaging in digital design, special situations often arise where the tasks and functions in Verilog cannot meet the simulation requirements, necessitating the customization of some system tasks and functions. The Programming Language Interface (PLI) provides a set of interface subroutines for accessing the internal data structures of the design and extracting simulation environment information. Users can invoke these subroutines to define system tasks and functions, interacting with the internal data of the design and the Verilog simulator environment.

PLI Functions

In layman's terms, Verilog PLI offers a set of C language functions that designers can call to write software C programs. During RTL compilation, the software program written is also integrated into the simulation environment. When the simulation is running, system tasks can be called to dynamically access the data structures in the simulation. This access is bidirectional, allowing not only reading of information from the simulator's data structures but also modification of the data structure information.

The capabilities of PLI are extremely powerful, limited only by the designer's imagination.

Here is a summary of the frequently used functions of PLI:

PLI Versions

The development of PLI has mainly gone through three generations.

1985-TF Interface

The first generation is called the Task/Function interface, or TF interface for short. The TF interface includes a set of C language function libraries, all prefixed with tf_, defined in veriuser.h. These C functions are generally referred to as TF subroutines, mainly including user-defined tasks and functions, utility functions, callback mechanisms, and data write outputs.

1989-ACC Interface

The second generation is called the Access interface, or ACC interface for short. The functions in the ACC interface are all prefixed with acc_, defined in acc_user.h. ACC subroutines are mainly used for accessing and modifying various objects described in Verilog. The ACC library functions are an addition to the TF library functions, not a replacement.

The general PLI interface specifically refers to the TF and ACC interfaces.

1995-VPI Interface

The third generation is called the Verilog Process Interface, or VPI interface for short. VPI subroutines are a combination of the functions of TF and ACC subroutines, defined in vpi_user.h.

Compared to the numerous and chaotic PLI subroutines, VPI is particularly refined. Due to the lack of a unified standard at the inception of PLI, which evolved entirely in practice, there are nearly a hundred commonly used PLI library functions, and it is basically necessary to refer to the manual when writing programs.

VPI, on the other hand, was planned and formulated according to certain standards, incorporating many object-oriented ideas, and the library functions are far more streamlined than PLI. However, VPI has a more complex structure and is not easy to get started with. The biggest weakness of VPI is still the lack of friendly support for simulators.

2003-SystemVerilog and DPI

As an extension of Verilog, the SystemVerilog standard was released in 2003, supporting more forms of simulation.

The DPI interface (Direct Process Interface) has become the interface for interaction between software and SystemVerilog -9.2 Verilog Synthesizable Design

WeChat Follow

❮ Js Filter Table Android Tutorial Download2 ❯