PLI 基础
Verilog 提供了PLI(Programming Language Interface)机制, 用来进行硬件设计和软件设计者进行交互。 它可以在Verilog的设计之中加入用户自定义的系统函数,这些系统函数是通过C语言软件的方式实现, 这可以理解为, 通过插件的方式, 来扩充硬件设计语言的功能。
PLI常见的功能如下:
- C语言bus函数建模;
- 访问C语言代码库函数;
- 延时计算功能;
- 自定义输出显示;
- 联合仿真;
- 设计的debug功能;
- 仿真结果分析;
我们比较感兴趣的是访问C语言代码库函数以及design debug功能, 这也是我们后面扩展和使用PLI的功能。 目前的PLI用的比较新的功能是基于VPI的, 我们就忽略ACC/TF部分。
(System)Verilog LRM提供了如下的VPI头文件:
vpi_user.h
sv_vpi_user.h (SystemVerlog部分)
添加系统函数的步骤
The general steps to create a PLI application are:
- Define a system task or system function name for the application.
- Write a C language calltf routine which will be executed by the simulator whenever
simulation encounters the system task name or the system function name.
Optionally, additional C language routines can be written which will be executed
by the simulator for

最低0.47元/天 解锁文章
2736

被折叠的 条评论
为什么被折叠?



