Verilog Pli的基本使用方法(modelsim)
2012-06-02
标签:

内容未做证实,仅供参考。

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一章

可能会用到的工具/仪表
相关文章
推荐文章
热门文章
章节目录
本站简介 | 意见建议 | 免责声明 | 版权声明 | 联系我们
CopyRight@2024-2039 嵌入式资源网
蜀ICP备2021025729号