微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微电子和IC设计 > 微电子学习交流 > 问个PLI的问题

问个PLI的问题

时间:12-12 整理:3721RD 点击:
我写了一个简单的PLI
hello_vpi.c:内容就是打印一个hello world
用这条命令编译出so文件:
gcc -shared -fPIC -o mypli.so hello_vpi.c
用NC仿真,已经加了下面这个option
+loadpli1=/<MY_PLI_DIR>/mypli.so
但是在仿真的时候,还是抱错,说:
Unrecognized system task or function
User Defined system task or function registered during elaboration and used within the simulation has not been registered during simulation.
可是我已经注册了阿
hello_vpi.c的内容如下:
PLI_INT32 PLI_hello_calltf(PLI_BYTE8 *user_data)
{
     vpi_printf("\n hello from pli!\n");
     return 0;
}
void PLI_hello_register()
{
     s_vpi_systf_data tf_data;
     tf_data.type = vpiSysTask;
     tf_data.sysfunctype = 0;
     tf_data.tfname = "$hello";
     tf_data.calltf = PLI_hello_calltf;
     tf_data.compiletf = NULL;
     tf_data.sizetf = NULL;
     tf_data.user_data = NULL;
     vpi_register_systf(&tf_data);
     return;
}
求指点
哪里出了问题

查了一下
好像是编译C有点问题:
cannot open shared object file: No such file or directory or file is not valid ELFCLASS32 library
mypli.so路径肯定是对的
好像是file is not valid ELFCLASS32 library

ms是我系统是64位,而要求so是32位的问题。。。。。


强制编译成32位的了
但是报这个错:
Failed to find requested bootstrap routine hello in library mypli.so
User Defined system task or function registered during elaboration and used within the simulation has not been registered during simulation.
我还在仿真的时候加了这个option
+loadvpi=/<MY_PLI_DIR>/mypli.so:hello
指定注册函数的名称
但是,现在不知道问题在哪里了。。。。。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top