Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
[ Team LiB ] 13.1 Uses of PLI PLI provides a powerful capability to extend the Verilog language by allowing users to define their own utilities to access the internal design representation. PLI has various applications | Team LiB 13.1 Uses of PLI PLI provides a powerful capability to extend the Verilog language by allowing users to define their own utilities to access the internal design representation. PLI has various applications. PLI can be used to define additional system tasks and functions. Typical examples are monitoring tasks stimulus tasks debugging tasks and complex operations that cannot be implemented with standard Verilog constructs. Application software like translators and delay calculators can be written with PLI. PLI can be used to extract design information such as hierarchy connectivity fanout and number of logic elements of a certain type. PLI can be used to write special-purpose or customized output display routines. Waveform viewers can use this file to generate waveforms logic connectivity source level browsers and hierarchy information. Routines that provide stimulus to the simulation can be written with PLI. The stimulus could be automatically generated or translated from some other form of stimulus. General Verilog-based application software can be written with PLI routines. This software will work with all Verilog simulators because of the uniform access provided by the PLI interface. Team LiB Team LiB 13.2 Linking and Invocation of PLI Tasks Designers can write their own user-defined system tasks by using PLI library routines. However the Verilog simulator must know about the existence of the user-defined system task and its corresponding user-defined C function. This is done by linking the user-defined system task into the Verilog simulator. To understand the process let us consider the example of a simple system task hello_verilog. When invoked the task simply prints out a message Hello Verilog World . First the C routine that implements the task must be defined with PLI library routines. The C routine hello_verilog in the file hello_verilog.c is shown below. include veriuser.h include the file provided in release dir int hello_verilog io_printf Hello