您的位置:技术中心首页 > 逻辑验证 >> Verilog Pli的基本使用方法(modelsim)

Verilog Pli的基本使用方法(modelsim)

作者:未知   时间:2006-02-18 12:19:04  来自:网上转载  浏览次数:1068  文字大小:【】【】【

本文从http://www.msnfans.com/panyf/archives/32647.php转载,如有版权问题请与5life联系。
另:内容未做证实,如有问题请跟帖讨论。

1.hello.c文件内容
#include
#include "veriuser.h"
static PLI_INT32 hello()
{
printf("Hi there\n");
return 0;
}
s_tfcell veriusertfs[] = {
{usertask, 0, 0, 0, hello, 0, "$hello"},
{0} /* last entry must be 0 */
};


2.hello.v文件内容
module hello;
initial
begin
$hello;
end
endmodule


3.在VC(命令提示行下)下编译hello.c
3.1 cl –c –I
  hello.c // dir为绝对路径或者进入hello.c所在的目录 用 . 代替
3.2 link –dll –export:veriusertfs hello.obj /out:hello.dll
3.3 将生成的hello.dll文件拷贝到D:\Program Files\Modeltech_5.7e\win32(modelsim的dll文件夹)


4. 在modelsim下命令
4.1 vsim –c –pli hello.dll hello
4.2 run –all // 如果没有显示 再试vsim hello(因为有可能已经print了,但没有显示而已)


说明:可以参考modelsim的帮助里的user’s manual中的pli/vpi一章

责任编辑:5life

更多相关 Verilog PLI modelsim 的文章

仿真工作流程(Verilog/Modelsim+Debussy) [2007-05-14]
Verilog 的些许经验 [2006-09-05]
Modelsim 教程 [2006-03-26]
Verilog学习笔记(More) [2006-02-27]
Verilog PLI教程 --- 第七部分 VPI 函数 [2006-02-19]
Verilog PLI教程 --- 第三部分 PLI 程序 [2006-02-19]
Verilog PLI教程 --- 第五部分 PLI例子 [2006-02-19]
Verilog PLI教程 --- 第二部分 编写PLI应用程序 [2006-02-18]
Verilog PLI教程 --- 第一部分 介绍 [2006-02-18]
PLI步步为营 -- 二、PLI中的helloworld程序 [2006-02-18]
PLI步步为营 -- 一、PLI概述 [2006-02-18]
本文共有0条评论,现在显示最新的5条。

栏目导航

电路基础
硬件语言
逻辑验证
电路综合
后端设计
可测设计
基本逻辑
制造工艺
书籍精选
说文解字
工具学习
数字滤波
趣闻逸事
数字锁相
设计杂项
低耗设计

站点最新

更多相关链接

  仿真工作流程(Verilog/M...
  Modelsim 教程
  Debussy 教程
  Verilog PLI教程 --- 第...
  Verilog PLI教程 --- 第...
  Verilog PLI教程 --- 第...
  Verilog PLI教程 --- 第...
  Verilog PLI教程 --- 第...
  PLI步步为营 -- 二、PLI...
  PLI步步为营 -- 一、PLI概述

栏目最新

更多相关链接

  仿真工作流程(Verilog/M...
  Modelsim 教程
  Debussy 教程
  Verilog PLI教程 --- 第...
  Verilog PLI教程 --- 第...
  Verilog PLI教程 --- 第...
  Verilog PLI教程 --- 第...
  Verilog PLI教程 --- 第...
  PLI步步为营 -- 二、PLI...
  PLI步步为营 -- 一、PLI概述

热点文章

更多相关链接